Failing to start container Gitlab out of the box

Problem to solve

Gitlab container is exiting after few minutes without never getting up.
I expect it to start and offer online web GUI for me to enter it.

I’m using Podman on Rocky 8.
I’ve created a docker-compose file with the following :

version: "3.6"
services:
  gitlab:
    image: gitlab/gitlab-ce:16.11.2-ce.0
    container_name: gitlab
    hostname: 'gitlab.nfrlab.local'
    volumes:
            - gitlab_storage_config:/etc/gitlab:Z
            - gitlab_storage_data:/var/log/gitlab:Z
            - gitlab_storage_data:/var/opt/gitlab:Z
    ports:
      - 6880:80
    restart: "no"
    shm_size: 256m

volumes:
  gitlab_storage_config:
    external: true
  gitlab_storage_data:
    external: true

I had to add the Z at the end, otherwise it was not happy.

I’ve created the 2 volume pointing to 2 different folder :
gitlab_storage_data : […]/data
gitlab_storage_config : […]/config

I’ve made a reverse proxy config to point to the correct DNS name with associated port.

Steps to reproduce

podman-compose up -d

Configuration

I didn’t make any change.

Versions

  • [ x ] Self-managed

Versions
I’ve tried Latest tag and the one above to see if there was a difference.

Some logs

I’ve set restart to no so I can have “cleaner” log.
I see there is an issue with the DB.

podman logs gitlab 
Recipe: gitlab::database_migrations
  * ruby_block[check remote PG version] action nothing (skipped due to action :nothing)
  * rails_migration[gitlab-rails] action run[2024-05-21T08:14:00+00:00] WARN: gitlab-rails does not have a log_group or default logdir mode defined. Setting to 0700.

    * bash_hide_env[migrate gitlab-rails database] action run
      [execute] rake aborted!
                ActiveRecord::DatabaseConnectionError: There is an issue connecting to your database with your username/password, username: gitlab.

                Please check your database configuration to ensure the username/password are valid.
                /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:124:in `read_write'
                /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `write_using_load_balancer'
                /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:96:in `method_missing'
                /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:128:in `configure_database'
                /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:107:in `configure_pg_databases'
                /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:94:in `block (3 levels) in <top (required)>'
                /opt/gitlab/embedded/bin/bundle:25:in `load'
                /opt/gitlab/embedded/bin/bundle:25:in `<main>'

                Caused by:
                PG::ConnectionBad: connection to server on socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432" failed: Permission denied
                        Is the server running locally and accepting connections on that socket?
                /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/load_balancer.rb:124:in `read_write'
                /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `write_using_load_balancer'
                /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/load_balancing/connection_proxy.rb:96:in `method_missing'
                /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:128:in `configure_database'
                /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:107:in `configure_pg_databases'
                /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:94:in `block (3 levels) in <top (required)>'
                /opt/gitlab/embedded/bin/bundle:25:in `load'
                /opt/gitlab/embedded/bin/bundle:25:in `<main>'
                Tasks: TOP => gitlab:db:configure
                (See full trace by running task with --trace)

      ================================================================================
      Error executing action `run` on resource 'bash_hide_env[migrate gitlab-rails database]'
      ================================================================================

And the Postgres :

2024-05-21_08:13:52.86782 LOG:  starting PostgreSQL 14.11 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit
2024-05-21_08:13:52.86879 LOG:  listening on Unix socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"
2024-05-21_08:13:52.87324 LOG:  database system was shut down at 2024-05-21 08:13:48 GMT
2024-05-21_08:13:52.87716 LOG:  database system is ready to accept connections
2024-05-21_08:13:56.06151 LOG:  no match in usermap "gitlab" for user "gitlab" authenticated as "root"
2024-05-21_08:13:56.06159 FATAL:  Peer authentication failed for user "gitlab"
2024-05-21_08:13:56.06160 DETAIL:  Connection matched pg_hba.conf line 70: "local   all         all                               peer map=gitlab"
2024-05-21_08:13:56.17407 LOG:  no match in usermap "gitlab" for user "gitlab" authenticated as "root"
2024-05-21_08:13:56.17410 FATAL:  Peer authentication failed for user "gitlab"
2024-05-21_08:13:56.17410 DETAIL:  Connection matched pg_hba.conf line 70: "local   all         all                               peer map=gitlab"
2024-05-21_08:13:56.27116 LOG:  no match in usermap "gitlab" for user "gitlab" authenticated as "root"
2024-05-21_08:13:56.27119 FATAL:  Peer authentication failed for user "gitlab"
2024-05-21_08:13:56.27119 DETAIL:  Connection matched pg_hba.conf line 70: "local   all         all                               peer map=gitlab"
2024-05-21_08:13:56.65462 LOG:  no match in usermap "gitlab" for user "gitlab" authenticated as "root"
2024-05-21_08:13:56.65465 FATAL:  Peer authentication failed for user "gitlab"
2024-05-21_08:13:56.65465 DETAIL:  Connection matched pg_hba.conf line 70: "local   all         all                               peer map=gitlab"
2024-05-21_08:13:56.84959 LOG:  no match in usermap "gitlab" for user "gitlab" authenticated as "root"
2024-05-21_08:13:56.84963 FATAL:  Peer authentication failed for user "gitlab"
2024-05-21_08:13:56.84964 DETAIL:  Connection matched pg_hba.conf line 70: "local   all         all                               peer map=gitlab"

So should I set-up the DB on a different container ?
I don’t know if it would help, but at least I would have more control on the DB… But as it’s just a test it was more easy to run everything in one.
Any help is appreciated.

So after reconfiguring volumes and not mixing Data & logs folder I do not face the issues anymore.
Solution is :

  1. Create the Logs folder rather than rely on Data one
  2. Create the log volumes matching the log folder
  3. Update of the docker-compose.yml file with the new volume mountpoint + volume external section
  4. Delete previous container and pod
  5. Restart everything