Skip to content

./install.sh does not work on CentOS 7 (postgres error) #1013

@fainle

Description

@fainle

Version

No response

Steps to Reproduce

./install.sh

docker logs --since 30m 7c42c6cd5040

Expected Result

succeed

Actual Result

ls -1 sentry_install_log-2021-06-30_15-26-06.txt | tail -1 | xargs cat

▶ Parsing command line ...

▶ Setting up error handling ...

▶ Checking minimum requirements ...

▶ 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.

▶ 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.

▶ Generating secret key ...

▶ Replacing TSDB ...

▶ Fetching and updating Docker images ...
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Some service image(s) must be built from source by running:
    docker-compose build snuba-cleanup snuba-transactions-cleanup symbolicator-cleanup sentry-cleanup
nightly: Pulling from getsentry/sentry
Digest: sha256:c28503c5e03efec30bd22082c1f4d151663c2b5f30169fc3bac756e43e5d3908
Status: Image is up to date for getsentry/sentry:nightly
docker.io/getsentry/sentry:nightly

▶ Building and tagging Docker images ...

--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
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
Sending build context to Docker daemon  3.072kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
 ---> 4917d8cec5a7
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron &&     rm -r /var/lib/apt/lists/*
 ---> Running in e1098b0d13cc
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://security.debian.org/debian-security buster/updates/main amd64 Packages [293 kB]
Get:4 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [15.2 kB]
Fetched 8453 kB in 1min 17s (110 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  lsb-base sensible-utils
Suggested packages:
  anacron logrotate checksecurity
Recommended packages:
  default-mta | mail-transport-agent
The following NEW packages will be installed:
  cron lsb-base sensible-utils
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 143 kB of archives.
After this operation, 383 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 sensible-utils all 0.0.12 [15.8 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 lsb-base all 10.2019051400 [28.4 kB]
Get:3 http://deb.debian.org/debian buster/main amd64 cron amd64 3.0pl1-134+deb10u1 [99.0 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 143 kB in 1s (97.0 kB/s)
Selecting previously unselected package sensible-utils.
(Reading database ... 6840 files and directories currently installed.)
Preparing to unpack .../sensible-utils_0.0.12_all.deb ...
Unpacking sensible-utils (0.0.12) ...
Selecting previously unselected package lsb-base.
Preparing to unpack .../lsb-base_10.2019051400_all.deb ...
Unpacking lsb-base (10.2019051400) ...
Selecting previously unselected package cron.
Preparing to unpack .../cron_3.0pl1-134+deb10u1_amd64.deb ...
Unpacking cron (3.0pl1-134+deb10u1) ...
Setting up lsb-base (10.2019051400) ...
Setting up sensible-utils (0.0.12) ...
Setting up cron (3.0pl1-134+deb10u1) ...
Adding group `crontab' (GID 101) ...
Done.
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Removing intermediate container e1098b0d13cc
 ---> a5737f96473c
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
 ---> 65629a7cccbe
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Running in 400192b48603
Removing intermediate container 400192b48603
 ---> 8434969834bb
Successfully built 8434969834bb
Successfully tagged snuba-cleanup-onpremise-local:latest
Building snuba-transactions-cleanup
Sending build context to Docker daemon  3.072kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
 ---> 4917d8cec5a7
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron &&     rm -r /var/lib/apt/lists/*
 ---> Using cache
 ---> a5737f96473c
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
 ---> Using cache
 ---> 65629a7cccbe
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Using cache
 ---> 8434969834bb
Successfully built 8434969834bb
Successfully tagged snuba-cleanup-onpremise-local:latest
Building symbolicator-cleanup
Sending build context to Docker daemon  3.072kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
 ---> 3d7425d7b53f
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron &&     rm -r /var/lib/apt/lists/*
 ---> Using cache
 ---> 53d69a7c0457
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
 ---> Using cache
 ---> 9d90fb95741f
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Using cache
 ---> cb71d91d1a6a
Successfully built cb71d91d1a6a
Successfully tagged symbolicator-cleanup-onpremise-local:latest
Building sentry-cleanup
Sending build context to Docker daemon  3.072kB
Step 1/5 : ARG BASE_IMAGE
Step 2/5 : FROM ${BASE_IMAGE}
 ---> 0da4ba3603da
Step 3/5 : RUN apt-get update && apt-get install -y --no-install-recommends cron &&     rm -r /var/lib/apt/lists/*
 ---> Using cache
 ---> fb64a8093db9
Step 4/5 : COPY entrypoint.sh /entrypoint.sh
 ---> Using cache
 ---> 35d95358fb90
Step 5/5 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Using cache
 ---> 16e24f46bee0
Successfully built 16e24f46bee0
Successfully tagged sentry-cleanup-onpremise-local:latest

Docker images built.

▶ Turning things off ...
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Removing network onpremise_default
Network onpremise_default not found.
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Removing sentry_onpremise_snuba-subscription-consumer-events_1       ... 
Removing sentry_onpremise_snuba-api_1                                ... 
Removing sentry_onpremise_snuba-transactions-consumer_1              ... 
Removing sentry_onpremise_snuba-sessions-consumer_1                  ... 
Removing sentry_onpremise_snuba-outcomes-consumer_1                  ... 
Removing sentry_onpremise_snuba-replacer_1                           ... 
Removing sentry_onpremise_snuba-subscription-consumer-transactions_1 ... 
Removing sentry_onpremise_snuba-consumer_1                           ... 
Removing sentry_onpremise_postgres_1                                 ... 
Removing sentry_onpremise_smtp_1                                     ... 
Removing sentry_onpremise_memcached_1                                ... 
Removing sentry_onpremise_symbolicator_1                             ... 
Removing sentry_onpremise_kafka_1                                    ... 
Removing sentry_onpremise_zookeeper_1                                ... 
Removing sentry_onpremise_redis_1                                    ... 
Removing sentry_onpremise_clickhouse_1                               ... 
Removing sentry_onpremise_snuba-outcomes-consumer_1                  ... done
Removing sentry_onpremise_clickhouse_1                               ... done
Removing sentry_onpremise_postgres_1                                 ... done
Removing sentry_onpremise_snuba-api_1                                ... done
Removing sentry_onpremise_snuba-subscription-consumer-transactions_1 ... done
Removing sentry_onpremise_snuba-sessions-consumer_1                  ... done
Removing sentry_onpremise_snuba-transactions-consumer_1              ... done
Removing sentry_onpremise_zookeeper_1                                ... done
Removing sentry_onpremise_memcached_1                                ... done
Removing sentry_onpremise_snuba-consumer_1                           ... done
Removing sentry_onpremise_snuba-replacer_1                           ... done
Removing sentry_onpremise_redis_1                                    ... done
Removing sentry_onpremise_snuba-subscription-consumer-events_1       ... done
Removing sentry_onpremise_kafka_1                                    ... done
Removing sentry_onpremise_smtp_1                                     ... done
Removing sentry_onpremise_symbolicator_1                             ... done
Removing network sentry_onpremise_default

▶ Setting up Zookeeper ...
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Creating network "sentry_onpremise_default" with the default driver
Creating sentry_onpremise_zookeeper_run ... 
Creating sentry_onpremise_zookeeper_run ... done
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Creating sentry_onpremise_zookeeper_run ... 
Creating sentry_onpremise_zookeeper_run ... done
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Creating sentry_onpremise_zookeeper_run ... 
Creating sentry_onpremise_zookeeper_run ... done

▶ Downloading and installing wal2json ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5416  100  5416    0     0   7119      0 --:--:-- --:--:-- --:--:--  7116

▶ Bootstrapping and migrating Snuba ...
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Creating sentry_onpremise_redis_1 ... 
Creating sentry_onpremise_clickhouse_1 ... 
Creating sentry_onpremise_zookeeper_1  ... 
Creating sentry_onpremise_redis_1      ... done
Creating sentry_onpremise_clickhouse_1 ... done
Creating sentry_onpremise_zookeeper_1  ... done
Creating sentry_onpremise_kafka_1      ... 
Creating sentry_onpremise_kafka_1      ... done
Creating sentry_onpremise_snuba-api_run ... 
Creating sentry_onpremise_snuba-api_run ... done
2021-06-30 07:29:10,246 Attempting to connect to Kafka (attempt 0)...
2021-06-30 07:29:12,251 Attempting to connect to Kafka (attempt 1)...
2021-06-30 07:29:14,253 Attempting to connect to Kafka (attempt 2)...
2021-06-30 07:29:16,255 Attempting to connect to Kafka (attempt 3)...
2021-06-30 07:29:16,271 Connected to Kafka on attempt 3
2021-06-30 07:29:16,272 Creating Kafka topics...
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Creating sentry_onpremise_snuba-api_run ... 
Creating sentry_onpremise_snuba-api_run ... done
Finished running migrations

▶ Creating additional Kafka topics ...

▶ Ensuring proper PostgreSQL version ...

▶ Setting up / migrating database ...
--no-ansi option is deprecated and will be removed in future versions. Use `--ansi never` instead.
Creating sentry_onpremise_symbolicator_1 ... 
Creating sentry_onpremise_postgres_1     ... 
Creating sentry_onpremise_memcached_1    ... 
Creating sentry_onpremise_smtp_1         ... 
Creating sentry_onpremise_snuba-subscription-consumer-events_1 ... 
Creating sentry_onpremise_snuba-replacer_1                     ... 
Creating sentry_onpremise_snuba-consumer_1                     ... 
Creating sentry_onpremise_snuba-api_1                          ... 
Creating sentry_onpremise_snuba-sessions-consumer_1            ... 
Creating sentry_onpremise_snuba-subscription-consumer-transactions_1 ... 
Creating sentry_onpremise_snuba-transactions-consumer_1              ... 
Creating sentry_onpremise_snuba-outcomes-consumer_1                  ... 
Creating sentry_onpremise_symbolicator_1                             ... done
Creating sentry_onpremise_postgres_1                                 ... done
Creating sentry_onpremise_memcached_1                                ... done
Creating sentry_onpremise_snuba-subscription-consumer-events_1       ... done
Creating sentry_onpremise_snuba-replacer_1                           ... done
Creating sentry_onpremise_snuba-consumer_1                           ... done
Creating sentry_onpremise_smtp_1                                     ... done
Creating sentry_onpremise_snuba-sessions-consumer_1                  ... done
Creating sentry_onpremise_snuba-api_1                                ... done
Creating sentry_onpremise_snuba-transactions-consumer_1              ... done
Creating sentry_onpremise_snuba-subscription-consumer-transactions_1 ... done
Creating sentry_onpremise_snuba-outcomes-consumer_1                  ... done
Creating sentry_onpremise_web_run                                    ... 
Creating sentry_onpremise_web_run                                    ... done
07:29:30 [WARNING] sentry.utils.geo: Error opening GeoIP database: /geoip/GeoLite2-City.mmdb
07:29:30 [WARNING] sentry.utils.geo: Error opening GeoIP database in Rust: /geoip/GeoLite2-City.mmdb
07:29:36 [INFO] sentry.plugins.github: apps-not-configured
Running migrations for default
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 <module>
    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 68, 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 24, in _upgrade
    ignore_ghost_migrations=True,
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 83, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 52, in __init__
    self.build_graph()
  File "/usr/local/lib/python3.6/site-packages/django/db/migrations/loader.py", line 210, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/usr/local/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
    if self.Migration._meta.db_table in self.connection.introspection.table_names(self.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

1
An error occurred, caught SIGERR on line 12
Cleaning up...

docker logs --since 30m 2230950f26c6

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions