Project

General

Profile

Actions

Bug #14542

open

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

Added by Jérôme Vizcaino over 8 years ago. Updated over 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DB migrations
Target version:
-
Difficulty:
Triaged:
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.

Actions #1

Updated by Dominic Cleal over 8 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.

Actions

Also available in: Atom PDF