Bug #18130

Fail to import facts and reports - auto increment ID is no longer set on many reports and facts table.

Added by Ohad Levy about 1 year ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assigned To:Timo Goebel
Category:DB migrations
Target version:-
Difficulty: Bugzilla link:
Found in release:nightly Pull request:https://github.com/theforeman/foreman/pull/4203
Story points-
Velocity based estimate-
Release1.15.0Release relationshipAuto

Description

After bec68fe2c the auto increment for ID column no longer works (at least on MySQL that I'm currently using).
a similar problem is described here: http://stackoverflow.com/questions/10849081/rails-db-migration-resetting-id-column-to-auto-increment

the actual error is:

2017-01-18T12:27:19  [foreman-tasks/action] [E] Mysql2::Error: Field 'id' doesn't have a default value: INSERT INTO `reports` (`host_id`, `reported_at`, `status`, `metrics`, `created_at`, `updated_at`) VALUES (84692, '2017-01-18 07:31:03', 0, '--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nresources: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  changed: 0\n  failed: 0\n  failed_to_restart: 0\n  out_of_sync: 0\n  restarted: 0\n  scheduled: 0\n  skipped: 0\n  total: 41\ntime: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  anchor: 0.0009140340000000001\n  concat_file: 0.000175876\n  concat_fragment: 0.000283758\n  config_retrieval: 1.860927091\n  cron: 0.000317409\n  file: 0.05307191\n  filebucket: 0.000110096\n  package: 0.001641752\n  resources: 0.000131404\n  schedule: 0.000660021\n  service: 0.137300921\n  ssh_authorized_key: 0.000380096\n  total: 2.055914368\nchanges: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  total: 0\nevents: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n  failure: 0\n  success: 0\n  total: 0', '2017-01-18 12:27:19', '2017-01-18 12:27:19') (ActiveRecord::StatementInvalid)
 | /home/foreman/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:120:in `_query'
 | /home/foreman/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:120:in `block in query'
 | /home/foreman/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:119:in `handle_interrupt


Related issues

Related to Foreman - Bug #13810: Reports fail to upload, Mysql2::Error: Out of range value... Closed 02/19/2016

Associated revisions

Revision 0f38d367
Added by Timo Goebel about 1 year ago

fixes #18130 - add autoincrement for bigint id columns

History

#1 Updated by Ohad Levy about 1 year ago

  • Related to Bug #13810: Reports fail to upload, Mysql2::Error: Out of range value for column 'id' (logs table) added

#2 Updated by Ohad Levy about 1 year ago

  • Release set to 1.15.0

#3 Updated by Ohad Levy about 1 year ago

  • Subject changed from auto increment ID is no longer set on many tables to Fail to import facts and reports - auto increment ID is no longer set on many reports and facts table.

#4 Updated by Timo Goebel about 1 year ago

  • Status changed from New to Assigned
  • Assigned To set to Timo Goebel

#5 Updated by The Foreman Bot about 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4203 added

#6 Updated by Timo Goebel about 1 year ago

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

#7 Updated by Dominic Cleal about 1 year ago

  • Category set to DB migrations

Also available in: Atom PDF