Open gander opened 1 month ago
Oh you have a malformed value on your docker compose file. Can you share the services -> postgres section?
Oh you have a malformed value on your docker compose file. Can you share the services -> postgres section?
postgres:
<<: *restart_policy
# Using the same postgres version as Sentry dev for consistency purposes
image: "postgres:14.11"
healthcheck:
<<: *healthcheck_defaults
# Using default user "postgres" from sentry/sentry.conf.example.py or value of POSTGRES_USER if provided
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
command:
[
"postgres",
"-c",
"max_connections=${POSTGRES_MAX_CONNECTIONS:-100}",
]
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- "sentry-postgres:/var/lib/postgresql/data"
x-healthcheck-defaults: &healthcheck_defaults
# Avoid setting the interval too small, as docker uses much more CPU than one would expect.
# Related issues:
# https://github.com/moby/moby/issues/39102
# https://github.com/moby/moby/issues/39388
# https://github.com/getsentry/self-hosted/issues/1000
interval: "$HEALTHCHECK_INTERVAL"
timeout: "$HEALTHCHECK_TIMEOUT"
retries: $HEALTHCHECK_RETRIES
start_period: 10s
.env
HEALTHCHECK_INTERVAL=30s
HEALTHCHECK_TIMEOUT=1m30s
HEALTHCHECK_RETRIES=10
seriously? when any documentation says that some custom .env.xyz
override .env
it doesn't mean that it replaces it completely, it just gives the effect of merging the values from .env
and .env.xyz
!
Do you have any .env.custom file? The values should exist there too.
It is logical and commonly used that .env.*
inherits .env
. Any other solution, which additionally appears in the documentation in two mutually exclusive forms, only introduces confusion and problems.
- Environment variables—The available keys are defined in .env. Use some system-dependent means of setting environment variables if you need to override any of them. To avoid Git changes, simply create a file called .env.custom and insert your system-dependent environment variables there. In order to use this, please use docker compose --env-file /path/to/.env.custom up -d.
https://develop.sentry.dev/self-hosted/#customize-dotenv-env-file
previous:
SETUP_JS_SDK_ASSETS=1
SETUP_JS_SDK_KEEP_OLD_ASSETS=1
current:
COMPOSE_PROJECT_NAME=sentry-self-hosted
COMPOSE_PROFILES=feature-complete
SENTRY_EVENT_RETENTION_DAYS=90
# You can either use a port number or an IP:PORT combo for SENTRY_BIND
# See https://docs.docker.com/compose/compose-file/#ports for more
SENTRY_BIND=9000
# Set SENTRY_MAIL_HOST to a valid FQDN (host/domain name) to be able to send emails!
# SENTRY_MAIL_HOST=example.com
SENTRY_IMAGE=getsentry/sentry:24.10.0
SNUBA_IMAGE=getsentry/snuba:24.10.0
RELAY_IMAGE=getsentry/relay:24.10.0
SYMBOLICATOR_IMAGE=getsentry/symbolicator:24.10.0
VROOM_IMAGE=getsentry/vroom:24.10.0
HEALTHCHECK_INTERVAL=30s
HEALTHCHECK_TIMEOUT=1m30s
HEALTHCHECK_RETRIES=10
# Caution: Raising max connections of postgres increases CPU and RAM usage
# see https://github.com/getsentry/self-hosted/pull/2740 for more information
POSTGRES_MAX_CONNECTIONS=100
# Set SETUP_JS_SDK_ASSETS to 1 to enable the setup of JS SDK assets
# SETUP_JS_SDK_ASSETS=1
SETUP_JS_SDK_ASSETS=1
SETUP_JS_SDK_KEEP_OLD_ASSETS=1
Eventually I realized there was a logical error in the documentation and I guessed that I needed to have everything that is .env
also in .env.custom
, and after this update the installation was successful.
It is logical and commonly used that
.env.*
inherits.env
. Any other solution, which additionally appears in the documentation in two mutually exclusive forms, only introduces confusion and problems.
Sadly Docker does not support that.
Sadly Docker does not support that.
You have outdated information
.env
FOO="foo from .env"
FOOBAR="foobar form .env"
.env.override
BAR="bar from .env.override"
FOOBAR="foobar from .env.override"
compose.yaml
services:
app:
image: alpine:latest
command: printenv
env_file:
- .env
- .env.override
docker run --env-file .env --env-file .env.override alpine printenv
Result in both:
FOO="foo from .env"
FOOBAR="foobar from .env.override"
BAR="bar from .env.override"
Ah, I was thinking of specifying one --env-file
flag. Whereas you're supplying more than one flag. We'll update the docs.
PR to the updated docs https://github.com/getsentry/sentry-docs/pull/11807
Self-Hosted Version
24.10.0
CPU Architecture
x86_64
Docker Version
27.0.3
Docker Compose Version
2.28.1
Steps to Reproduce
Try second run
./install.sh
to apply configuration in.env.custom
:Expected Result
Complete installation
Actual Result
Event ID
27b1704d8c71ec8d6cdacd9a18c0f35c