sameersbn / sameersbn/docker-gitlab

Configuration problem while trying to debug failing migration from 14.9 to 14.10

Open
#2,757 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8.1k
Forks
2.1k
Avg merge
17h 47m
Merged PRs (30d)
7

Description

Following other issues, I am attempting to debug my issues by doing:

docker-compose run -it --rm gitlab bash -c "sudo -HEu git bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' RAILS_ENV=production"

which has led to errors about /home/git/gitlab/log being unwritable`. Following more advice, I ended up with:

docker-compose run -it --rm gitlab bash -c "rm -rf /home/git/gitlab/log && sudo -HEu git bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' RAILS_ENV=production"

Which runs the command correctly, but fails with the following error, which makes no sense to me:

/home/git/gitlab/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:83:in rescue in new_client': connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (ActiveRecord::ConnectionNotEstablished)`

PostgreSQL is running on that port and is accepting connections, although of course it is not running on 127.0.0.1, because it is in its own container, and has correctly set DB_HOST=postgresql in GitLabs env variables. But the command seems to ignore these variables, despite being mentioned as working in various issues in this project, so I am at a loss as how to proceed.

If I am completely off-base: how DO I check migration status while using the setup of this repository ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the docker-compose command in the issue and the reported ActiveRecord PostgreSQL adapter error. Check how DB_HOST and the database connection environment reach the GitLab container, then verify the migration-status command completes against the PostgreSQL container rather than localhost.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, postgresql, rails
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.