Project

General

Profile

Bug #10343

ActiveRecord::RecordNotSaved creating settings when Rails cache not functional

Added by Dominic Cleal over 6 years ago. Updated about 3 years ago.

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

Description

When using foreman_memcache and it's unconfigured and not functional, then a new setting is added (e.g. installing a new plugin), app startup simply fails with "ActiveRecord::RecordNotSaved".

To reproduce, install foreman_memcache and another plugin which adds settings, then Foreman should fail to start.

Rails.cache.delete returns 'false' when the cache isn't functional. The Setting#clear_cache before_save callback then calls cache.delete, returning the result. This causes the saving of the setting to fail entirely.

Associated revisions

Revision 83bd400c (diff)
Added by Dominic Cleal over 6 years ago

fixes #10343 - only log cache deletion failures when saving settings

Revision 77e5989e (diff)
Added by Dominic Cleal over 6 years ago

fixes #10343 - only log cache deletion failures when saving settings

(cherry picked from commit 83bd400ce6d69c8f946ff5ed31012ab073fcf1b1)

Conflicts:
test/unit/setting_test.rb

History

#1 Updated by Dominic Cleal over 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#2 Updated by The Foreman Bot over 6 years ago

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

#3 Updated by Dominic Cleal over 6 years ago

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

#4 Updated by Dominic Cleal over 6 years ago

  • Legacy Backlogs Release (now unused) set to 50

Also available in: Atom PDF