Bug #17451
closedCannot select Salt States in Discovery or New Host menu
Description
This is after an incremental upgrade from 1.10.2 - > 1.13.1
Import of Salt states works.
Modifying salt states for a host group or existing host works.
Steps:.
Host tab, selecting salt environment
Switching to salt states has message: "Please select a Salt environment first"
Debugging in browser:
uncaught ReferenceError: foreman is not defined
at update_salt_states (http://tfm.pdtpartners.com/assets/foreman_salt/states-1175ee48b5af27d8f8078e4af17aa6bb1aadcadfee9ab79725a15bbb5579be1f.js:1:267)
at HTMLSelectElement.onchange (http://tfm.pdtpartners.com/hosts/new:451:344)
at Object.trigger (http://tfm.pdtpartners.com/webpack/bundle-d65c367369a195962269.js:25:1450)
at HTMLSelectElement.<anonymous> (http://tfm.pdtpartners.com/webpack/bundle-d65c367369a195962269.js:25:9292)
at Function.each (http://tfm.pdtpartners.com/webpack/bundle-d65c367369a195962269.js:14:14167)
Updated by Anonymous about 8 years ago
- Category set to Foreman Integration
- Project changed from Foreman to Salt
Updated by The Foreman Bot about 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Anonymous
- Pull request https://github.com/theforeman/foreman_salt/pull/66 added
Updated by Anonymous about 8 years ago
- Assignee deleted (
Anonymous)
Joe, could you test that? As the JS is precompiled in the package, that might be hard to do in an RPM environment...
Updated by Joe Collette about 8 years ago
Michael Moll wrote:
Joe, could you test that? As the JS is precompiled in the package, that might be hard to do in an RPM environment...
Is there an easy way to compile that? Updating the files and compiled .js file manually doesn't seem to work. I can still see foreman.tools in the web debugger.
Files:
/var/lib/foreman/public/assets/foreman_salt/states-1175ee48b5af27d8f8078e4af17aa6bb1aadcadfee9ab79725a15bbb5579be1f.js
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-7.0.1/app/assets/javascripts/foreman_salt/states.js
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-7.0.1/public/assets/foreman_salt/states-1175ee48b5af27d8f8078e4af17aa6bb1aadcadfee9ab79725a15bbb5579be1f.js
Updated by Joe Collette about 8 years ago
Joe Collette wrote:
Michael Moll wrote:
Joe, could you test that? As the JS is precompiled in the package, that might be hard to do in an RPM environment...
Is there an easy way to compile that? Updating the files and compiled .js file manually doesn't seem to work. I can still see foreman.tools in the web debugger.
Files:
/var/lib/foreman/public/assets/foreman_salt/states-1175ee48b5af27d8f8078e4af17aa6bb1aadcadfee9ab79725a15bbb5579be1f.js
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-7.0.1/app/assets/javascripts/foreman_salt/states.js
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-7.0.1/public/assets/foreman_salt/states-1175ee48b5af27d8f8078e4af17aa6bb1aadcadfee9ab79725a15bbb5579be1f.js
Had to remove the .gz files in the dir and then recreate them.
New web error:
bundle-d65c367….js:26 PUT http://tfm.pdtpartners.com/salt/minions/salt_environment_selected 500 (Internal Server Error)send @ bundle-d65c367….js:26ajax @ bundle-d65c367….js:26update_salt_states @ states-1175ee4….js:1onchange @ new:1trigger @ bundle-d65c367….js:25(anonymous function) @ bundle-d65c367….js:25each @ bundle-d65c367….js:14each @ bundle-d65c367….js:14trigger @ bundle-d65c367….js:25triggerChange @ bundle-d65c367….js:60onSelect @ bundle-d65c367….js:60selectHighlighted @ bundle-d65c367….js:60(anonymous function) @ bundle-d65c367….js:60(anonymous function) @ bundle-d65c367….js:59dispatch @ bundle-d65c367….js:25m.handle @ bundle-d65c367….js:24 ... ...
Production log:
2016-11-22 23:13:33 fab5bed8 [app] [W] Action failed | ActiveModel::ForbiddenAttributesError: ActiveModel::ForbiddenAttributesError | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/forbidden_attributes_protection.rb:21:in `sanitize_for_mass_assignment' | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/attribute_assignment.rb:33:in `assign_attributes' | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/core.rb:566:in `init_attributes' | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/core.rb:281:in `initialize' | /usr/share/foreman/app/models/host/base.rb:70:in `initialize' | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/url_for.rb:104:in `initialize' | /usr/share/foreman/app/models/host/managed.rb:49:in `initialize' | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/inheritance.rb:61:in `new' | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/inheritance.rb:61:in `new' | /usr/share/foreman/app/models/concerns/foreman/sti.rb:22:in `new_with_cast'
...
...
Updated by Anonymous about 8 years ago
- Related to Bug #15958: Move to using strong parameters added
Updated by Anonymous about 8 years ago
The Pull Request got updated, could anybody test? For a quick test, without editing/precompiling the JS file, one can just assign the object in the JS console of the browser after going to "Edit Host" with "foreman=tfm" and then test in the same tab.
Updated by Joe Collette about 8 years ago
Michael Moll wrote:
The Pull Request got updated, could anybody test? For a quick test, without editing/precompiling the JS file, one can just assign the object in the JS console of the browser after going to "Edit Host" with "foreman=tfm" and then test in the same tab.
Just tested and it is working!
Updated by Anonymous about 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_salt|d07aeca61a777b83e4c10eb6a83fd496a94fc3f6.