Project

General

Profile

Bug #13810

Reports fail to upload, Mysql2::Error: Out of range value for column 'id' (logs table)

Added by Doug Forster over 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

| ActiveRecord::StatementInvalid: Mysql2::Error: Out of range value for column 'id' at row 1: INSERT INTO `logs` (`created_at`, `level_id`, `message_id`, `report_id`, `source_id`, `updated_at`) VALUES ('2016-02-19 04:48:08', 1, 9, 128052331, 3, '2016-02-19 04:48:08')


Related issues

Related to Foreman - Bug #18130: Fail to import facts and reports - auto increment ID is no longer set on many reports and facts table.Closed2017-01-18
Has duplicate Foreman - Bug #17270: Running out of IDs in logs tableDuplicate2016-11-08
Has duplicate Foreman - Feature #17251: Data type of the id on 'big' tablesDuplicate2016-11-07
Has duplicate Foreman - Bug #17999: Fact values id exceeds mysql maximumDuplicate2017-01-10
Has duplicate Foreman - Bug #20423: Foreman DB logs index out of rangeDuplicate2017-07-26

Associated revisions

Revision bec68fe2 (diff)
Added by Timo Goebel over 5 years ago

fixes #13810 - increase value range for id columns

History

#1 Updated by Doug Forster over 6 years ago

Foreman 1.10.0

#2 Updated by Dominic Cleal over 6 years ago

  • Category set to Database

IIRC the default length is 4 bytes for an integer column, you might be able to alter the schema and widen the logs.id column as a workaround.

#3 Updated by Dominic Cleal over 6 years ago

  • Subject changed from Puppet reports are no longer being processed to Reports fail to upload, Mysql2::Error: Out of range value for column 'id' (logs table)

#4 Updated by Jason Hane over 6 years ago

We just ran into a similar issue. I noticed the ID columns are not unsigned so I altered the tables to make them so. I believe that should be the default. Also at some point since we're purging reports after 90 days we could probably reset the auto increment to 1. Would that cause any issues?

#5 Updated by Dominic Cleal over 6 years ago

Jason, this is just a join table between reports/messages/sources, so they're not going to be referenced anywhere else. I don't know if MySQL will skip IDs that are already in use though if the logs aren't expired exactly in order, but I guess it's probably going to be OK.

#6 Updated by Dominic Cleal over 5 years ago

  • Has duplicate Bug #17270: Running out of IDs in logs table added

#7 Updated by Dominic Cleal over 5 years ago

  • Has duplicate Feature #17251: Data type of the id on 'big' tables added

#8 Updated by Dominic Cleal over 5 years ago

#17251 notes that this applies also to 'reports' and 'fact_values'. The columns could be changed to 64-bit counters (limit: 8).

#9 Updated by Dominic Cleal over 5 years ago

  • Has duplicate Bug #17999: Fact values id exceeds mysql maximum added

#10 Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Timo Goebel
  • Pull request https://github.com/theforeman/foreman/pull/4169 added

#11 Updated by Timo Goebel over 5 years ago

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

#12 Updated by Dominic Cleal over 5 years ago

  • Legacy Backlogs Release (now unused) set to 209

#13 Updated by Ohad Levy over 5 years ago

  • Related to Bug #18130: Fail to import facts and reports - auto increment ID is no longer set on many reports and facts table. added

#14 Updated by Daniel Lobato Garcia almost 5 years ago

  • Has duplicate Bug #20423: Foreman DB logs index out of range added

Also available in: Atom PDF