Open roflmao opened 6 years ago
hi will check it
Looks like the db migration fails:
10:07:56 [root@foreman01[GM]:/var/lib/foreman] $ foreman-rake db:seed
You have 36 pending migrations:
20160727161914 CreateSites
20160728123353 CreateRackGroups
20160728143149 CreateRacks
20160728161636 CreatePlatforms
20160728162635 CreateDeviceRoles
20160728163815 CreateManufacturers
20160728164858 CreateDeviceTypes
20160728171422 CreateDevices
20160728194401 CreateDeviceInterfaces
20160728195242 CreateDeviceInterfaceConnections
20160804104103 CreateInterfaceTemplates
20160804142618 CreateConsolePortTemplates
20160804164301 CreatePowerPortTemplates
20160805080626 CreateConsoleServerPortTemplates
20160805084726 CreatePowerOutletTemplates
20160805100411 CreateDeviceBayTemplates
20160809091611 CreateDeviceBays
20160809103211 CreatePowerOutlets
20160809104325 CreatePowerPorts
20160809112815 CreateConsoleServerPorts
20160809113846 CreateConsolePorts
20160816224805 CreateDeviceModules
20160824212010 AddHostRefToDevices
20160828200938 AddIpAddressToDeviceInterfaces
20160905211522 CreateManagementDevices
20160906205605 RenameFieldInManagementDevices
20160909205537 AddNameIndexToRacks
20160920221011 RemoveIndexFromDevices
20170824122025 AddSideToDevice
20170918202630 AddRacksizeToDevice
20170922110137 CreateComments
20170922174725 RenamingComments
20170924194247 RenameDeviceCommentsColumn
20170929101032 AddParentIdToComments
20171001130802 FixParentIdColumnInComments
20171004221349 AddUserIdToComments
Run `rails db:migrate` to update your database then try again.
10:08:10 [root@foreman01[GM]:/var/lib/foreman] $ foreman-rake db:migrate
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class CreateSites < ActiveRecord::Migration[4.2]
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:525:in `inherited'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman_datacenter-0.1.44/db/migrate/20160727161914_create_sites.rb:1:in `<top (required)>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:962:in `load_migration'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:958:in `migration'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:953:in `disable_ddl_transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1305:in `use_transaction?'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1297:in `ddl_transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `block in migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in `up'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:985:in `migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
Caused by:
StandardError: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for:
class CreateSites < ActiveRecord::Migration[4.2]
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:525:in `inherited'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman_datacenter-0.1.44/db/migrate/20160727161914_create_sites.rb:1:in `<top (required)>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:962:in `load_migration'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:958:in `migration'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:953:in `disable_ddl_transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1305:in `use_transaction?'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1297:in `ddl_transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1229:in `execute_migration_in_transaction'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1201:in `block in migrate_without_lock'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1200:in `migrate_without_lock'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `block in migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1317:in `with_advisory_lock'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1148:in `migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:1007:in `up'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/migration.rb:985:in `migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activerecord-5.1.4/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
This can also be seen on git master with foreman develop.
https://github.com/theforeman/foreman_datacenter/pull/19/commits/f94b8b5712c30a2812fb63609c3d323eb4e1ed57 was needed for me to even start up in development.
https://github.com/theforeman/foreman_datacenter/pull/21 was also needed for me.
OS: Ubuntu 16.04
After restarting apache2: