Project

General

Profile

Actions

Bug #18130

closed

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

Added by Ohad Levy almost 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DB migrations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 1 (0 open1 closed)

Related to Foreman - Bug #13810: Reports fail to upload, Mysql2::Error: Out of range value for column 'id' (logs table)ClosedTimo Goebel02/19/2016Actions
Actions

Also available in: Atom PDF