DB not seeded when GitLab chart installed with OpenBao enabled
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
When installing GitLab chart v9.6.1 with OpenBao enabled,
The main GitLab database is not seeded.
In particular, the users table is empty.
By default GitLab and OpenBao share the same database.
OpenBao successfully creates openbao_kv_store and openbao_ha_locks.
We might be experiencing the same problem in the context of E2E tests on CNG. To be checked. See !213782 (comment 2926196440)
Note: However, in production environments OpenBao should probably have its own database
instead of storing its data in the main database.
Then E2E tests on CNG should replicate that setup,
and make OpenBao use a dedicated database.
This might hurt adoption though, as GitLab chart can't just create a new (logical) database – unlike Omnibus.
See discussion: #582640 (comment 2935472025).
Workarounds
- Enable OpenBao after installing the GitLab Helm Chart, using helm upgrade.
- Configure a separate database for OpenBao.
- Execute
db:seed_furake task from the toolbox pod.kubectl exec -it <toolbox-pod-name> -- gitlab-rake db:seed_fu
Steps to reproduce
- Install the GitLab Helm Chart with OpenBao installed.
helm install gitlab gitlab/gitlab --set global.openbao.enabled=true openbao.install=true ... - Connect to the database console using the toolbox.
kubectl exec -it <toolbox-pod-name> -- gitlab-rails dbconsole --include-password --database main - Check the
userstable.SELECT username FROM users
What is the current bug behavior?
The main database is not seeded. The users table is empty.
What is the expected correct behavior?
The main database is seeded. The users table contains the root user.
Relevant logs and/or screenshots
Possible fixes
Links
- https://docs.gitlab.com/charts/charts/openbao/
- https://openbao.org/docs/configuration/storage/postgresql/#manually-creating-tables
- https://gitlab.com/gitlab-org/gitlab/-/blob/e7afd93470d7d13d738b243fed3bc52019e93c90/lib/tasks/gitlab/db.rake#L172
- https://gitlab.com/gitlab-org/gitlab/-/blob/e7afd93470d7d13d738b243fed3bc52019e93c90/spec/tasks/gitlab/db_rake_spec.rb#L318-326