psycopg2.OperationalError: could not translate host name "postgres" to address: Name or service not known

Installing additional dependencies…
e[33mWARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venve[0m

00:54:27 [WARNING] sentry.utils.geo: Error opening GeoIP database: /geoip/GeoLite2-City.mmdb
00:54:27 [WARNING] sentry.utils.geo: Error opening GeoIP database in Rust: /geoip/GeoLite2-City.mmdb
00:54:31 [INFO] sentry.plugins.github: apps-not-configured
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/usr/local/lib/python3.6/site-packages/psycopg2/init.py”, line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name “postgres” to address: Name or service not known

I installed is in accordance with the GitHub - getsentry/onpremise at 21.6.1 tutorial sentry, execute ./install.sh appears after the above error
I cannot submit the install_log.txt file because I am a newly registered user and keep prompting me “Sorry, new users can only put 2 links in a post.” so I can only submit partial error messages

:arrow_forward: Parsing command line …

:arrow_forward: Setting up error handling …

:arrow_forward: Checking minimum requirements …
WARN: Recommended minimum RAM available to Docker is 7800 MB, found 7551 MB

:arrow_forward: Creating volumes for persistent storage …
Created sentry-clickhouse.
Created sentry-data.
Created sentry-kafka.
Created sentry-postgres.
Created sentry-redis.
Created sentry-symbolicator.
Created sentry-zookeeper.

:arrow_forward: Ensuring files from examples …
…/sentry/sentry.conf.py already exists, skipped creation.
…/sentry/config.yml already exists, skipped creation.
…/symbolicator/config.yml already exists, skipped creation.
…/sentry/requirements.txt already exists, skipped creation.

:arrow_forward: Generating secret key …

:arrow_forward: Replacing TSDB …

:arrow_forward: Fetching and updating Docker images …
21.6.1: Pulling from getsentry/sentry
Digest: sha256:2fd9160a1fa8be1208da10added416ba420dad25a20bf775cac079ee5e60c71d
Status: Image is up to date for getsentry/sentry:21.6.1
docker.io/getsentry/sentry:21.6.1

:arrow_forward: Building and tagging Docker images …

smtp uses an image, skipping
memcached uses an image, skipping
redis uses an image, skipping
postgres uses an image, skipping
zookeeper uses an image, skipping
kafka uses an image, skipping
clickhouse uses an image, skipping
geoipupdate uses an image, skipping
snuba-api uses an image, skipping
snuba-consumer uses an image, skipping
snuba-outcomes-consumer uses an image, skipping
snuba-sessions-consumer uses an image, skipping
snuba-transactions-consumer uses an image, skipping
snuba-replacer uses an image, skipping
snuba-subscription-consumer-events uses an image, skipping
snuba-subscription-consumer-transactions uses an image, skipping
symbolicator uses an image, skipping
web uses an image, skipping
cron uses an image, skipping
worker uses an image, skipping
ingest-consumer uses an image, skipping
post-process-forwarder uses an image, skipping
subscription-consumer-events uses an image, skipping
subscription-consumer-transactions uses an image, skipping
relay uses an image, skipping
nginx uses an image, skipping
Building snuba-cleanup
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
—> 824ef97a4247
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
—> Using cache
—> 634ce2adac7a
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
—> Using cache
—> 4150bfffb38f
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
—> Using cache
—> fc31e83554b6

Successfully built fc31e83554b6
Successfully tagged snuba-cleanup-onpremise-local:latest
Building snuba-transactions-cleanup
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
—> 824ef97a4247
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
—> Using cache
—> 634ce2adac7a
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
—> Using cache
—> 4150bfffb38f
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
—> Using cache
—> fc31e83554b6

Successfully built fc31e83554b6
Successfully tagged snuba-cleanup-onpremise-local:latest
Building symbolicator-cleanup
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
—> 64ccdf50243f
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
—> Using cache
—> a886a5ed33e8
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
—> Using cache
—> 039b1cab48c0
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
—> Using cache
—> 4988bb584208

Successfully built 4988bb584208
Successfully tagged symbolicator-cleanup-onpremise-local:latest
Building sentry-cleanup
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
—> 8528f0dc2278
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*
—> Using cache
—> bd106215213b
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
—> Using cache
—> b991eb1b5a02
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
—> Using cache
—> 71f071eac00b

Successfully built 71f071eac00b
Successfully tagged sentry-cleanup-onpremise-local:latest

Docker images built.

:arrow_forward: Turning things off …
Removing network onpremise_default
Network onpremise_default not found.
Removing onpremise-2161_snuba-api_1 …
Removing onpremise-2161_snuba-sessions-consumer_1 …
Removing onpremise-2161_snuba-subscription-consumer-transactions_1 …
Removing onpremise-2161_snuba-subscription-consumer-events_1 …
Removing onpremise-2161_snuba-outcomes-consumer_1 …
Removing onpremise-2161_snuba-replacer_1 …
Removing onpremise-2161_snuba-consumer_1 …
Removing onpremise-2161_snuba-transactions-consumer_1 …
Removing onpremise-2161_postgres_1 …
Removing onpremise-2161_smtp_1 …
Removing onpremise-2161_memcached_1 …
Removing onpremise-2161_symbolicator_1 …
Removing onpremise-2161_kafka_1 …
Removing onpremise-2161_zookeeper_1 …
Removing onpremise-2161_redis_1 …
Removing onpremise-2161_clickhouse_1 …
Removing onpremise-2161_snuba-sessions-consumer_1 … done
Removing onpremise-2161_redis_1 … done
Removing onpremise-2161_snuba-api_1 … done
Removing onpremise-2161_zookeeper_1 … done
Removing onpremise-2161_smtp_1 … done
Removing onpremise-2161_snuba-subscription-consumer-transactions_1 … done
Removing onpremise-2161_snuba-subscription-consumer-events_1 … done
Removing onpremise-2161_snuba-outcomes-consumer_1 … done
Removing onpremise-2161_clickhouse_1 … done
Removing onpremise-2161_snuba-replacer_1 … done
Removing onpremise-2161_snuba-transactions-consumer_1 … done
Removing onpremise-2161_kafka_1 … done
Removing onpremise-2161_symbolicator_1 … done
Removing onpremise-2161_snuba-consumer_1 … done
Removing onpremise-2161_postgres_1 … done
Removing onpremise-2161_memcached_1 … done
Removing network onpremise-2161_default

:arrow_forward: Setting up Zookeeper …
Creating network “onpremise-2161_default” with the default driver

:arrow_forward: Downloading and installing wal2json …
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
31 5416 31 1701 0 0 2059 0 0:00:02 --:–:-- 0:00:02 2059
100 5416 100 5416 0 0 4259 0 0:00:01 0:00:01 --:–:-- 4261

:arrow_forward: Bootstrapping and migrating Snuba …
Creating onpremise-2161_clickhouse_1 …
Creating onpremise-2161_redis_1 …
Creating onpremise-2161_zookeeper_1 …
Creating onpremise-2161_zookeeper_1 … done
Creating onpremise-2161_kafka_1 …
Creating onpremise-2161_clickhouse_1 … done
Creating onpremise-2161_redis_1 … done
Creating onpremise-2161_kafka_1 … done
2021-06-28 01:38:11,036 Attempting to connect to Kafka (attempt 0)…
2021-06-28 01:38:13,041 Attempting to connect to Kafka (attempt 1)…
2021-06-28 01:38:15,044 Attempting to connect to Kafka (attempt 2)…
2021-06-28 01:38:15,058 Connected to Kafka on attempt 2
2021-06-28 01:38:15,058 Creating Kafka topics…
Starting onpremise-2161_clickhouse_1 …
Starting onpremise-2161_redis_1 …
Starting onpremise-2161_zookeeper_1 …
Starting onpremise-2161_clickhouse_1 … done
Starting onpremise-2161_redis_1 … done
Starting onpremise-2161_zookeeper_1 … done
Starting onpremise-2161_kafka_1 …
Starting onpremise-2161_kafka_1 … done
Finished running migrations

:arrow_forward: Creating additional Kafka topics …

:arrow_forward: Ensuring proper PostgreSQL version …

:arrow_forward: Setting up / migrating database …
Creating onpremise-2161_symbolicator_1 …
Starting onpremise-2161_redis_1 …
Starting onpremise-2161_redis_1 … done
Creating onpremise-2161_smtp_1 …
Starting onpremise-2161_zookeeper_1 …
Starting onpremise-2161_zookeeper_1 … done
Starting onpremise-2161_clickhouse_1 …
Creating onpremise-2161_postgres_1 …
Starting onpremise-2161_clickhouse_1 … done
Creating onpremise-2161_memcached_1 …
Starting onpremise-2161_kafka_1 …
Starting onpremise-2161_kafka_1 … done
Creating onpremise-2161_snuba-sessions-consumer_1 …
Creating onpremise-2161_snuba-consumer_1 …
Creating onpremise-2161_snuba-replacer_1 …
Creating onpremise-2161_snuba-transactions-consumer_1 …
Creating onpremise-2161_snuba-subscription-consumer-transactions_1 …
Creating onpremise-2161_snuba-api_1 …
Creating onpremise-2161_snuba-outcomes-consumer_1 …
Creating onpremise-2161_snuba-subscription-consumer-events_1 …
Creating onpremise-2161_symbolicator_1 … done
Creating onpremise-2161_snuba-replacer_1 … done
Creating onpremise-2161_snuba-sessions-consumer_1 … done
Creating onpremise-2161_snuba-consumer_1 … done
Creating onpremise-2161_snuba-subscription-consumer-events_1 … done
Creating onpremise-2161_smtp_1 … done
Creating onpremise-2161_memcached_1 … done
Creating onpremise-2161_snuba-api_1 … done
Creating onpremise-2161_snuba-transactions-consumer_1 … done
Creating onpremise-2161_snuba-subscription-consumer-transactions_1 … done
Creating onpremise-2161_snuba-outcomes-consumer_1 … done
Creating onpremise-2161_postgres_1 … done
01:38:37 [INFO] sentry.plugins.github: apps-not-configured
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/usr/local/lib/python3.6/site-packages/psycopg2/init.py”, line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name “postgres” to address: Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/bin/sentry”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.6/site-packages/sentry/runner/init.py”, line 196, in main
func(**kwargs)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/decorators.py”, line 29, in inner
return ctx.invoke(f, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/commands/upgrade.py”, line 171, in upgrade
_upgrade(not noinput, traceback, verbosity, not no_repair, with_nodestore)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/commands/upgrade.py”, line 118, in _upgrade
_migrate_from_south(verbosity)
File “/usr/local/lib/python3.6/site-packages/sentry/runner/commands/upgrade.py”, line 90, in _migrate_from_south
if not _has_south_history(connection):
File “/usr/local/lib/python3.6/site-packages/sentry/runner/commands/upgrade.py”, line 75, in _has_south_history
cursor = connection.cursor()
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 254, in cursor
return self._cursor()
File “/usr/local/lib/python3.6/site-packages/sentry/db/postgres/decorators.py”, line 40, in inner
return func(self, *args, **kwargs)
File “/usr/local/lib/python3.6/site-packages/sentry/db/postgres/base.py”, line 96, in _cursor
return super()._cursor()
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 229, in _cursor
self.ensure_connection()
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/usr/local/lib/python3.6/site-packages/django/db/utils.py”, line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/usr/local/lib/python3.6/site-packages/django/utils/six.py”, line 685, in reraise
raise value.with_traceback(tb)
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 213, in ensure_connection
self.connect()
File “/usr/local/lib/python3.6/site-packages/django/db/backends/base/base.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/usr/local/lib/python3.6/site-packages/django/db/backends/postgresql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/usr/local/lib/python3.6/site-packages/psycopg2/init.py”, line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not translate host name “postgres” to address: Name or service not known

An error occurred, caught SIGERR on line 12
Cleaning up…

This looks like a network/DNS issue so I recommend checking your DNS settings.

I execute the ”docker logs onpremise-2161_postgres_1“ command, the printed log is as follows, whether it is related to this

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

Setting up Change Data Capture

DB not initialized. Postgres will take care of pg_hba

cp: cannot stat ‘/opt/sentry/wal2json/wal2json.so’: No such file or directory

You may want to update your onpremise repo and run install.sh again. We do download this file automatically.

Maybe @fpacifici may look into this if it persists tho.

Same issue here…
Sentry is unusable as of now.
We are loosing money…and are looking for an alternative.
Are testing many solutions concurretly…

Thank God we hadnt paid for sentry…

Hello, you can take a look here

My problem is solved,I modified the local source code, you can try, wish you good luck

hello, no luck here Im affraid.
But thanks for trying to help

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.