Bug #20384

Initial db:seed fails

Added by Guido Günther 9 months ago. Updated 7 months ago.

Status:Closed
Priority:Urgent
Assigned To:Marek Hulán
Category:rake tasks
Target version:Team Marek Iteration 18
Difficulty: Bugzilla link:
Found in release:nightly Pull request:https://github.com/theforeman/foreman/pull/4691, https://github.com/theforeman/foreman/pull/4696
Story points-
Velocity based estimate-
Release1.16.0Release relationshipAuto

Description

Here's another one when bootstrapping foreman on up to date Debian stretch plus https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions (because of #20232) fails.

Following https://www.theforeman.org/contribute.html

bundle exec bin/rake db:seed

gives

2017-07-22T00:35:07 [app] [D] Setting current user thread-local variable to foreman_admin
rake aborted!
Unable to create anonymous admin user: Auth source can't be blank
/home/agx/foreman/db/seeds.d/04-admin.rb:14:in `block in <top (required)>'
/home/agx/foreman/vendor/gems/ruby/2.3.0/gems/audited-4.5.0/lib/audited/auditor.rb:283:in `without_auditing'
/home/agx/foreman/db/seeds.d/04-admin.rb:9:in `<top (required)>'
/home/agx/foreman/db/seeds.rb:46:in `block in <top (required)>'
/home/agx/foreman/db/seeds.rb:36:in `each'
/home/agx/foreman/db/seeds.rb:36:in `<top (required)>'
/home/agx/foreman/vendor/gems/ruby/2.3.0/gems/railties-4.2.9/lib/rails/engine.rb:547:in `load_seed'
-e:1:in `<main>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)


Related issues

Related to Foreman - Bug #16884: Create permissions do not check filter limits Closed 10/12/2016
Related to Foreman - Refactor #21010: Reorganize seed files Closed 09/19/2017

Associated revisions

Revision f079f90a
Added by Marek Hulán 9 months ago

Fixes #20384 - seed resources before admin exists

For seed scripts that executes before internal admin exist we need to
ignore creation permission check on resources that includes Authorizable
concern.

History

#1 Updated by Michael Moll 9 months ago

  • Priority changed from Normal to Urgent
  • Release set to 1.16.0
  • Found in release set to nightly

This can also be seen in nightly systests with production packages.

#2 Updated by Marek Hulán 9 months ago

this could be caused by recent permission change, I'll try seeding on empty database, I was unable to reproduce so far

#3 Updated by Marek Hulán 9 months ago

  • Related to Bug #16884: Create permissions do not check filter limits added

#4 Updated by Marek Hulán 9 months ago

we'll need "ignore create permission" method for seeding where we can't run the auth source creation under anonymous admin users which does not exist yet

#5 Updated by The Foreman Bot 9 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Marek Hulán
  • Pull request https://github.com/theforeman/foreman/pull/4691 added

#6 Updated by Marek Hulán 9 months ago

  • Target version set to Team Marek Iteration 18

#7 Updated by Marek Hulán 9 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#8 Updated by The Foreman Bot 9 months ago

  • Pull request https://github.com/theforeman/foreman/pull/4696 added

#9 Updated by Marek Hulán 7 months ago

Also available in: Atom PDF