Project

General

Profile

Bug #14542

foreman-rake db:setup fails in db:seed task

Added by Jérôme Vizcaino about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DB migrations
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Howto reproduce:

  • start from scratch, install the foreman package with any database support (sqlite will do)
  • as root, call foreman-rake db:setup : the program fails during the db:seed task, specifically in the 04-admin.rb part (the backtrace stipulates that it can't call dup in NilClass at 04-admin.rb:38)

Cause:

  • this is partly related to #14541 because none of ENV['SEED_ADMIN_EMAIL'] nor Setting[:administrator] seem to be valid

As a sidenote, calling foreman-rake db:seed works.

History

#1 Updated by Dominic Cleal about 6 years ago

  • Category set to DB migrations

Setting[:administrator] won't have been initialised yet, as there's been no application startup since the DB migration and before the DB seed. Running migration/creation and seeding in two separate commands works as the setting's populated when the seed starts up.

In the long term, settings should probably be moved into the seed scripts.

Also available in: Atom PDF