Bug #15861

audited_changes column is too small

Added by Alejandro Falcon almost 2 years ago. Updated 9 days ago.

Assignee:Amir Fefer
Category:Audit Log
Target version:1.16.0
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:
Pull request:https://github.com/theforeman/foreman/pull/4556


I had an issue this morning when updating a quite long param in foreman:

Data too long for column 'audited_changes' at row 1

A simple fix to this problem was to hack into foreman DB and run "ALTER TABLE audits MODIFY audited_changes MEDIUMTEXT;"


Associated revisions

Revision cf468753
Added by Amir Fefer about 1 year ago

Fixes #15861 - increase size of audited_changes column

In mysql text type is limited to 64K, while in psql
there's no limit. Changeing type to MEDIUMTEXT,
which limited to 16MB, should solve this issue in mysql


#1 Updated by Dominic Cleal almost 2 years ago

  • Category set to Audit Log

The column should be a Rails "text" type, which IIRC is 64k, but the field would probably contain the parameter value and similar info.

#2 Updated by Joe Mader over 1 year ago

I've run into this same scenario. We don't use a "sideband" CM platform for tracking host metadata and thus some of our host-specific parameter values stored in the Foreman DB are rather large.

I was not able to conveniently locate an "admin-facing" tunable which could either turn auditing off or otherwise "filter" what gets audited.

Coincidentally, we resorted to changing the "audited_changes" column type to MEDIUMTEXT as a testing workaround. My concern is that this approach is not quite "future proof" (easily superceded by an upstream rails DB migration). Are there notable objections to making MEDIUMTEXT the new default? Given that there appears to be no fulltext index on this column, Foreman system owners would just need to ensure sufficient filesystem storage.

#3 Updated by Amir Fefer about 1 year ago

  • Assignee set to Amir Fefer

#4 Updated by The Foreman Bot about 1 year ago

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

#5 Updated by Amir Fefer about 1 year ago

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

#6 Updated by Marek Hulán about 1 year ago

  • Legacy Backlogs Release (now unused) set to 240

Also available in: Atom PDF