|
| 1 | +--- |
| 2 | +sidebar_position: 600 |
| 3 | +title: FAQ |
| 4 | +description: Frequently asked questions about Defang. |
| 5 | +--- |
| 6 | + |
| 7 | + |
| 8 | +# FAQ |
| 9 | + |
| 10 | +### Which cloud/region is the app being deployed to? |
| 11 | + |
| 12 | +- In the [Defang Playground](./concepts/defang-playground.md) the app is deployed to AWS `us-west-2`. In the [Defang BYOC](./concepts/defang-byoc.md) model, the region is determined by your [Defang BYOC Provider](/docs/category/providers) settings. |
| 13 | + |
| 14 | +### Can I bring my own AWS or other cloud account? |
| 15 | + |
| 16 | +- Yes! Defang makes it easy to deploy your application to your own cloud account. Please check out the [Defang BYOC](./concepts/defang-byoc.md) documentation for more information. |
| 17 | + |
| 18 | +### On AWS, can I deploy to services such as EC2, EKS, or Lambda? |
| 19 | + |
| 20 | +- The current release includes support for containers only, deployed to ECS. We are still exploring how to support additional execution models such as VMs and functions-as-a-service. However, using our Pulumi provider, it is possible to combine Defang services with other native AWS resources. |
| 21 | + |
| 22 | +### Can I access AWS storage services such as S3 or database services such as RDS? How? |
| 23 | + |
| 24 | +- Yes, you can access AWS services in the AWS Dashboard as you normally would when you are [deploying to your AWS account](./providers/aws) using Defang. In fact, you can access whatever other resources exist in the cloud account you are using for [Defang BYOC](./concepts/defang-byoc.md). |
| 25 | + |
| 26 | +### Can I run production apps with Defang? |
| 27 | + |
| 28 | +- Yes! Defang makes it easy to deploy your app on production-ready infrastructure in your own cloud account. For example, you can deploy your app to AWS with `defang up --provider=aws --mode=production`. Check out your preferred cloud provider on [Defang BYOC](./concepts/defang-byoc.md). |
| 29 | + |
| 30 | +### Does Defang support blue/green deployments? |
| 31 | + |
| 32 | +- Defang does not currently support Blue/Green deploys, but it does support rolling updates with the `production` deployment mode. `defang up --mode=production`. |
| 33 | + |
| 34 | +### Does Defang support rolling deployments? |
| 35 | + |
| 36 | +- Yes! Defang supports rolling updates with the `production` deployment mode. `defang up --mode=production`. |
| 37 | + |
| 38 | +### Can I cancel a deployment once it has started? |
| 39 | + |
| 40 | +- No. Once a deployment has started, it cannot be canceled. However, you can always deploy a new version of your app which will replace the current deployment. |
| 41 | + |
| 42 | +### Will deploying a new version of my app cause downtime? |
| 43 | + |
| 44 | +- If you have deployed your application with the `--mode=production` flag, Defang will use the _production_ deployment mode. This mode will provision your app with multiple replicas and will perform a rolling update to ensure zero downtime. If you use another deployment mode, you may experience downtime during the deployment, as Defang will not provision multiple replicas to save cost. |
| 45 | + |
| 46 | +### Can I deploy multiple services at once? |
| 47 | + |
| 48 | +- Yes! You can deploy multiple services at once by defining them in a single compose.yaml file. When you run `defang compose up`, Defang will deploy all the services defined in the file at once. |
| 49 | + |
| 50 | +### Can I deploy a service that depends on another service? |
| 51 | + |
| 52 | +- Defang does not currently support service dependencies. All services will be deployed simultaneously. Defang will however run multiple healthchecks before marking a service as healthy and spinning down any previously deployed services when using the `production` deployment mode. |
| 53 | + |
| 54 | +### Do you plan to support other clouds? |
| 55 | + |
| 56 | +- While we currently support [AWS](./concepts/defang-byoc#aws) for production and [DigitalOcean](./concepts/defang-byoc#digitalocean) in preview, we plan to support other clouds in future releases, such as [GCP](./providers/gcp.md) and [Azure](./providers/azure.md). |
| 57 | + |
| 58 | +### I'm having trouble running the binary on my Mac. What should I do? |
| 59 | + |
| 60 | +- MacOS users will need to allow the binary to run due to security settings: |
| 61 | + 1. Attempt to run the binary. You'll see a security prompt preventing you from running it. |
| 62 | + 2. Go to System Preferences > Privacy & Security > General. |
| 63 | + 3. In the 'Allow applications downloaded from:' section, you should see a message about Defang being blocked. Click 'Open Anyway'. |
| 64 | + 4. Alternatively, select the option "App Store and identified developers" to allow all applications from the App Store and identified developers to run. |
| 65 | + |
| 66 | +## Warnings |
| 67 | + |
| 68 | +### "The folder is not empty. Files may be overwritten." |
| 69 | +- This message is displayed when you run `defang generate` and 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 running `defang generate` or pick a different target folder. |
| 70 | + |
| 71 | +### "environment variable not found" |
| 72 | +- This message is displayed when you run `defang compose up` and 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 run `defang compose up`. |
| 73 | + |
| 74 | +### "Unsupported platform" |
| 75 | +- This message is displayed when you run `defang compose up` and the Compose file references a platform that is not supported by Defang. |
| 76 | + |
| 77 | +### "not logged in" |
| 78 | +- This message is displayed when you run `defang compose config` but you are not logged in. The displayed configuration will be incomplete. If you want to see the complete configuration, you should log in first using `defang login`. |
| 79 | + |
| 80 | +### "No port mode was specified; assuming 'host'" |
| 81 | +- This message is displayed when you run `defang compose up` and the Compose file declares a `port` that does not specify a port `mode`. By default, Defang will keep the port private. If you want to expose the port to the public internet, you should specify the `mode` as `ingress`: |
| 82 | +``` |
| 83 | +services: |
| 84 | + service1: |
| 85 | + … |
| 86 | + ports: |
| 87 | + - target: 80 |
| 88 | + mode: ingress |
| 89 | +``` |
| 90 | + |
| 91 | +### "Published ports are not supported in ingress mode; assuming 'host'" |
| 92 | +- This message is displayed when you run `defang compose up` and the Compose file declares a `port` with `mode` set to `ingress` and `published` set 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 the `mode` as `ingress` and remove the `published` setting. |
| 93 | + |
| 94 | +### "TCP ingress is not supported; assuming HTTP" |
| 95 | +- This message is displayed when you run `defang compose up` and the Compose file declares a `port` with `mode` set to `ingress` and `protocol` set to `tcp`. Defang does not support arbitrary TCP ingress and will assume the port is used for HTTP traffic. To silence the warning, remove the `protocol` setting. |
| 96 | + |
| 97 | +### "unsupported compose directive" |
| 98 | +- This message is displayed when you run `defang compose up` and 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. |
| 99 | + |
| 100 | +### "no reservations specified; using limits as reservations" |
| 101 | +- This message is displayed when you run `defang compose up` and the Compose file declares a `resource` with `limits` but no `reservations`. Defang will use the `limits` as `reservations` to ensure the container has enough resources. Specify `reservations` if you want to silence the warning or reserve a different amount of resources: |
| 102 | +``` |
| 103 | +services: |
| 104 | + service1: |
| 105 | + … |
| 106 | + deploy: |
| 107 | + resources: |
| 108 | + reservations: |
| 109 | + cpus: 0.5 |
| 110 | + memory: 512MB |
| 111 | +``` |
| 112 | + |
| 113 | +### "ingress port without healthcheck defaults to GET / HTTP/1.1" |
| 114 | +- This message is displayed when you run `defang compose up` and the Compose file declares an `ingress` with a `port` but no `healthcheck`. Defang will assume the default healthcheck of `GET / HTTP/1.1` to ensure the port is healthy. Specify a `healthcheck` if you want to silence the warning or use a different healthcheck: |
| 115 | +``` |
| 116 | +services: |
| 117 | + service1: |
| 118 | + … |
| 119 | + deploy: |
| 120 | + healthcheck: |
| 121 | + test: ["CMD", "curl", "-f", "http://localhost:80/health"] |
| 122 | +``` |
| 123 | + |
| 124 | +### "missing memory reservation; specify deploy.resources.reservations.memory to avoid out-of-memory errors" |
| 125 | +- This message is displayed when you run `defang compose up` and the Compose file doesn't specify a `memory` reservation. If available, Defang will use the `memory` limit as the `memory` reservation. Specify a `memory` reservation if you want to silence the warning or reserve a different amount of memory: |
| 126 | +``` |
| 127 | +services: |
| 128 | + service1: |
| 129 | + … |
| 130 | + deploy: |
| 131 | + resources: |
| 132 | + reservations: |
| 133 | + memory: 512MB |
| 134 | +``` |
| 135 | + |
| 136 | +### "The build context contains more than 10 files" |
| 137 | +- This message is displayed when you run `defang compose up` and the Compose file declares a `build` with a `context` that contains more than 10 files. Ensure the context refers to the correct folder. Defang will use the `context` as is, but you may experience slow build times. If you want to speed up the build, you should reduce the number of files in the `context`. |
| 138 | + |
| 139 | +### "AWS provider was selected, but AWS environment variables are not set" |
| 140 | +- This message is displayed when you run `defang compose up` with the `--provider=aws` but none of the AWS environment variables were set. If you proceed, the deployment might fail, unless you have defined defined `default` credentials in the AWS configuration files or are running on an AWS instance. |
| 141 | + |
| 142 | +### "Using Defang provider, but AWS environment variables were detected" |
| 143 | +- This message is displayed when you run `defang compose up` with the `--provider=defang` but AWS environment variables were detected. The AWS environment variables will be ignored. |
| 144 | + |
| 145 | +## Errors |
| 146 | + |
| 147 | +### "Stack:… is in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS state and cannot be updated" |
| 148 | +- 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`. |
| 149 | + |
| 150 | +### "invalid healthcheck: ingress ports require an HTTP healthcheck on `localhost`. |
| 151 | + |
| 152 | +- This message is displayed when `defang compose up` tries to deploy a service with an "ingress" port, if the service does not have a `healthcheck` which mentions `localhost`. 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: |
| 153 | + |
| 154 | +1. 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: |
| 155 | + |
| 156 | + ```diff |
| 157 | + services: |
| 158 | + my-service: |
| 159 | + image: my-image |
| 160 | + ports: |
| 161 | + - - "1234:1234" |
| 162 | + + - "1234" |
| 163 | + ``` |
| 164 | +2. Does my healthcheck include the string `localhost`? It is very common to define a healthcheck by using `curl` or `wget` to make a request to `localhost`. So common, in fact, that Defang will look for the string `localhost` in your healthcheck definition. For example, this healthcheck is valid: |
| 165 | + |
| 166 | + ```yaml |
| 167 | + healthcheck: |
| 168 | + test: ["CMD", "curl", "-f", "http://localhost:1234/health"] |
| 169 | + ``` |
| 170 | + |
| 171 | + This healthcheck is not valid for `ingress` ports: |
| 172 | + |
| 173 | + ```yaml |
| 174 | + healthcheck: |
| 175 | + test: ["CMD", "./my-healthcheck"] |
| 176 | + ``` |
| 177 | + |
| 178 | +### The build aborted with OutOfMemoryError: Container killed due to memory usage |
| 179 | + |
| 180 | +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. |
| 181 | + |
| 182 | +If that doesn't work, you can try to increase the memory available to the build process by adding a field `shm_size` to the `build` section in your `compose.yaml` file: |
| 183 | + |
| 184 | +```yaml |
| 185 | +services: |
| 186 | + service1: |
| 187 | + build: |
| 188 | + context: . |
| 189 | + shm_size: 16g |
| 190 | +``` |
0 commit comments