Bug #27185
closed
Reset changed? state after saving with DirtyAssociations
Added by Swetha Seelam Lakshmi Narayanan over 5 years ago.
Updated over 5 years ago.
Description
Getting an error while registering a host using activation key with system purpose attributes. Even though there is an error, the host gets registered with the activation key successfully.
Steps to reproduce the bug:
1. Create an activation key with system purpose attributes.
2. Register a host using this activation key with the following command.
subscription-manager register --org "Default_Organization" --activationkey "keyname"
3. Getting the following error -
HTTP error (500 - Internal Server Error): Required lock is already taken by other running tasks.
Please inspect their state, fix their errors and resume them.
Required lock: update
Conflicts with tasks:
- http://centos7-katello-devel.swetha.example.com/foreman_tasks/tasks/0f9577a7-4e2d-469b-955f-60891182262b
- Project changed from Katello to Foreman
- Category changed from API to API
- Subject changed from Can't register a system using activation key with system purpose. to Reset changed? state after saving with DirtyAssociations
This bug was originally written in the context of Activation Keys in Katello but we found that the underlying issue was the fact that <relation>_changed? continued to return true even after saving the model object. This caused a lot of extra saves for us in Katello. By making DirtyAssociations behave more like ActiveModel::Dirty we can avoid the problem and have the expected behavior
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6881 added
- Pull request https://github.com/theforeman/foreman/pull/6947 added
- Fixed in Releases 1.24.0 added
- Status changed from Ready For Testing to Closed
- Pull request deleted (
https://github.com/theforeman/foreman/pull/6947)
- Related to Bug #25602: audit failures with Rails 5.2.2 added
- Related to deleted (Bug #25602: audit failures with Rails 5.2.2)
Also available in: Atom
PDF