Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 4.42 KB

File metadata and controls

103 lines (79 loc) · 4.42 KB
title Troubleshooting Docker
sidebar_title Docker
sidebar_order 3

FAIL: Docker Compose is required to run self-hosted error but Docker Compose is installed

Around version 25.1.0 to 25.4.0, users which did not have docker compose plugin installed, and relied only on docker-compose will face some issues. Notably for Amazon Linux 2023 distro that does not have docker-compose-plugin packaged, you may need to install the standalone docker-compose separately. See docker/compose installation guide for more details.

Container Healthcheck

There may be some circumstances which you may want to increase or decrease healthcheck interval, timeout or retries for your custom needs. This can be achieved by overriding the values of HEALTHCHECK_INTERVAL, HEALTHCHECK_TIMEOUT and HEALTHCHECK_RETRIES defined in .env in .env.custom.

Occasionally, you might see an error like this

container for service "${servicename}" is unhealthy

This can usually be resolved by running docker compose down and docker compose up --wait or rerunning the install script.

Note

On slower systems, including systems that only meet the minimum resource requirements for self-hosted Sentry, this issue may still persist even after rerunning docker compose down and docker compose up --wait.

In this case, you can override the healthcheck parameters defined in .env by setting custom values in .env.custom.

For example, increasing HEALTHCHECK_RETRIES may resolve the issue:

# .env.custom
HEALTHCHECK_RETRIES=20

Then start Docker Compose.

Depending on your system, you may also need to adjust other HEALTHCHECK_* values.

Docker Network Conflicting IP Address

Self-hosted Sentry is using Docker's bridge networking, in which use a specific private IP range. By default, Docker uses 172.17.0.0/16 range (172.17.0.0-172.17.255.255). This may cause conflict with your private network. You can change Docker's default IP range by configuring the /etc/docker/daemon.json file. If the file does not exists, you can create it yourself.

Assuming your safe IP range is 10.147.0.0/16 and 10.146.0.0/16, your configuration would be:

{
    "default-address-pools": [
   {
     "base": "10.147.0.0/16",
     "size": 24
   },
   {
     "base": "10.146.0.0/16",
     "size": 24
   }
 ]
}

To apply new Docker daemon configuration, restart your Docker service with systemctl restart docker.

Make sure you are using valid private IP ranges, that is between these ranges:

  • 10.0.0.0/8 (address range of 10.0.0.010.255.255.255)
  • 100.64.0.0/10 (address range of 100.64.0.0100.127.255.255)
  • 172.16.0.0/12 (address range of 172.16.0.0172.31.255.255)
  • 192.0.0.0/24 (address range of 192.0.0.0192.0.0.255)
  • 192.168.0.0/16 (address range of 192.168.0.0192.168.255.255)
  • 198.18.0.0/15 (address range of 198.18.0.0198.19.255.255)

For further reading, you can see Matthew Stratiotto's article on The definitive guide to docker's default-address-pools option.

Logs Disk Usage

If you are suspecting persisted logs from Docker container logs consumes a lot of your disk space, you can configure the amount of persisted logs on Docker by configuring the /etc/docker/daemon.json file. If the file does not exists, you can create it yourself.

{
  "log-driver": "local",
  "log-opts": {"max-size": "10m", "max-file": "3"}
}

To apply new Docker daemon configuration, restart your Docker service with systemctl restart docker.

If you want to delete immediate Docker logs, you can execute this as root user:

truncate -s 0 /var/lib/docker/containers/**/*-json.log

Image and Builder Cleanup

Executing ./install.sh will build a new Sentry Docker container, executing it often might cause Docker to consume your disk space. You can safely prune old or unneeded Docker containers, image, or builder to re-acquire used disk space. Executing these will not affect current running containers and volumes.

docker container prune
docker builder prune
docker image prune --all
# WARNING: Executing "volume prune" might delete `sentry-vroom` volume as it's not an external volume.
docker volume prune
docker network prune

Append -f flag for no confirmation on deletions.