Skip to main content
Version: v4.5.0

STK CLI

See below the errors you may experience when using STK CLI, and how you can resolve them:

Git permission error when I run some STK CLI commands

Possible Cause
Users have permission on Git repositories, but on some separate repositories, this is not the case.

Solution
Check your Git permissions before running the command and contact the repository administrator. For more information, check out the GitHub documentation.


I just configured the STK CLI and the error appears zsh: permission denied: stk-legacy

Possible Cause
It is a macOS-specific problem with a private VPN.

Solution
Run the command below in your terminal:

chsh -s /bin/zsh

In thexcrun. Example: xcrun: error: invalid active developer path

Possible Cause
It is a MacOS update problem.

Solution
Update the
Xcode Developer Tool:xcode-select --install** and try again.


I tried to use the activation code and the following error occurred: [WinError 2] The system cannot find the specified file Traceback (most recent call last)

Possible Cause

The STK CLI uses Windows wmic to get the ID information of the machine, the error occurs when the PATH where wmic is located is changed or non-existent and returns the message below:

[WinError 2] The system cannot find the specified file
Traceback (most recent call last):
File "core\activation.py", line 79, in __check_machine_id
File "metrics\metricsbuilder.py", line 21, in __init__
File "metrics\metricsbuilder.py", line 54, in __get_machine_id
File "subprocess.py", line 420, in check_output
File "subprocess.py", line 501, in run
File "subprocess.py", line 966, in __init__
File "subprocess.py", line 1435, in _execute_child
FileNotFoundError: [WinError 2] O sistema não pode encontrar o arquivo especificado

Solution

To modify the Windows PATH environment variable, follow the steps below:

1. Right-click on My Computer (on the desktop or in the Start menu). Then click on Properties.
2 In the System Properties dialog box, click the Advanced tab.
3 Click on Environment Variables.
4. In the top list, scroll down to the PATH variable, select it and click Edit. 5. In the Variable Value box, navigate to the end of the variable. If there is no semicolon (;) at the end of the current path, add one, and then enter the path: c:\windowssystem32`.
6 Click OK to close each of the dialog boxes.


I installed the STK CLI for MacOS, but it always asks for administrator permission

Possible Cause

Installing the STK CLI via the GUI (two clicks on the stk.pgk file). It is not recommended to install via the GUI, as MacOS installs for the root user and causes various problems with the administrator permissions.

Solution

Install the STK CLI from the terminal. Follow the steps below:

1. Uninstall the STK CLI, and run the command in the terminal:

sh ~/.stk/bin/uninstall.sh

A message appears to confirm the uninstallation before it starts.

2. Still in the terminal, go to the directory where the installer is and run the command below:

installer -pkg stk.pkg -target CurrentUserHomeDirectory

Errors related to STK CLI commands

stk-legacy add plugin/ & stk-legacy add template

stk-legacy add <plugin/template> must run inside a stack folder created by stk-legacy create stack command!

Possible Cause
Execution of the `stk-legacy add plugin/stk-legacy add template command outside of a Stack (no stack.yaml file).

Solution
Create a Stack by using the stk-legacy create stack command and execute the stk-legacy add plugin/stk-legacy add template inside the created folder.


Error ocurred while adding template to stack: Cloning into '<from_path> '<destination_path>' failed

Possible Cause
Execution of the stk-legacy add plugin file://<local_folder> ou stk-legacy add template file://<local_folder> using file:// protocol

Solution
Configure git to allow file protocol

git config --global protocol.allow always


A directory named <nome-plugin/nome-template> already exists in this stack. Remove it before proceeding.

Possible Cause
When running the stk-legacy add plugin or stk-legacy add template commands using the path inside a Stack that already has a Plugin or Template with the same name.

Solution

  1. Delete the folder of the Plugin or Template with the same name.
  2. Change the name of the Plugin or Template that is being added.

A plugin/template named <name> already exists in this stack at dir {dir_name}. Remove it before proceeding

Possible Cause
Running the add plugin or add template commands inside a Stack that already has a Plugin or Template with the same name.

Solution

  1. Delete the folder of the Plugin or Template with the same name.
  2. Change the name of the Plugin or Template that is being added.

Can't clone "<url_git_plugin_ou_template>" git repository: <repo_url>

Possible Cause
Running the commands add plugin or add template could not clone the remote repository.

Solution
Check that you have permission to clone the repository and that your Git is configured properly.


Error ocurred while adding plugin/template to the stack: {git-error}

Possible Cause
When executing the add plugin or add template commands, an error occurred when executing the Git commands to add the Plugin/Template to your Stack.

Solution

Check the error message returned by Git. Also, make sure that Git is properly configured on your machine.

stk-legacy add stages

'stk-legacy add stages' cannot be run in an empty directory!

Possible Cause
The command add stages was executed in an empty folder.

Solution
Execute the add stages command inside an app folder.


"stk.yaml file not found"

Possible Cause
The stk-legacyadd stages command was executed in a folder that is not an app folder.

Solution
Run the stk-legacy add stages command inside an app folder.


"Invalid 'stages' option value. "

    "It must follow the format: "
"<name>:<aws-account-number>:<aws-region>[,<name>:<aws-account-number>:<aws-region>]*."

Possible Cause
Execution of the stk-legacy add stages command with parameter in the wrong format

Solution
Execute the command following the correct format, see below:

 stk-legacy add stages qa:12345:us-east-1,production:65432:us-east-2

stk-legacy apply plugin

'name' or 'plugin-path' options must be provided to execute 'stk-legacy apply plugin'

Possible Cause
The parameter with the Plugin name or path in the **`apply plugin`` command was not entered.

Solution
Enter a Plugin name or path. See the example below:

 stk-legacy apply plugin <my-stack>/<my-plugin>

"Invalid plugin name, the expected format is '[<stack_name>/]<plugin_name>'!"

Possible Cause
The Plugin name entered is not valid for the stk-legacy apply plugin command.

Solution
Enter a valid Plugin name from an already imported Stack in the stk-legacy pattern, see the example below:

 apply plugin <stack_name>/<plugin_name>

"Plugin was not found: {stack}/{plugin}!"

Possible Cause
The plugin entered in stk-legacy apply plugin was not found in your Stacks folder.

Solution
Check that the stack you are trying to use was imported correctly and that the plugin is in the stack.


"Plugin was not not found at: {template_path}"

Possible Cause
The path entered in stk-legacy apply plugin does not have a StackSpot Plugin.

Solution
Check that the path entered is for a plugin created with stk-legacy create plugin.


This plugin cannot be applied to an <application> stack!

Possible Cause
The Plugin type is not valid for the project to which it is being applied.

Solution
Check that you are using a Plugin of type app for projects created with stk-legacy create app.


stk-legacy create app

"'template', 'template-path' or 'stackfile' options must be provided to execute 'stk create app'."

Possible Cause
A Template or Stackfile was not entered when creating the app.

Solution

  1. Enter a Template using the --template flag.
  2. Enter a Stackfile from the --stackfile flag.

'template', 'template-path' or 'stackfile' options cannot be used together."

Possible Cause
The stk-legacy create app command was executed using the --template and --stackfile flags together.

Solution
Use only one flag in the command.


"{template} is invalid, expected stack/template."

Possible Cause
The stk-legacy create app command was created with an invalid Template.

Solution
Use a valid value for the --template flag in the default: <name_stack>/<name_template>.


{name} is not a valid name for a 'stk-legacy create app' in {command_path} command.

Name must start and end with letters or numbers, and can only contain letters, numbers and special characters: hyphen '-', underscore '_' and dot '.'.Example: valid-Name_123.abc"

Possible Cause
The project name used in the stk-legacy create app command is invalid.

Solution
Use a valid name that has only numbers, letters, hyphens ("-") or underscore ("_").


{name} folder already exists and is not empty."

Possible Cause
The stk-legacy create app command was executed in a folder that already has another folder with the same name as the project.

Solution
Use another name for the project.


{url} is not a valid git url.

Possible Cause
The URL used in the --app option is not a Git URL.

Solution
Use a URL from a Git repository that has an app created via the stk-legacy create app command.


Stackfile {stackfile} doesn't exist! Use stk-legacy list stackfile to list available stackfiles.

Possible Cause
The value used in the --stackfile option does not match any imported stackfile.

Solution
Use one of the available Stackfiles.

You can run the stk-legacy list stackfile command to see what Stackfiles are available.


"Invalid Stackfile: type is required."

Possible Cause
The used stackfile does not have the type defined.

Solution
Set the Stackfile to be of type: app.


"Invalid Stackfile: template is required."

Possible Cause
The used stackfile does not have a template defined.

Solution Set the Stackfile to have the template parameter.


"Invalid Stackfile: it is not the 'app' type ."

Possible Cause
The used stackfile does not have the correct type to execute the command.

Solution
Use an app stackfile for the stk-legacy create app command.


Application template {stack}/{template_name} doesn't exist! Use stk-legacy list template --app to list available application templates.

Possible Cause
The Template used in the --template option or the Template defined in the stackfile does not exist on your machine.

Solution
Import the stack that has the template. 2. Use an available Template (See which ones with the stk-legacy list template command).


Application template {template_path} doesn't exist! Use 'stk-legacy list template --app' to list available application templates.

Possible Cause
The template passed to the --template-path option does not exist or is not a StackSpot Template

Possible Solution
Use an absolute path to a StackSpot Template on your machine.


Application template in {stack}/{template_name} is invalid: It's not of type 'app-template'!

Possible Cause
The Template used in the --template-path option is not of type app-template.

Solution
Use a valid template of type app-template in the --template-path option.


Stackfile {stack}/{stackfile_name} was not found.

Possible Cause
The Stackfile entered in the stk-legacy create app command was not found.

Solution
Use the stk-legacy list stackfile command to see the available stackfiles in your organization.


Application template {stack}/{template_name} doesn't exist! Use 'stk-legacy list template --app' to list available application templates!

Possible Cause
The Template used in the --template option or in the stackfile was not found.

Solution
Use an existing Template on your machine.

You can view the existing templates by running the command: stk-legacy list template --app.


Application template {template_path} doesn't exist! Use 'stk-legacy list template --app' to list available application templates.

Possible Cause
The Template passed to the --template-path option does not exist or is not a StackSpot Template.

Solution
Use an absolute path to a StackSpot Template on your machine.


Application template in {template_path} is invalid: It's not of type 'app-template'!

Possible Cause
The Template used in the --template-path option is not of type app-template.

Solution
Use a valid Template of type app-template in the --template-path option.


'remote' option is required when 'NAME' argument is not provided.

Possible Cause
You did not enter a name for the app and did not enter a --remote option.

Solution Enter a name or the --remote option.


stk-legacy create plugin/stk-legacy create template

{name} folder already exists and is not empty.

Possible Cause
The commands stk-legacy apply plugin/stk-legacy apply template were executed in a folder that already has another folder with the same name as the project.

Solution Use another name for the project.


--remote option can't be used when 'stk-legacy create plugin/template' is executed inside a stack folder.

Possible Cause The `--remote option was used to create a Plugin inside an existing Stack.

Solution Do not use the --remote option to create the Stack.

If you want to add an existing Plugin/Template to a Stack, use the stk-legacy add plugin or stk-legacy add template command.


'types' option must be a comma separated combination of 'app'.

Possible Cause
Wrong value in the **`--types`` option.

Solution
Enter a correct value for --types as app.


"'types' option must be a comma separated combination of 'app-template'."

Possible Cause Wrong value in the --types option.

Solution Enter a correct value for --types as app-template.


Stackfile {stackfile} is invalid.

Possible Cause
The Stackfile value passed to the --stackfile option is not valid.

Solution
Verify that the Stackfile is valid and has been passed in the default: <name_stack>/<name_stackfile>.


stk-legacy create stack

{name} folder already exists!

Possible Cause
The command st-legacy create stack was executed in a folder that already has another folder with the same name as Stack.

Solution
Use another name for the Stack or use another folder.


stk-legacy create stackfile

"File <stackfile_name> already exists in directory."

Possible Cause
The stk-legacy create stackfile command was executed in a folder that already has a file named stackfile.

Solution
Use another name for the stackfile.

stk-legacy delete plugin/stk-legacy delete template

<plugin/template> <plugin/template_name> not found."

Possible Cause
The Plugin/Template reported to be deleted was not found.

Solution
Enter a name for an existing Plugin/Template within the Stack.


<plugin/template> <plugin/template_name> can't be removed.

Possible Cause
Some unexpected errors occurred during deletion.

Solution
Check the error detail for more information.

stk-legacy delete stack

The stack {stack_name} was not found."

Possible Cause
The Stack entered for deletion was not found.

Solution
Enter the name of an existing Stack.

Stack {stack_name} can't be removed.

Possible Cause
Some unexpected errors occurred during deletion.

Solution
Check the error detail for more information.



stk-legacy import stack

The provided url doesn't contain a valid stack: Missing 'stack.yaml' file!

Possible Cause
The URL entered in the stk-legacy import stack command does not have a Stack.

Solution
Import Stacks created from the stk-legacy create stack <stack_name> command.

The provided URL doesn't contain a valid stack: Missing 'name' attribute in 'stack.yaml' file!

Possible Cause
Using the stk-legacy import stack command on a repository that has an invalid Stack, and does not have the name attribute in its stack.yaml.

Solution
Fix the points of the Stack being imported. Use the stk-legacy import stack command to create a valid Stack.

<stack_name> already added to stk-legacy cli!

Possible Cause
Attempting to import a Stack that already exists on your machine.

Solution
The Stack is already imported. If you want to update it, use the stk-legacy update stack <stack_name> command.


{stack_url} is not a valid git URL, or you don't have permission to clone it.

Possible Cause
The URL used as an argument to stk-legacy import stack is not valid. You also do not have permission to access it.

Solution
Check that you have the necessary permissions on the repository and that the URL is correct.

stk-legacy list plugin/stk-legacy list template

The stack {stack_name} was not found.\nUse 'stk-legacy list stack' to list available stacks.

Possible Cause
The Stack used as a parameter to the stk-legacy list plugin/template <stack_name> does not exist on your machine.

Solution

  1. Import Stacks with the stk-legacy import stack command.
  2. List all Stacks using the stk-legacy list stack command.

Error with the list plugin and list template commands on Windows

The stk-legacy list plugin and stk-legacy list template commands create a .template directory in the folder where they are executed. See the example below:

$ stk-legacy list plugin
> no plugins found
Traceback (most recent call last):
File "cli.py", line 78, in <module>
File "cli.py", line 74, in main
File "cli.py", line 67, in main
File "click\core.py", line 1128, in __call__
File "click\core.py", line 1053, in main
File "click\core.py", line 1659, in invoke
File "click\core.py", line 1628, in _process_result
File "click\core.py", line 754, in invoke
File "click\decorators.py", line 26, in new_func
File "cli.py", line 62, in process_result
File "metrics\send.py", line 23, in decorator
File "plugin\list.py", line 46, in list_plugin
File "plugin\list.py", line 66, in _get_plugins_by_type
File "plugin\list.py", line 101, in _should_add_plugin
File "plugin\list.py", line 114, in _is_app_type
KeyError: 'types'
[1576] Failed to execute script 'cli' due to unhandled exception!

Possible Cause
Some cache or files may have been left over from the previous version that was uninstalled via "Add or remove programs ". Because of this, the new installer may not have cleaned or updated all the files.

Solution
Plugins are only listed again when update is forced with the --clean and --force-update flags. Run it in your terminal:

stk-legacy init --clean --force-update

stk-legacy list stackfile

The stack {stack_name} was not found!

Possible Cause
The Stack entered as a parameter to the stk-legacy list stackfile was not found.

Solution

  1. Use the stk-legacy list stackfile command with no arguments to see all available stackfiles.
  2. Import a Stack using the stk-legacy import stack command.

stk-legacy update app

Error: stk.yaml file not found

Possible Cause
The folder where the stk-legacy update app command was executed does not contain the stk.yaml file.

Solution
Check if the folder was created with the stk-legacy create app command.


stk-legacy update stack

Error: <stack_name> stack not found

Possible Cause
The Stack name used in the stk-legacy update stack command was not found on your machine.

Solution
Check that the stack you are trying to update was imported by the stk-legacy import stack command.


stk-legacy login

Error: {input_email} is an invalid e-mail. Please provide a valid one.

Possible Cause

The e-mail address entered during login is invalid.

Solution
Use a valid e-mail address such as user@organization.com.

Error: An error occurred while checking the token.

Possible cause This error happens when trying to log in to an account from another organization without ending the current session.

Solution It is necessary to close the current session before logging into another account, to solve this, follow the steps below:

1. Log out with the stk-legacy logout command to end the current session.
2. Then login with the stk-legacy login command with other organization's email .

danger

If these steps don't work, remove the session.json file from the /Users/<user.name>/.stk folder manually and report it to the STK CLI team to better understand this behavior.

Also check out

  • If you haven't found the solution to your problem, check out the .stk/logs.

Was this page helpful?