sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.88k stars 2.14k forks source link

Postgresql errors during startup #1771

Closed QuickJack closed 5 years ago

QuickJack commented 5 years ago

When running docker-compose up for the first time, postgresql 10 generates an error.

The log is as follows:

Creating 2_redis2_1 ... done Creating 2_postgresql2_1 ... done Creating 2_gitlab2_1 ... done Attaching to 2_postgresql2_1, 2_redis2_1, 2_gitlab2_1 postgresql2_1 | Initializing datadir... postgresql2_1 | Initializing certdir... postgresql2_1 | Initializing logdir... postgresql2_1 | Initializing rundir... postgresql2_1 | Setting resolv.conf ACLs... postgresql2_1 | Initializing database... gitlab2_1 | Loading /etc/docker-gitlab/runtime/env-defaults gitlab2_1 | Initializing logdir... gitlab2_1 | Initializing datadir... redis2_1 | Starting redis-server... redis2_1 | 1:C 13 Nov 12:55:30.636 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis2_1 | 1:C 13 Nov 12:55:30.636 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=1, just started redis2_1 | 1:C 13 Nov 12:55:30.636 # Configuration loaded redis21 | ._
redis21 | .-__ ''-._ redis2_1 | _.- .. ''-. Redis 4.0.9 (00000000/0) 64 bit redis21 | .-`` .-.\/ ., ''-.
redis2_1 | ( ' , .-|, ) Running in standalone mode redis21 | |`-.-...- ...-.`-._|' _.-'| Port: 6379 redis21 | | `-. ._ / _.-' | PID: 1 redis2_1 |-. `-. -./ _.-' _.-' redis2_1 | |-.`-. `-..-' .-'.-'|
redis21 | | `-.-._ _.-'_.-' | http://redis.io redis2_1 |-. `-.-.__.-'_.-' _.-' redis2_1 | |-.`-. -.__.-' _.-'_.-'| redis2_1 | |-.`-. .-'.-' |
redis21 | `-. -._-..-'.-' .-'
redis21 | `-. `-.
.-' _.-'
redis21 | `-. _.-'
redis2_1 | `-.__.-'
redis2_1 | redis2_1 | 1:M 13 Nov 12:55:30.639 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. redis2_1 | 1:M 13 Nov 12:55:30.640 # Server initialized redis2_1 | 1:M 13 Nov 12:55:30.640 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis2_1 | 1:M 13 Nov 12:55:30.640 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled. redis2_1 | 1:M 13 Nov 12:55:30.640 Ready to accept connections redis2_1 | 1:M 13 Nov 12:55:30.640 The server is now ready to accept connections at /var/run/redis/redis-server.sock postgresql2_1 | Configuring hot standby... postgresql2_1 | ‣ Setting postgresql.conf parameter: wal_level = 'hot_standby' postgresql2_1 | ‣ Setting postgresql.conf parameter: max_wal_senders = '16' postgresql2_1 | ‣ Setting postgresql.conf parameter: checkpoint_segments = '8' postgresql2_1 | ‣ Setting postgresql.conf parameter: wal_keep_segments = '32' postgresql2_1 | ‣ Setting postgresql.conf parameter: hot_standby = 'on' postgresql2_1 | ‣ Setting postgresql.conf parameter: data_directory = '/var/lib/postgresql/10/main' postgresql2_1 | ‣ Setting postgresql.conf parameter: log_directory = '/var/log/postgresql' postgresql2_1 | ‣ Setting postgresql.conf parameter: log_filename = 'postgresql-10-main.log' postgresql2_1 | ‣ Setting postgresql.conf parameter: ssl = 'off' gitlab2_1 | Generating OpenSSH host keys... RSA DSA ECDSA ED25519 gitlab2_1 | Installing configuration templates... gitlab2_1 | SSL Key, SSL Certificate and DHParam were not found. gitlab2_1 | Assuming that the container is running behind a HTTPS enabled load balancer. gitlab2_1 | Configuring gitlab... postgresql2_1 | Creating database user: gitlab postgresql2_1 | Creating database: gitlabhq_production... postgresql2_1 | ‣ Loading pg_trgm extension... postgresql2_1 | ‣ Granting access to gitlab user... postgresql2_1 | Starting PostgreSQL 10... postgresql2_1 | 2018-11-13 12:55:37.149 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgresql2_1 | 2018-11-13 12:55:37.149 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgresql2_1 | 2018-11-13 12:55:37.210 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgresql2_1 | 2018-11-13 12:55:37.328 UTC [209] LOG: database system was shut down at 2018-11-13 12:55:36 UTC postgresql2_1 | 2018-11-13 12:55:37.363 UTC [1] LOG: database system is ready to accept connections gitlab2_1 | Configuring gitlab::database... gitlab2_1 | Configuring gitlab::redis gitlab2_1 | Configuring gitlab::secrets... gitlab2_1 | Configuring gitlab::sidekiq... gitlab2_1 | Configuring gitlab::gitaly... gitlab2_1 | Configuring gitlab::monitoring... gitlab2_1 | Configuring gitlab::gitlab-workhorse... gitlab2_1 | Configuring gitlab::unicorn... gitlab2_1 | Configuring gitlab::timezone... gitlab2_1 | Configuring gitlab::rack_attack... gitlab2_1 | Configuring gitlab::ci... gitlab2_1 | Configuring gitlab::artifacts... gitlab2_1 | Configuring gitlab::lfs... gitlab2_1 | Configuring gitlab::uploads... gitlab2_1 | Configuring gitlab::mattermost... gitlab2_1 | Configuring gitlab::project_features... gitlab2_1 | Configuring gitlab::smtp_settings... gitlab2_1 | Configuring gitlab::oauth... gitlab2_1 | Configuring gitlab::ldap... gitlab2_1 | Configuring gitlab::cron_jobs... gitlab2_1 | Configuring gitlab::backups... gitlab2_1 | Configuring gitlab::backups::schedule... gitlab2_1 | Configuring gitlab::registry... gitlab2_1 | Configuring gitlab::pages... gitlab2_1 | Configuring gitlab-shell... gitlab2_1 | Configuring nginx... gitlab2_1 | Configuring nginx::gitlab... gitlab2_1 | Configuring nginx::gitlab::hsts... gitlab2_1 | Setting up GitLab for firstrun. Please be patient, this could take a while... gitlab2_1 | 2018-11-13 13:55:40,467 CRIT Supervisor running as root (no user in config file) gitlab2_1 | 2018-11-13 13:55:40,467 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,468 WARN Included extra file "/etc/supervisor/conf.d/gitaly.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,468 WARN Included extra file "/etc/supervisor/conf.d/gitlab-workhorse.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,468 WARN Included extra file "/etc/supervisor/conf.d/mail_room.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,468 WARN Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,468 WARN Included extra file "/etc/supervisor/conf.d/sidekiq.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,468 WARN Included extra file "/etc/supervisor/conf.d/sshd.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,468 WARN Included extra file "/etc/supervisor/conf.d/unicorn.conf" during parsing gitlab2_1 | 2018-11-13 13:55:40,476 INFO RPC interface 'supervisor' initialized gitlab2_1 | 2018-11-13 13:55:40,476 CRIT Server 'unix_http_server' running without any HTTP authentication checking gitlab2_1 | 2018-11-13 13:55:40,476 INFO supervisord started with pid 614 gitlab2_1 | 2018-11-13 13:55:41,479 INFO spawned: 'gitaly' with pid 630 gitlab2_1 | 2018-11-13 13:55:41,481 INFO spawned: 'sidekiq' with pid 631 gitlab2_1 | 2018-11-13 13:55:41,482 INFO spawned: 'unicorn' with pid 632 gitlab2_1 | 2018-11-13 13:55:41,484 INFO spawned: 'gitlab-workhorse' with pid 633 gitlab2_1 | 2018-11-13 13:55:41,486 INFO spawned: 'cron' with pid 634 gitlab2_1 | 2018-11-13 13:55:41,487 INFO spawned: 'nginx' with pid 639 gitlab2_1 | 2018-11-13 13:55:41,488 INFO spawned: 'sshd' with pid 640 gitlab2_1 | 2018-11-13 13:55:43,353 INFO success: gitaly entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:55:43,353 INFO success: sidekiq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:55:43,353 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:55:43,353 INFO success: gitlab-workhorse entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:55:43,353 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:55:43,353 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:55:43,353 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | Missing Rails.application.secrets.openid_connect_signing_key for production environment. The secret will be generated and stored in config/secrets.yml. postgresql2_1 | 2018-11-13 12:56:05.292 UTC [218] ERROR: relation "features" does not exist at character 323 postgresql2_1 | 2018-11-13 12:56:05.292 UTC [218] STATEMENT: SELECT a.attname, format_type(a.atttypid, a.atttypmod), postgresql2_1 | pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod postgresql2_1 | FROM pg_attribute a LEFT JOIN pg_attrdef d postgresql2_1 | ON a.attrelid = d.adrelid AND a.attnum = d.adnum postgresql2_1 | WHERE a.attrelid = '"features"'::regclass postgresql2_1 | AND a.attnum > 0 AND NOT a.attisdropped postgresql2_1 | ORDER BY a.attnum postgresql2_1 |
postgresql2_1 | 2018-11-13 12:56:05.293 UTC [218] ERROR: relation "features" does not exist at character 323 postgresql2_1 | 2018-11-13 12:56:05.293 UTC [218] STATEMENT: SELECT a.attname, format_type(a.atttypid, a.atttypmod), postgresql2_1 | pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod postgresql2_1 | FROM pg_attribute a LEFT JOIN pg_attrdef d postgresql2_1 | ON a.attrelid = d.adrelid AND a.attnum = d.adnum postgresql2_1 | WHERE a.attrelid = '"features"'::regclass postgresql2_1 | AND a.attnum > 0 AND NOT a.attisdropped postgresql2_1 | ORDER BY a.attnum postgresql2_1 |
postgresql2_1 | 2018-11-13 12:56:05.350 UTC [222] ERROR: database "gitlabhq_production" already exists postgresql2_1 | 2018-11-13 12:56:05.350 UTC [222] STATEMENT: CREATE DATABASE "gitlabhq_production" ENCODING = 'unicode' gitlab2_1 | gitlabhq_production already exists gitlab2_1 | Migrating database... gitlab2_1 | Clearing cache... gitlab2_1 | 2018-11-13 13:57:20,910 WARN received SIGTERM indicating exit request gitlab2_1 | 2018-11-13 13:57:20,910 INFO waiting for sshd, gitlab-workhorse, sidekiq, cron, nginx, gitaly, unicorn to die gitlab2_1 | 2018-11-13 13:57:20,911 INFO stopped: sshd (exit status 0) gitlab2_1 | 2018-11-13 13:57:20,914 INFO stopped: nginx (exit status 0) gitlab2_1 | 2018-11-13 13:57:20,914 INFO stopped: cron (terminated by SIGTERM) gitlab2_1 | 2018-11-13 13:57:20,916 INFO stopped: gitlab-workhorse (terminated by SIGTERM) gitlab2_1 | 2018-11-13 13:57:22,273 INFO stopped: unicorn (exit status 0) gitlab2_1 | 2018-11-13 13:57:24,357 INFO waiting for sidekiq, gitaly to die gitlab2_1 | 2018-11-13 13:57:25,974 INFO stopped: sidekiq (exit status 0) gitlab2_1 | 2018-11-13 13:57:25,990 INFO stopped: gitaly (exit status 1) gitlab2_1 | 2018-11-13 13:57:26,135 CRIT Supervisor running as root (no user in config file) gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/gitaly.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/gitlab-workhorse.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/mail_room.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/sidekiq.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/sshd.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,135 WARN Included extra file "/etc/supervisor/conf.d/unicorn.conf" during parsing gitlab2_1 | 2018-11-13 13:57:26,143 INFO RPC interface 'supervisor' initialized gitlab2_1 | 2018-11-13 13:57:26,143 CRIT Server 'unix_http_server' running without any HTTP authentication checking gitlab2_1 | 2018-11-13 13:57:26,143 INFO supervisord started with pid 1 gitlab2_1 | 2018-11-13 13:57:27,145 INFO spawned: 'gitaly' with pid 866 gitlab2_1 | 2018-11-13 13:57:27,146 INFO spawned: 'sidekiq' with pid 867 gitlab2_1 | 2018-11-13 13:57:27,148 INFO spawned: 'unicorn' with pid 868 gitlab2_1 | 2018-11-13 13:57:27,149 INFO spawned: 'gitlab-workhorse' with pid 869 gitlab2_1 | 2018-11-13 13:57:27,150 INFO spawned: 'cron' with pid 870 gitlab2_1 | 2018-11-13 13:57:27,151 INFO spawned: 'nginx' with pid 871 gitlab2_1 | 2018-11-13 13:57:27,152 INFO spawned: 'sshd' with pid 872 gitlab2_1 | 2018-11-13 13:57:28,886 INFO success: gitaly entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:57:28,886 INFO success: sidekiq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:57:28,886 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:57:28,886 INFO success: gitlab-workhorse entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:57:28,887 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:57:28,887 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) gitlab2_1 | 2018-11-13 13:57:28,887 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

solidnerd commented 5 years ago

Hey @QuickJack,

it seems there is an issue of missing a migration or something because what it points it is that a table is missing:

postgresql2_1 | 2018-11-13 12:56:05.293 UTC [218] ERROR: relation "features" does not exist at character 323
postgresql2_1 | 2018-11-13 12:56:05.293 UTC [218] STATEMENT: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
postgresql2_1 | pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
postgresql2_1 | FROM pg_attribute a LEFT JOIN pg_attrdef d
postgresql2_1 | ON a.attrelid = d.adrelid AND a.attnum = d.adnum
postgresql2_1 | WHERE a.attrelid = '"features"'::regclass
postgresql2_1 | AND a.attnum > 0 AND NOT a.attisdropped
postgresql2_1 | ORDER BY a.attnum
postgresql2_1 |
postgresql2_1 | 2018-11-13 12:56:05.350 UTC [222] ERROR: database "gitlabhq_production" already exists
postgresql2_1 | 2018-11-13 12:56:05.350 UTC [222] STATEMENT: CREATE DATABASE "gitlabhq_production" ENCODING = 'unicode'
QuickJack commented 5 years ago

It was a problem of my testing instance. I restored the system from backup and the error was gone. Thanks anyway.