Undefined method `join' for #<String>, receiving salt states from smartproxy

> From: "Tom K." <tn@to3.de>
> To: "Foreman users" <foreman-users@googlegroups.com>
> Sent: Wednesday, July 27, 2016 10:17:12 AM
> Subject: [foreman-users] undefined method join&#39; for #&lt;String&gt;, receiving salt states from smartproxy &gt; &gt; Hi, &gt; &gt; I&#39;ve a running Foreman 1.11.3 and a Smartyproxy 1.11.3 on 2 different &gt; machines. The Smartproxy serves the salt-api/saltmaster. Now, if I query &gt; from Foreman the states of the Saltmaster SmartyProxy, nothing happens. &gt; &gt; Sometimes a popup appears with the message &gt; &gt; Error: ERF12-4701 [ProxyAPI::ProxyException]: Unable to fetch Salt states &gt; list ([ProxyAPI::ProxyException]: ERF12-7301 [ProxyAPI::ProxyException]: &gt; Unable to fetch Salt environments list ([RestCli...) for proxy &gt; https:/fosp-saltmaster-001:8443/salt/ &gt; &gt; &gt; In the *forman-proxy.log* on the smartproxy tells me &gt; &gt; E, [2016-07-27T10:05:26.163632 #2422] ERROR -- : undefined methodjoin'
> for #<String:0x007f81e43cbd70> (NoMethodError)
> /usr/share/gems/gems/sinatra-1.3.5/lib/sinatra/showexceptions.rb:37:in
> rescue in call&#39; &gt; /usr/share/gems/gems/sinatra-1.3.5/lib/sinatra/showexceptions.rb:21:in &gt;call'
> /usr/share/gems/gems/sinatra-1.3.5/lib/sinatra/base.rb:124:in call&#39; &gt; /usr/share/gems/gems/sinatra-1.3.5/lib/sinatra/base.rb:1417:inblock in
> call'
> /usr/share/gems/gems/sinatra-1.3.5/lib/sinatra/base.rb:1499:in synchronize&#39; &gt; /usr/share/gems/gems/sinatra-1.3.5/lib/sinatra/base.rb:1417:incall'
> /usr/share/gems/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in block in call&#39; &gt; /usr/share/gems/gems/rack-1.6.4/lib/rack/urlmap.rb:50:ineach'
> /usr/share/gems/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in call&#39; &gt; /usr/share/gems/gems/rack-1.6.4/lib/rack/builder.rb:153:incall'
> /usr/share/gems/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in service&#39; &gt; /usr/share/ruby/webrick/httpserver.rb:138:inservice'
> /usr/share/ruby/webrick/httpserver.rb:94:in run&#39; &gt; /usr/share/ruby/webrick/server.rb:295:inblock in start_thread'
>
>
>
> The /var/log/foreman/production.log throws
>
> 2016-07-27 10:10:48 [app] [W] ProxyAPI operation FAILED
> > ProxyAPI::ProxyException: ERF12-4701 [ProxyAPI::ProxyException]: Unable
> to fetch Salt states list ([ProxyAPI::ProxyException]: ERF12-7301
> [ProxyAPI::ProxyException]: Unable to fetch Salt environments list
> ([RestCli…) for proxy https:/fosp-saltmaster-001:8443/salt/
> >
> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-5.0.1/app/lib/proxy_api/salt.rb:43:in
> rescue in states_list&#39; &gt; &gt; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-5.0.1/app/lib/proxy_api/salt.rb:35:in &gt;states_list'
> >
> /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-5.0.1/app/controllers/foreman_salt/state_importer.rb:16:in
> fetch_states_from_proxy&#39; &gt; &gt; &gt; /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_salt-5.0.1/app/controllers/foreman_salt/salt_modules_controller.rb:60:in &gt;import'
> >
> /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/implicit_render.rb:4:in
> send_action&#39; &gt; &gt; &gt; /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/base.rb:189:in &gt;process_action'
> >
> /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/action_controller/metal/rendering.rb:10:in
> process_action&#39; &gt; &gt; &gt; /opt/rh/rh-ror41/root/usr/share/gems/gems/actionpack-4.1.5/lib/abstract_controller/callbacks.rb:20:in &gt;block in process_action'
> >
> /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in
> call&#39; &gt; &gt; &gt; /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in &gt;call'
> >
> /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in
> block in halting_and_conditional&#39; &gt; &gt; &gt; /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in &gt;call'
> >
> /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in
> block in halting_and_conditional&#39; &gt; &gt; &gt; /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in &gt;call'
> >
> /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in
> block in halting_and_conditional&#39; &gt; &gt; &gt; /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:149:in &gt;call'
>
>
>
>
> What's my problem? What can I do… I've really no idea…

Fetching the salt environment or salt states list requires the proxy be configured to talk to the salt-api. See section 2.1.3
in the latest manual: Foreman :: Plugin documentation index

Troubleshooting steps:
- Look in /var/log/foreman-proxy/proxy.log, and /var/log/salt/* for any errors.
- Does the API user have the @runner permission in /etc/salt/master?
- Is the salt-api service started?
- Is /etc/foreman-proxy/settings.d/salt.yml configured to connect to the right place?

From ERF12-4701 - Foreman.

  • Stephen
··· ----- Original Message -----

Thanks,

Tom


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.