I recently upgraded my GitLab from version 12 to 15 and all seems to be working well. However, I noticed that I get this warning about “composite primary key” when I open the console:
$ docker exec -it gitlab gitlab-rails console
--------------------------------------------------------------------------------
Ruby: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
GitLab: 15.5.2-ee (767831e030c) EE
GitLab Shell: 14.12.0
PostgreSQL: 12.10
------------------------------------------------------------[ booted in 44.91s ]
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
Loading production environment (Rails 6.1.6.1)
I also get the same warning when running
Gitlab::BackgroundMigration.remaining
or
Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count
Is there a recommended action to be taken given this warning?
We got the exact same issue, but on another version (15.6.1, Omnibus) (might be, that the problem existed before the last update):
$ sudo gitlab-rails console
--------------------------------------------------------------------------------
Ruby: ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]
GitLab: 15.6.1-ee (fe39c71ac74) EE
GitLab Shell: 14.13.0
PostgreSQL: 12.12
------------------------------------------------------------[ booted in 35.37s ]
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
Loading production environment (Rails 6.1.6.1)
Would be nice to get any information regarding this issue.
I ran into the same issue. Any help would be resourceful.
[root]# docker-compose exec web gitlab-rails runner -e production 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count'
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
0
or
[root]# docker-compose exec web gitlab-rails console
--------------------------------------------------------------------------------
Ruby: ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]
GitLab: 15.6.3-ee (511d324e54d) EE
GitLab Shell: 14.13.0
PostgreSQL: 13.8
------------------------------------------------------------[ booted in 58.21s ]
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
WARNING: Active Record does not support composite primary key.
security_findings has composite primary key. Composite primary key is ignored.
Loading production environment (Rails 6.1.6.1)