The VSA fixture (db/fixtures/development/17_cycle_analytics.rb) is erroring due to a NoMethodError. The method is allow, which is not available outside the CI context. Inside the CI context the fixture can be run successfully, which is why we were not aware of this error.
Partial trace
== Seed from /Users/mlunoe/workspace/gdk/gitlab/db/fixtures/development/17_cycle_analytics.rb
**************************************************
️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.
**************************************************
rake aborted!
NoMethodError: undefined method `allow' for #
/Users/mlunoe/workspace/gdk/gitlab/spec/factories/merge_requests.rb:257:in `block (3 levels) in '
(eval):89:in `block in seed_code_stage!'
(eval):88:in `each'
(eval):88:in `seed_code_stage!'
(eval):55:in `seed!'
(eval):204:in `block (3 levels) in run_file'
/Users/mlunoe/workspace/gdk/gitlab/lib/gitlab/seeder.rb:90:in `quiet'
(eval):197:in `block (2 levels) in run_file'
/Users/mlunoe/.rbenv/versions/2.6.6/bin/bundle:23:in `load'
/Users/mlunoe/.rbenv/versions/2.6.6/bin/bundle:23:in `'
Tasks: TOP => db:seed_fu
(See full trace by running task with --trace)
Designs
Child items
0
Show closed items
GraphQL error: The resource that you are attempting to access does not exist or you don't have permission to perform this action
I would still use the factories because we can reduce significant amount of work when creating DB records. I'll try to figure something out to workaround the missing allow method failure.
For some reason I cannot reproduce the error (master):
> $ FILTER=cycle_analytics SEED_CYCLE_ANALYTICS=1 bundle exec rake db:seed_fu == Filtering seed files against regexp: /cycle_analytics/== Seed from/gitlab-development-kit/gitlab/db/fixtures/development/17_cycle_analytics.rb**************************************************⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.**************************************************Successfully seeded 'vsmg-1599628982/vsmp-1599628982' for Value Stream Management!URL: http://127.0.0.1:3000/vsmg-1599628982/vsmp-1599628982OK== Seed from ee/db/fixtures/development/30_customizable_cycle_analytics.rbSkipped. Use the `SEED_CUSTOMIZABLE_CYCLE_ANALYTICS` environment variable to enable.OK
Hmmm... I got this (failed on first run and succeeded thereafter!) :thinking::
➜ gitlab git:(master) ✗ FILTER=cycle_analytics SEED_CYCLE_ANALYTICS=1 bundle exec rake db:seed_fu == Filtering seed files against regexp: /cycle_analytics/== Seed from /Users/mlunoe/workspace/gdk/gitlab/db/fixtures/development/17_cycle_analytics.rb**************************************************⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.**************************************************rake aborted!ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "merge_requests_pkey"DETAIL: Key (id)=(11) already exists.(eval):89:in `block in seed_code_stage!'(eval):88:in `each'(eval):88:in `seed_code_stage!'(eval):55:in `seed!'(eval):204:in `block (3 levels) in run_file'/Users/mlunoe/workspace/gdk/gitlab/lib/gitlab/seeder.rb:90:in `quiet'(eval):197:in `block (2 levels) in run_file'/Users/mlunoe/.rbenv/versions/2.6.6/bin/bundle:23:in `load'/Users/mlunoe/.rbenv/versions/2.6.6/bin/bundle:23:in `<main>'Caused by:PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "merge_requests_pkey"DETAIL: Key (id)=(11) already exists.(eval):89:in `block in seed_code_stage!'(eval):88:in `each'(eval):88:in `seed_code_stage!'(eval):55:in `seed!'(eval):204:in `block (3 levels) in run_file'/Users/mlunoe/workspace/gdk/gitlab/lib/gitlab/seeder.rb:90:in `quiet'(eval):197:in `block (2 levels) in run_file'/Users/mlunoe/.rbenv/versions/2.6.6/bin/bundle:23:in `load'/Users/mlunoe/.rbenv/versions/2.6.6/bin/bundle:23:in `<main>'Tasks: TOP => db:seed_fu(See full trace by running task with --trace)➜ gitlab git:(master) ✗ FILTER=cycle_analytics SEED_CYCLE_ANALYTICS=1 bundle exec rake db:seed_fu --trace** Invoke db:seed_fu (first_time)** Invoke environment (first_time)** Execute environment** Execute db:seed_fu== Filtering seed files against regexp: /cycle_analytics/== Seed from /Users/mlunoe/workspace/gdk/gitlab/db/fixtures/development/17_cycle_analytics.rb**************************************************⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.**************************************************Successfully seeded 'vsmg-1599656861/vsmp-1599656861' for Value Stream Management!URL: http://127.0.0.1:3000/vsmg-1599656861/vsmp-1599656861OK== Seed from ee/db/fixtures/development/30_customizable_cycle_analytics.rbSkipped. Use the `SEED_CUSTOMIZABLE_CYCLE_ANALYTICS` environment variable to enable.OK
@mlunoe seems like the PG::UniqueViolation error you encountered is a different issue than the NoMethodError problem. I suspect it was because you ran the migrations after already having some data in your database. That's based on the error message you encountered ("Key (id)=(11) already exists") and understanding migrations were successful on the second attempt. But I assume you cleared the database before that second attempt, right?
@ahegyi you were not able to replicate and I don't believe we have received other reports of this. Do you think this problem was temporary or related to a specific upgrade? I'm wondering if we could close
@ahegyi in our 1:1 earlier today we talked about that other recent problem with migrations in the GDK context, where clearing the Gitaly cache fixed the problem. But I don't think that would fix the NoMethodError here.
@ljlane I just set the due date on this ~bug issue to reflect our 90-day SLO on severity3 bugs. Coincidentally it was yesterday (2021-12-03), so we should probably consider this as one of the bugfixes we include for %13.8 or %13.9.