Common Error Messages
Here are the meanings of common warning and error messages you may encounter in the Defang CLI.
Warnings
"The folder is not empty. Files may be overwritten."
- This message is displayed when you run
defang generateand the target folder is not empty. If you proceed, Defang will overwrite any existing files with the same name. If you want to keep the existing files, you should move them to a different folder before runningdefang generateor pick a different target folder.
"environment variable not found"
- This message is displayed when you run
defang compose upand the Compose file references an environment variable that is not set. If you proceed, the environment variable will be empty in the container. If you want to set the environment variable, you should set it in the environment where you rundefang compose up.
"Unsupported platform"
- This message is displayed when you run
defang compose upand the Compose file references a platform that is not supported by Defang.
"not logged in"
- This message is displayed when you run
defang compose configbut you are not logged in. The displayed configuration will be incomplete. If you want to see the complete configuration, you should log in first usingdefang login.
"No port mode was specified; assuming 'host'"
- This message is displayed when you run
defang compose upand the Compose file declares aportthat does not specify a portmode. By default, Defang will keep the port private. If you want to expose the port to the public internet, you should specify themodeasingress:
services:
service1:
…
ports:
- target: 80
mode: ingress
"Published ports are not supported in ingress mode; assuming 'host'"
- This message is displayed when you run
defang compose upand the Compose file declares aportwithmodeset toingressandpublishedset to a port number. Defang does not support published ports in ingress mode. If you want to expose the port to the public internet, you should specify themodeasingressand remove thepublishedsetting.
"TCP ingress is not supported; assuming HTTP"
- This message is displayed when you run
defang compose upand the Compose file declares aportwithmodeset toingressandprotocolset totcp. Defang does not support arbitrary TCP ingress and will assume the port is used for HTTP traffic. To silence the warning, remove theprotocolsetting.
"unsupported compose directive"
- This message is displayed when you run
defang compose upand the Compose file declares a directive that is not supported by Defang. The deployment will continue, but the unsupported directive will be ignored, which may cause unexpected behavior.
"no reservations specified; using limits as reservations"
- This message is displayed when you run
defang compose upand the Compose file declares aresourcewithlimitsbut noreservations. Defang will use thelimitsasreservationsto ensure the container has enough resources. Specifyreservationsif you want to silence the warning or reserve a different amount of resources:
services:
service1:
…
deploy:
resources:
reservations:
cpus: 0.5
memory: 512MB
"ingress port without healthcheck defaults to GET / HTTP/1.1"
- This message is displayed when you run
defang compose upand the Compose file declares aningresswith aportbut nohealthcheck. Defang will assume the default healthcheck ofGET / HTTP/1.1to ensure the port is healthy. Specify ahealthcheckif you want to silence the warning or use a different healthcheck:
services:
service1:
…
deploy:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/health"]
"missing memory reservation; specify deploy.resources.reservations.memory to avoid out-of-memory errors"
- This message is displayed when you run
defang compose upand the Compose file doesn't specify amemoryreservation. If available, Defang will use thememorylimit as thememoryreservation. Specify amemoryreservation if you want to silence the warning or reserve a different amount of memory:
services:
service1:
…
deploy:
resources:
reservations:
memory: 512MB
"The build context contains more than 10 files"
- This message is displayed when you run
defang compose upand the Compose file declares abuildwith acontextthat contains more than 10 files. Ensure the context refers to the correct folder. Defang will use thecontextas is, but you may experience slow build times. If you want to speed up the build, you should reduce the number of files in thecontext.
"AWS provider was selected, but AWS environment variables are not set"
- This message is displayed when you run
defang compose upwith the--provider=awsbut none of the AWS environment variables were set. If you proceed, the deployment might fail, unless you have defined defineddefaultcredentials in the AWS configuration files or are running on an AWS instance.
"Using Defang provider, but AWS environment variables were detected"
- This message is displayed when you run
defang compose upwith the--provider=defangbut AWS environment variables were detected. The AWS environment variables will be ignored.
Errors
"Stack:… is in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS state and cannot be updated"
- This happens if different version of the Defang CLI are used with the same AWS account. Each version one will try to update the CD stack to its version, back and forth. Make sure that all users have the same version of the CLI. Check the CLI version using
defang version.
"invalid healthcheck: ingress ports require an HTTP healthcheck on localhost."
- This message is displayed when
defang compose uptries to deploy a service with an "ingress" port, if the service does not have ahealthcheckwhich mentionslocalhost. Defang routes a load balancer to your service's ingress ports, and the loadbalancer needs to be able to check the health of the service. To solve this issue, ask yourself these two questions:
-
Should my service be public? It's common to declare your container's ports using the Compose file "shorthand" syntax (
1234:1234). This syntax can be understood as[HOST:]CONTAINER. If your service is not intended to be public, you do not need to declare a HOST port. For example:services:
my-service:
image: my-image
ports:
- - "1234:1234"
+ - "1234" -
Does my healthcheck include the string
localhost? It is very common to define a healthcheck by usingcurlorwgetto make a request tolocalhost. So common, in fact, that Defang will look for the stringlocalhostin your healthcheck definition. For example, this healthcheck is valid:healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:1234/health"]This healthcheck is not valid for
ingressports:healthcheck:
test: ["CMD", "./my-healthcheck"]
"The build aborted with OutOfMemoryError: Container killed due to memory usage"
The image build might fail if the build process uses too much memory. The first thing to try is to limit the size of your project by excluding unnecessary files: the easiest way is to create a .dockerignore file that excludes irrelevatn files. Note that Defang will use a default .dockerignore file if you don't have one, but that default might not work for some projects and it's always better to make a .dockerignore file specific to your project.
If that doesn't work, see our Resources documentation for more information on how to configure the memory requirements and disk space requirements for your image builds.