Setting initial root password fails on GitLab 13.12

Summary

On a fresh deployment with Docker (compose) using GitLab 13.12.2, the password set for root (as described in the docs is ignored and I need to set a password via the UI.

Executing a fresh deployment with same configuration using 13.11.5, the password is used as expected.

There is is similar report but it is already over an year old and I think this issue I describe is specific to 13.12.

Steps to reproduce

  1. Deploy via docker-compose using this configuration
     version: '3'
     services:
       gitlab:
         container_name: gitlab
         image: gitlab/gitlab-ce:13.12.2-ce.0
         volumes:
           - "vol-gitlab-config:/etc/gitlab"
           - "vol-gitlab-log:/var/log/gitlab"
           - "vol-gitlab-data:/var/opt/gitlab"
         environment:
            GITLAB_OMNIBUS_CONFIG: |
            external_url "http://localhost"
            nginx['listen_https'] = false 
            letsencrypt['enable'] = false
            gitlab_rails['initial_root_password'] = "Secure!secure!"
        ports:      
           - "80:80"
           - "443:443"
           - "22:22"
    
     volumes:
       vol-gitlab-config:
       vol-gitlab-log:
       vol-gitlab-data:
  2. Open http://localhost and GitLab requests to change the password.

What is the current bug behavior?

On a fresh deployment with Docker (compose) using GitLab 13.12.2, the password set for root (as described in the docs is ignored and I need to set a password via the UI.

What is the expected correct behavior?

On a fresh deployment, the password set in the configuration should be used.

Relevant logs and/or screenshots

I added the full log log_13.12.2

From what I see, this is the most interesting:

Running handlers:^[[0m
Running handlers complete
^[[0mChef Infra Client finished, 528/1458 resources updated in 05 minutes 24 seconds^[[0m

Notes:
Default admin account has been configured with username `root` and the password you specified in `/etc/gitlab/gitlab.rb` file.

gitlab Reconfigured!

but then later in the code

==> /var/log/gitlab/gitlab-rails/exceptions_json.log <==
# Logfile created on 2021-06-10 14:56:57 +0000 by logger.rb/v1.4.2
{"severity":"ERROR","time":"2021-06-10T14:56:57.492Z","correlation_id":"4eaa8b949256a041b7f9f280b889242c","exception.class":"Sidekiq::Worker::EnqueueFromTransactionError","exception.message":"`AuthorizedProjectUpdate::ProjectCreateWorker.perform_async` cannot be called inside a transaction as this can lead to\nrace conditions when the worker runs before the transaction is committed and\ntries to access a model that has not been saved yet.\n\nUse an `after_commit` hook, or include `AfterCommitQueue` and use a `run_after_commit` block instead.\n","exception.backtrace":["config/initializers/forbid_sidekiq_in_transactions.rb:25:in `block (2 levels) in \u003cmodule:NoEnqueueingFromTransactions\u003e'","app/services/projects/create_service.rb:132:in `setup_authorizations'","app/services/projects/create_service.rb:104:in `after_create_actions'","app/services/projects/create_service.rb:66:in `block in execute'","lib/gitlab/application_context.rb:70:in `block in use'","lib/gitlab/application_context.rb:70:in `use'","lib/gitlab/application_context.rb:27:in `with_context'","app/services/projects/create_service.rb:65:in `execute'","app/services/concerns/measurable.rb:35:in `execute'","lib/gitlab/database_importers/self_monitoring/project/create_service.rb:59:in `create_project'","app/models/concerns/stepable.rb:14:in `call'","app/models/concerns/stepable.rb:14:in `block in execute_steps'","app/models/concerns/stepable.rb:13:in `each'","app/models/concerns/stepable.rb:13:in `inject'","app/models/concerns/stepable.rb:13:in `execute_steps'","lib/gitlab/database_importers/self_monitoring/project/create_service.rb:27:in `execute'","(eval):3:in `block (2 levels) in run_file'","lib/gitlab/database.rb:371:in `block in transaction'","lib/gitlab/database.rb:370:in `transaction'","lib/tasks/gitlab/db.rake:66:in `block (3 levels) in \u003ctop (required)\u003e'"],"user.username":null,"tags.program":"web","tags.locale":"en","tags.feature_category":null,"tags.correlation_id":"4eaa8b949256a041b7f9f280b889242c"}
{"severity":"ERROR","time":"2021-06-10T14:56:57.516Z","correlation_id":"4eaa8b949256a041b7f9f280b889242c","exception.class":"Sidekiq::Worker::EnqueueFromTransactionError","exception.message":"`Projects::PostCreationWorker.perform_async` cannot be called inside a transaction as this can lead to\nrace conditions when the worker runs before the transaction is committed and\ntries to access a model that has not been saved yet.\n\nUse an `after_commit` hook, or include `AfterCommitQueue` and use a `run_after_commit` block instead.\n","exception.backtrace":["config/initializers/forbid_sidekiq_in_transactions.rb:25:in `block (2 levels) in \u003cmodule:NoEnqueueingFromTransactions\u003e'","app/services/projects/create_service.rb:109:in `after_create_actions'","app/services/projects/create_service.rb:66:in `block in execute'","lib/gitlab/application_context.rb:70:in `block in use'","lib/gitlab/application_context.rb:70:in `use'","lib/gitlab/application_context.rb:27:in `with_context'","app/services/projects/create_service.rb:65:in `execute'","app/services/concerns/measurable.rb:35:in `execute'","lib/gitlab/database_importers/self_monitoring/project/create_service.rb:59:in `create_project'","app/models/concerns/stepable.rb:14:in `call'","app/models/concerns/stepable.rb:14:in `block in execute_steps'","app/models/concerns/stepable.rb:13:in `each'","app/models/concerns/stepable.rb:13:in `inject'","app/models/concerns/stepable.rb:13:in `execute_steps'","lib/gitlab/database_importers/self_monitoring/project/create_service.rb:27:in `execute'","(eval):3:in `block (2 levels) in run_file'","lib/gitlab/database.rb:371:in `block in transaction'","lib/gitlab/database.rb:370:in `transaction'","lib/tasks/gitlab/db.rake:66:in `block (3 levels) in \u003ctop (required)\u003e'"],"user.username":null,"tags.program":"web","tags.locale":"en","tags.feature_category":null,"tags.correlation_id":"4eaa8b949256a041b7f9f280b889242c"}
{"severity":"ERROR","time":"2021-06-10T14:56:57.711Z","correlation_id":"4eaa8b949256a041b7f9f280b889242c","exception.class":"Gitlab::Git::PreReceiveError","exception.message":"Internal API unreachable","exception.backtrace":["lib/gitlab/gitaly_client/operation_service.rb:351:in `user_commit_files'","lib/gitlab/git/repository.rb:904:in `block in multi_action'","lib/gitlab/git/wraps_gitaly_errors.rb:7:in `wrapped_gitaly_errors'","lib/gitlab/git/repository.rb:903:in `multi_action'","app/models/repository.rb:824:in `block in multi_action'","app/models/repository.rb:807:in `with_cache_hooks'","app/models/repository.rb:824:in `multi_action'","app/models/repository.rb:788:in `create_file'","app/services/files/create_service.rb:16:in `create_transformed_commit'","app/services/files/create_service.rb:10:in `create_commit!'","app/services/commits/create_service.rb:30:in `execute'","app/services/projects/create_service.rb:158:in `create_readme'","app/services/projects/create_service.rb:114:in `after_create_actions'","app/services/projects/create_service.rb:66:in `block in execute'","lib/gitlab/application_context.rb:70:in `block in use'","lib/gitlab/application_context.rb:70:in `use'","lib/gitlab/application_context.rb:27:in `with_context'","app/services/projects/create_service.rb:65:in `execute'","app/services/concerns/measurable.rb:35:in `execute'","lib/gitlab/database_importers/self_monitoring/project/create_service.rb:59:in `create_project'","app/models/concerns/stepable.rb:14:in `call'","app/models/concerns/stepable.rb:14:in `block in execute_steps'","app/models/concerns/stepable.rb:13:in `each'","app/models/concerns/stepable.rb:13:in `inject'","app/models/concerns/stepable.rb:13:in `execute_steps'","lib/gitlab/database_importers/self_monitoring/project/create_service.rb:27:in `execute'","(eval):3:in `block (2 levels) in run_file'","lib/gitlab/database.rb:371:in `block in transaction'","lib/gitlab/database.rb:370:in `transaction'","lib/tasks/gitlab/db.rake:66:in `block (3 levels) in \u003ctop (required)\u003e'"],"user.username":null,"tags.program":"web","tags.locale":"en","tags.feature_category":null,"tags.correlation_id":"4eaa8b949256a041b7f9f280b889242c"}

==> /var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-2021-06-10-14-56-05.log <==
password: You'll be prompted to create one on your first visit.

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

```
System information
System:		
Current User:	git
Using RVM:	no
Ruby Version:	2.7.2p137
Gem Version:	3.1.4
Bundler Version:2.1.4
Rake Version:	13.0.3
Redis Version:	6.0.12
Git Version:	2.31.1
Sidekiq Version:5.2.9
Go Version:	unknown

GitLab information
Version:	13.12.2
Revision:	d98457affdf
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	12.6
URL:		http://localhost
HTTP Clone URL:	http://localhost/some-group/some-project.git
SSH Clone URL:	git@localhost:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	13.18.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell
Git:		/opt/gitlab/embedded/bin/git
```

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.18.0 ? ... OK (13.18.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Internal API available: OK
Redis available via internal API: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes
Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ... 
2/1 ... yes
Redis version >= 5.0.0? ... yes
Ruby version >= 2.7.2 ? ... yes (2.7.2)
Git version >= 2.31.0 ? ... yes (2.31.1)
Git user has default SSH configuration? ... yes
Active users: ... 1
Is authorized keys file accessible? ... yes
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... yes

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished