Project

General

Profile

Actions

Bug #25072

closed

Cant modify hosts with foreman_chef plugin installed.

Added by Björn Zettergren about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When i have foreman_chef plugin installed, i can't edit hosts.
This error gets displayed right after that foreman_chef does a select from database, and then the whole transaction is rolled back:


Current location set to none
   (0.3ms)  BEGIN
  User Load (0.5ms)  SELECT  `users`.* FROM `users` WHERE `users`.`id` = 4 ORDER BY firstname LIMIT 1
  Nic::Base Load (1.2ms)  SELECT `nics`.* FROM `nics` WHERE `nics`.`host_id` = 1 ORDER BY `nics`.`identifier` ASC
  Setting Load (0.4ms)  SELECT  `settings`.* FROM `settings` WHERE `settings`.`name` = 'append_domain_name_for_hosts' ORDER BY `settings`.`name` ASC LIMIT 1
  ForemanChef::CachedRunList Load (0.5ms)  SELECT  `foreman_chef_cached_run_lists`.* FROM `foreman_chef_cached_run_lists` WHERE `foreman_chef_cached_run_lists`.`host_id` = 1 LIMIT 1
   (0.3ms)  ROLLBACK
Current location set to none
Current organization set to none
Action failed
 | RuntimeError: Executing dynflow action inside a transaction is not a good idea
 | /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.13.2/app/models/foreman_tasks/concerns/action_triggering.rb:139:in `ensure_not_in_transaction!'
 | /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.13.2/app/models/foreman_tasks/concerns/action_triggering.rb:120:in `dynflow_task_wrap'
 | /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.13.2/app/models/foreman_tasks/concerns/action_triggering.rb:27:in `save'

So, something is not able to handle the result from the query against foreman_chef_cached_run_lists, but i can't figure out what. If i uninstall foreman_chef, the editing works fine.

I've seen similar reports regarding this for older version of foreman_chef also:
https://projects.theforeman.org/issues/19486
https://community.theforeman.org/t/executing-dynflow-action-inside-a-transaction-is-not-a-good-idea/6599

I have a test-setup ready, can test/try anything if I get some pointers :-)

Actions

Also available in: Atom PDF