Fixing a failed deploy

Common errors when deploying with Encore, and how to fix them

When a deploy fails, open it in the Cloud Dashboard under Deployments to see which step failed and the error it printed. These are the most common causes.

Tests failed

A build whose tests fail is not deployed. Run the tests locally to see the failure:

$ encore test

Fix the test and push again. To deploy without running tests, either turn off Run tests in every build under Settings > Builds > Tests, or check Skip Tests when you start a deploy from Deployments > New Deploy.

For Encore.ts apps, tests only run in the build if package.json has a test script.

Missing secrets

The deploy fails with:

secret key(s) not defined: MySecret

Every secret your app declares needs a value in the environment you deploy to. Set it for that environment's type: dev for development environments, such as the default staging, and prod for production. Or set it for one environment with --env:

$ encore secret set --type dev MySecret
$ encore secret set --env <env-name> MySecret

You can also set secrets in the Cloud Dashboard under Settings > Secrets. Then redeploy without a new commit: open Deployments, click New Deploy, choose Branch, and select the branch the environment deploys from (usually main). See Secrets for Encore.ts or Encore.go for more.

encore.app isn't in the repository root

The build fails with:

encore.app not found in the repository root

If your app lives in a sub-folder of the repository, set its path under Settings > General > Root Directory.

The push didn't start a deploy

When you push to the encore remote, a successful push prints a line like this:

remote: main: triggered deploy https://app.encore.dev/<app-id>/envs/staging/deploys/...

If you don't see it, nothing was deployed:

  • Everything up-to-date: there was nothing new to push. Commit your changes with git add -A . && git commit -m '...', then push again.
  • No triggered deploy line: you pushed a branch that no environment deploys from. Push your app's main branch, or configure which branch an environment deploys from under the environment's Settings > Branch Push.

git push encore fails

  • could not get Encore auth token: not logged in: run encore auth login, then push again.
  • 'encore' does not appear to be a git repository: the encore remote is missing. Add it with git remote add encore encore://<app-id>. Your app ID is in the dashboard URL: app.encore.dev/<app-id>.
  • The push hangs or times out: git push encore and encore app clone connect to git.encore.dev over SSH on port 22. Some networks block outbound port 22. Try another network, or connect GitHub and push there instead.