Bug #11405
openorchestration errors no longer appear on host edit / nightly
Description
when editing a host, while a proxy was reporting on a conflict the following was observed in the log, but nothing in the UI
2015-08-18T14:36:12 [app] [I] Failed to save: 2015-08-18T14:36:12 [app] [I] Redirected to https://foreman/hosts/fqdn/edit 2015-08-18T14:36:12 [app] [W] ProxyAPI operation FAILED | ProxyAPI::ProxyException: ERF12-4395 [ProxyAPI::ProxyException]: Unable to retrieve DHCP entry for 10.35.27.10 ([RestClient::BadRequest]: 400 Bad Request) for proxy https://proxy:8443/dhcp | /home/foreman/git/foreman/lib/proxy_api/dhcp.rb:53:in `rescue in record' | /home/foreman/git/foreman/lib/proxy_api/dhcp.rb:43:in `record' | /home/foreman/git/foreman/lib/net/dhcp/record.rb:43:in `conflicts' | /home/foreman/git/foreman/lib/net.rb:24:in `conflicting?'
Updated by Dominic Cleal over 8 years ago
- Category set to Web Interface
I can't tell why this is only recently failing, I suspect some sort of reordering in AJAX requests from the host edit form.
What appears to be happening is that the PUT /host/:id request is made, followed by two GET /tasks/:id requests (in my case) and then the GET /host/:id/edit. The PUT (host#update) adds the message to the flash variable, but because of the two /tasks requests before rendering /host/:id/edit, the contents of flash are empty by the time we render the edit page.
(The contents of flash are only meant to last a single request, so the messages can be displayed on the next page render.)
Updated by Dominic Cleal over 8 years ago
We could call flash.keep
in app controller from a filter where :if => :ajax?
, but this doesn't seem to fully solve it for me. I see the flash contents now getting into the page source, but the notices aren't shown.