Common issues and their solutions#
"Connection refused" error when executing Layer0 commands#
When executing commands using the Layer0 CLI, you may see the following error message:
Get http://localhost:9090/command/: dial tcp 127.0.0.1:9090: connection refused
Where command
is the Layer0 command you are trying to execute.
This error indicates that your Layer0 environment variables have not been set for the current session. See the "Connect to a Layer0 Instance" section of the Layer0 installation guide for instructions for setting up your environment variables.
"Invalid Dockerrun.aws.json" error when creating a deploy#
Byte Order Marks (BOM) in Dockerrun file#
If your Dockerrun.aws.json file contains a Byte Order Marker, you may receive an "Invalid Dockerrun.aws.json" error when creating a deploy. If you create or edit the Dockerrun file using Visual Studio, and you have not modified the file encoding settings in Visual Studio, you are likely to encounter this error.
To remove the BOM:
-
At the command line, type the following to remove the BOM:
- (Linux/OS X)
tail -c +4 DockerrunFile > DockerrunFileNew
Replace
DockerrunFile
with the path to your Dockerrun file, andDockerrunFileNew
with a new name for the Dockerrun file without the BOM.
Alternatively, you can use the dos2unix file converter to remove the BOM from your Dockerrun files. Dos2unix is available for Windows, Linux and Mac OS.
To remove the BOM using dos2unix:
- At the command line, type the following:
dos2unix --remove-bom -n DockerrunFile DockerrunFileNew
Replace DockerrunFile with the path to your Dockerrun file, and DockerrunFileNew with a new name for the Dockerrun file without the BOM.
"AWS Error: the key pair '' does not exist (code 'ValidationError')" with l0-setup#
This occurs when you pass an invalid EC2 keypair to l0-setup. To fix this, follow the instructions for creating an EC2 Key Pair.
- After you've created a new EC2 Key Pair, use l0-setup init to reconfigure your instance:
l0-setup init --aws-ssh-key-pair keypair