Project

General

Profile

Actions

Bug #15250

closed

No Route Matches error when viewing salt states or environments on 1.12 nightly

Added by Alex Thompson almost 8 years ago. Updated almost 6 years ago.

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

Description

I encountered this error while working on a prototype for a future deployment, this isn't a high priority issue for me, but it looks like a fairly general problem that would need to be fixed in the salt plugin before it is ready for 1.12 .

Host is Ubuntu 16.04, foreman nightly, foreman-salt v 5.0.1.

Steps performed until bug occurred:
  1. Normal Foreman-installer setup, smart proxy setup, provision setup.
  2. Followed docs in foreman-salt manual for 5.0 setup after enabling the nightly repository for plugins.
  3. Set up salt master with some basic environments, added a single simple haproxy class.
  4. Go to salt states page in foreman, click to import from proxy.
  5. Select class, click submit.

Both the environments page and the states page now return similar errors (differing only in the 'search' param):

Oops, we're sorry but something went wrong No route matches {:action=>"index", :controller=>"foreman_salt/hosts", :search=>"salt_state = haproxy"}

Full trace is attached.

Debug at:

http://debugs.theforeman.org/foreman-debug-mGvAX.tar.xz

If you need any more information, or want me to apply/test any patches, I'll try and keep and eye on this issue.


Files

trace.txt trace.txt 17.1 KB Full Trace from web debug Alex Thompson, 05/31/2016 04:58 PM
Actions #1

Updated by Anonymous almost 8 years ago

  • Project changed from Salt to Foreman
  • translation missing: en.field_release set to 136

per IRC: <Dominic> mmoll: it might be a bug in our hash_for_*path monkey patch, since controller should be "hosts" and not prefixed with the engine name foreman_salt/.

Actions #2

Updated by Dominic Cleal almost 8 years ago

  • Category set to Rails
Actions #3

Updated by Dominic Cleal almost 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal
Actions #4

Updated by Dominic Cleal almost 8 years ago

hash_for is no longer returning the :use_route key in the hash on 1.12, which causes some caching ("recall") in actionpack/lib/action_dispatch/routing/route_set.rb to try and prepend foreman_salt/ to the controller name, assuming that "hosts" is relative to the current foreman_salt/environments controller.

1.11 hash_for returns:

=> {:action=>"index", :controller=>"hosts", :use_route=>"hosts", :only_path=>true, :search=>"salt_environment = ..."}

develop:

=> {:controller=>"hosts", :action=>"index", :search=>"salt_environment = ..."}

Edit: not "caching" as I said above, but actually it's the current controller name/prefix that's being prepended to the :controller given in the hash. It's treated as a relative controller name unless use_route is also given.

Actions #5

Updated by The Foreman Bot almost 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3564 added
Actions #6

Updated by Dominic Cleal almost 8 years ago

Thanks for taking the time to test nightlies/1.12 and report this issue, I expect the fix will be in an early 1.12 RC. The one-line patch linked in the pull request can also easily be applied to /usr/share/foreman/config/initializers/routing_hash_for.rb.

Actions #7

Updated by Alex Thompson almost 8 years ago

Thanks for the quick work! Applying the patch on my end does indeed fix the problem.

Actions #8

Updated by Dominic Cleal almost 8 years ago

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

Also available in: Atom PDF