# Troubleshooting git builds

When a build fails, the build page in the console shows a short explanation and a link to the section below. Each section is named after the failure code, so the link lands on the right one. The code is also in the API, in the build's `failure_code`.

Each section says what happened, how to fix it and where in the console to do it. Many fixes are made in your repository. Most build settings are shown read-only in the console, so a setting such as the timeout or the builder size is changed in your [`zaroz.toml`](/git-builds/zaroz-toml) file.

**Minutes.** A failure caused by your code or settings still uses the minutes it ran. A failure that stops a build before it starts uses none. A failure that is ours is never charged. Each section says which one applies. See [Build minutes](/git-builds/billing).

**Where things are.** A service has a **Builds** tab and a **Source** tab. The Source tab has these parts: **When it builds and deploys** (the repository, the branch and the rules), **Build settings**, **Build secrets** and **Deploy hooks**. Your git accounts are under **Git connections** for the organization, and the Source tab links to them.

## Plain git URL

These apply to a repository connected as [Other git URL](/git-builds/connecting#other-git-url).

| Problem | What to do |
|---|---|
| My push did not build yet. | Wait up to 3 minutes. Zaroz checks the server for new commits instead of receiving a push. A repository with more than 10,000 tags is checked every 15 minutes. Then check that you pushed to the branch the service watches. |
| Pushes stopped building after the server was down. | Zaroz retries after 30 seconds and waits longer each time, up to 30 minutes. It resumes by itself when the server answers. |
| Authentication failed on a private repository. | Check the username and the password or token. The token must be able to read the repository. Update the connection under **Git connections**. See [`clone_auth_failed`](#clone_auth_failed). |
| A change to a watched path was skipped, or a change outside it built. | Watch paths do not apply here. Every push to the branch builds. |
| The address is refused or the build cannot start. | Use the `https` address on port 443. `ssh://` and `git@` addresses cannot build. See [`source_unsupported`](#source_unsupported). |

## `clone_auth_failed`

**What happened.** The git server refused our access to your repository, or it did not answer. Zaroz could not get the code for this commit.

**How to fix it.**

- Open **Git connections** and look at the connection. If it says **Needs sign-in** or **Access removed**, choose **Reconnect**.
- If the connection uses an access token, the token may have expired or been revoked. Create a new one on your git server and update the connection.
- On GitHub, check that the Zaroz GitHub app still has access to this repository. If the repository was removed from the app, add it again.
- If you run your own git server, check that it is reachable from the internet and not paused.

**In the console.** On the failed build, choose **Check the connection**. It opens the Source tab. Then retry the build.

**Minutes.** This failure counts as a build failure, but it ends almost at once, so it uses very few minutes.

## `ref_not_found`

**What happened.** The branch or commit that had to be built is no longer in the repository. The branch may have been deleted or renamed, or the history may have been rewritten with a force push.

**How to fix it.** Pick a branch that exists. If you renamed the branch, set the new name. If you force-pushed, push again so there is a new commit to build.

**In the console.** On the failed build, choose **Pick another branch**. It opens **Source**, in **When it builds and deploys**. Change **Branch**, save, and choose **Build now**.

**Minutes.** Counts as a build failure, but it ends at once.

## `repo_too_large`

**What happened.** The files of your commit are bigger than a build may take. Zaroz builds from a snapshot of the commit, and the snapshot has limits: 256 MiB as a compressed archive, 2 GiB once unpacked, and 200,000 files. The limit applies to the whole commit, not only to your root directory. The size of your git history does not matter, only the files in this commit.

**How to fix it.**

- Remove large files that the build does not need: videos, datasets, installers, build output, a committed `node_modules`.
- Keep large assets outside the repository, for example in object storage, and download them when the app starts.
- Check for a very large number of small files, such as a vendored dependency tree.

**In the console.** This is fixed in your repository. Push a smaller commit and the next build uses it.

**Minutes.** Counts as a build failure.

## `submodule_failed`

**What happened.** The build needs a git submodule and could not get it. Zaroz builds from a snapshot of your commit. A submodule is a pointer to another repository, so its files are not in the snapshot.

**How to fix it.** Put the files in your repository itself. Copy the submodule's files into a folder and commit them. If the code is a dependency, install it with your package manager instead.

**In the console.** This is fixed in your repository. Push the change and the next build uses it.

**Minutes.** Counts as a build failure.

## `config_invalid`

**What happened.** Your `zaroz.toml` file has errors, so the build did not start. Each error is listed with `zaroz.toml:<line>:<column>` and a sentence. The build does not fall back to the console settings when a file is present but broken.

**How to fix it.** Fix every listed error. The usual ones:

- A key that does not exist. A typo such as `buld` is reported with a "did you mean `build`" hint.
- A value of the wrong type, or a time that is not written like `"20m"`.
- No `version = 1` at the top of the file. A `version` Zaroz does not support is refused and names the versions it does support.
- Top-level settings mixed with `[services.<name>]` tables. A file has one shape or the other.
- A path that is absolute or climbs out of the repository with `..`.
- Environment variables or secret values. These are set in the console, never in the file. The file may only name build secrets in `build.secrets`.
- `[environments.preview]`. Previews are not available yet.

**In the console.** Open **Source**, then **Build settings**, and choose **Check file**. Paste your file to run the same check a build would. Nothing is saved. Fix the file in your repository and push.

**Minutes.** Counts as a build failure, but it ends at once.

## `config_no_entry`

**What happened.** Your `zaroz.toml` declares several services (`[services.web]`, `[services.api]`), and none of them matches this service. Each Zaroz service is tied to one entry by name.

**How to fix it.** Choose one of these:

- Set this service's entry name to one the file declares.
- Turn off **Read zaroz.toml** for this service, so the console settings are used.
- Add a `[services.<name>]` entry with the name this service uses.

**In the console.** Open **Source**, then **When it builds and deploys**. Set **Entry in zaroz.toml** to the entry's name, for example `web` for `[services.web]`, or turn off **Read zaroz.toml**. Save, then choose **Build now**.

**Minutes.** Counts as a build failure, but it ends at once.

## `secret_missing`

**What happened.** Your `zaroz.toml` lists a build secret in `build.secrets`, and this service has no value for it. The build needs it, so it stopped.

**How to fix it.** Add the secret with exactly that name. Names use capital letters, digits and underscores, start with a letter, and have at most 64 characters. Then retry the build.

**In the console.** Open **Source**, then **Build secrets**, and add the secret. The build page names the missing secret. Then choose **Retry**. See [Build secrets](/git-builds/build-secrets).

**Minutes.** Counts as a build failure, but it ends at once.

## `detect_failed`

**What happened.** There is no Dockerfile, and Zaroz did not recognise the code, so it could not tell how to build it. It looked for `package.json`, `requirements.txt`, `pyproject.toml`, `go.mod`, `composer.json`, `pom.xml`, `build.gradle`, `Gemfile` and `index.html` in your root directory.

**How to fix it.**

- If your code is in a folder, such as `apps/api`, set that folder as the root directory.
- Add a `Dockerfile` to the root directory. A Dockerfile always wins over detection.
- Make sure the file that marks your language is committed and is in the root directory.

**In the console.** Build settings are read-only for now, so set `root` in your `zaroz.toml`, or add a Dockerfile. See [How builds are detected](/git-builds/detection).

**Minutes.** Counts as a build failure.

## `dockerfile_not_found`

**What happened.** The build is set to use a Dockerfile, but there is no file at the path it looked at. By default that is `Dockerfile` in the root directory. File names are case sensitive, so `dockerfile` is not `Dockerfile`.

**How to fix it.** Add the Dockerfile, or point the build at the right path. The path in `build.dockerfile` is relative to the root directory.

**In the console.** Set `build.dockerfile` in your `zaroz.toml`, or move the file. Build settings in the console are read-only for now.

**Minutes.** Counts as a build failure.

## `build_step_failed`

**What happened.** One step of the build ended with an error. It can be your install command, your build command, or a `RUN` line in your Dockerfile.

**How to fix it.** Open the build log and read the last lines of the failing step. The build page shows the step. Then fix the command in your code. The build also looks for three known causes and tells you when it finds one:

- **A private registry refused the install.** A line with `E401`, `E403` or `403 Client Error` means a package registry did not accept the install. Add a build secret with your registry's token. See [Build secrets](/git-builds/build-secrets).
- **The builder ran out of disk space.** A line with `ENOSPC` or `no space left on device` means the build wrote more than the builder holds. Rebuild on a larger builder, or write less during the build.
- **The package manager needs a lockfile.** Commit `package-lock.json`, `yarn.lock` or `pnpm-lock.yaml`.

Other common causes: a command that works only on your computer, a tool or version that is missing, or a value your build reads from the environment. Environment variables of the running service are not available during the build. Use a build variable or a build secret.

**In the console.** Open the failed build in **Builds** and read the **Log**. To try again after a fix, push a commit, or choose **Retry**.

**Minutes.** Counts as a build failure.

## `out_of_memory`

**What happened.** The build used more memory than its builder has. The small builder has 8 GiB, medium has 16 GiB and large has 32 GiB.

**How to fix it.** Rebuild on a larger builder. If the build always needs more, set the size in your `zaroz.toml` with `build.size = "medium"`. You can also lower memory use: limit the parallel jobs of your bundler, or split a heavy step.

**In the console.** On the failed build, choose **Rebuild on medium**. This changes only this build. A medium builder counts as 2 minutes for each minute it runs, and a large one counts as 4. Larger sizes may not be available to every organization. If one is not, the build says so.

**Minutes.** Counts as a build failure. See [Build minutes](/git-builds/billing).

## `timeout`

**What happened.** The build ran for longer than its time limit and was stopped. The default limit is 20 minutes. It can be set from 5 to 60 minutes. A new organization can have a lower maximum.

**How to fix it.**

- Raise the limit with `build.timeout = "40m"` in your `zaroz.toml`.
- Make sure the build cache is on. It is on by default, with `build.cache = true`. If a build is much slower than before, choose **Rebuild without cache** once, then build again.
- Look in the log for the slow step. A larger builder helps when the step uses all the processors.
- A longer limit also raises the most a build could cost. This matters if you use a [spend cap](/git-builds/billing).

**In the console.** Build settings are read-only for now, so change the timeout in your `zaroz.toml`. **Rebuild without cache** is on the failed build's actions.

**Minutes.** Counts as a build failure, for the whole time it ran.

## `image_too_large`

**What happened.** The image your build made is bigger than 10 GiB (compressed), the most Zaroz accepts.

**How to fix it.**

- Use a multi-stage Dockerfile. Build in one stage and copy only the result into a small final stage, so compilers and caches stay out of the image.
- Add a `.dockerignore` file so large folders are not copied in.
- Do not put datasets, downloads or build caches in the image. Keep them in storage and fetch them when needed.

**In the console.** This is fixed in your Dockerfile. Push the change.

**Minutes.** Counts as a build failure.

## `spend_cap`

**What happened.** Zaroz did not start the build. The spend cap is a hard stop. Before a build starts, Zaroz works out the most it could cost: its time limit, times the builder size, beyond the minutes your plan still includes. If that does not fit under what your cap still allows this month, the build is refused. Nothing ran and no minutes were used.

**How to fix it.**

- Raise the spend cap.
- Pick a smaller builder, or a shorter timeout. Both lower the most the build could cost.
- Wait for the next month if the cap is already used.

**In the console.** On the failed build, choose **Open billing**. Change the spend cap there, then choose **Retry**. To change the builder size or timeout, edit your `zaroz.toml`.

## `minutes_need_funds`

**What happened.** Zaroz did not start the build. Your organization does not have a credit limit, so the wallet has to cover the most the build could cost beyond your included minutes. It does not, so the build was refused. Nothing ran.

**How to fix it.** Add funds to your wallet, then retry the build.

**In the console.** On the failed build, choose **Open billing**, add funds, then choose **Retry**.

## `included_minutes_exhausted`

**What happened.** Zaroz did not start the build. This service has used all its included build minutes this month, and extra minutes are off. Nothing ran and no minutes were used.

**How to fix it.**

- Turn on extra minutes and choose a monthly limit. See [Extra minutes](/git-builds/billing#extra-minutes).
- Or wait: included minutes start again on the 1st of next month.

**In the console.** On the failed build, choose **Open extra build minutes**. Turn them on in **Settings > Builds**, then choose **Retry**. Only an Owner or Admin can change this.

## `extra_minutes_limit`

**What happened.** Zaroz did not start the build. Extra minutes are on, but the most this build could cost does not fit in what is left of your monthly limit. Nothing ran and no minutes were used.

**How to fix it.**

- Raise the monthly limit.
- Pick a smaller builder, or a shorter timeout with `build.timeout`. Both lower the most the build could cost.
- Wait for the next month if the limit is already used.

**In the console.** On the failed build, choose **Open extra build minutes**, raise the limit in **Settings > Builds**, then choose **Retry**.

## `cost_not_confirmed`

**What happened.** Zaroz did not start the build. You confirmed the most it could cost, and by the time it was ready to start that maximum had gone up, for example because other builds used minutes in between. Nothing ran and you were not charged.

**How to fix it.** Start the build again and confirm the new maximum.

## `builder_storage_full`

**What happened.** Zaroz did not start the build. Each service has a limit for the images and caches of its builds (20 GiB). Zaroz removes old images every day. It always keeps the image that is running, the one before it, the 10 most recent successful builds, and anything built in the last 7 days. These kept images alone fill the limit.

**How to fix it.**

- Make your images smaller. A multi-stage Dockerfile is the biggest saving. See [`image_too_large`](#image_too_large).
- Wait. Older images are removed automatically as they pass the 7 days.
- If you need space now, contact support.

**In the console.** The build page names the largest images that are being kept. There is no button to delete builds. Nothing ran and no minutes were used.

## `builder_unavailable`

**What happened.** There was no builder available to run your build. This was our fault, not yours.

**How to fix it.** Zaroz already tried once more by itself. Choose **Retry**. If it keeps failing, contact support.

**In the console.** On the failed build, choose **Retry**.

**Minutes.** Never charged.

## `push_failed`

**What happened.** The build worked, but the image could not be saved in our registry. This was our fault.

**How to fix it.** Zaroz already tried once more by itself. Choose **Retry**. The build starts over. If it keeps failing, contact support.

**In the console.** On the failed build, choose **Retry**.

**Minutes.** Never charged.

## `pre_deploy_failed`

**What happened.** The image was built, but it was not deployed, and the version that was running keeps running. The pre-deploy command ended with an error, or took longer than its limit, so this build was not deployed. The pre-deploy command is the one you set in `deploy.pre_deploy`, often a database migration. It runs once for each deploy. The default limit is 10 minutes, and the most is 30.

**How to fix it.** Read the command's output in the build log and fix the command, or the migration it runs. Zaroz does not offer to deploy anyway, because a failed migration can leave the new version running on an old database.

**In the console.** Open the build in **Builds** and read the log. Fix the command in your code or in `deploy.pre_deploy` of your `zaroz.toml`, then push.

## `health_check_failed`

**What happened.** The image was built, but the new version never became healthy, so it was not deployed. The version that was running keeps running. Zaroz waits up to 5 minutes by default.

**How to fix it.**

- Make your app listen on the port in the `PORT` variable, which is 8080 unless you set `deploy.port`. It must listen on all addresses (`0.0.0.0`), not only on `localhost`.
- If you set a health check path, with `deploy.health_check = { path = "/healthz" }`, make sure that path answers with a success code.
- If your app needs longer to start, raise the wait with `timeout`, for example `deploy.health_check = { path = "/healthz", timeout = "10m" }`.
- Read the service logs to see why the app did not start.

**In the console.** Open **Source** to see the health check, and open the service logs. Fix it in your `zaroz.toml` or your code, then push.

## `source_unsupported`

**What happened.** Zaroz refused the build, and no minutes were used. This service's repository is an `ssh://` or `git@` address. Builds from a plain git URL work over `https` on port 443 only.

**How to fix it.** Connect the repository again with its `https` address (see [Other git URL](/git-builds/connecting#other-git-url)), or use GitHub, GitLab or Forgejo.

**In the console.** On the Source tab, choose **Change repository** and pick the repository by its `https` address or from GitHub, GitLab or Forgejo. See [Connect a repository](/git-builds/connecting).

## `builds_suspended`

**What happened.** Zaroz refused the build, and no minutes were used. Builds are paused for your organization.

**How to fix it.** Contact support and we will look at it with you.

## `builds_under_review`

**What happened.** Zaroz refused the build, and no minutes were used. New builds are on hold for a few minutes while we review the recent activity of your organization.

**How to fix it.** Try again in a few minutes. If you think this is a mistake, contact support.

## `builder_size_above_pool_max`

**What happened.** Zaroz refused the build, and no minutes were used. The builder size you asked for is larger than the builders available in this region for now.

**How to fix it.** Pick a smaller builder size. In `zaroz.toml` that is `build.size`.

## `builder_size_exceeds_pool_slots`

**What happened.** Zaroz refused the build, and no minutes were used. This builder size is not available in this region right now.

**How to fix it.** Pick a smaller builder size for this build, or try again later.
