Hi,
I've tried to setup the salt-api like desribed in the docs as a smart-proxy to foreman.
Sofar, the SmartProxy is running and registered in foreman.
Now I try to import the salt states but I get an error 500
I've no clue what should be wrong or missing after hours of spending time to the different setup doc of salt, salt-api and foreman-proxy
==> /var/log/salt/salt-api.log
Failed to setup thread-interrupt handler. This is usually not critical
[DEBUG ] Error while processing request for: /run
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/saltapi/netapi/rest_cherrypy/app.py", line 292, in hypermedia_handler
ret = cherrypy.serving.request._hypermedia_inner_handler(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/CherryPy-5.0.1-py2.7.egg/cherrypy/_cpdispatch.py", line 60, in __call__
return self.callable(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/saltapi/netapi/rest_cherrypy/app.py", line 1106, in POST
'return': list(self.exec_lowstate()),
File "/usr/local/lib/python2.7/dist-packages/saltapi/netapi/rest_cherrypy/app.py", line 534, in exec_lowstate
ret = self.api.run(chunk)
File "/usr/local/lib/python2.7/dist-packages/saltapi/__init__.py", line 42, in run
ret = l_fun(*f_call.get('args', ()), **f_call.get('kwargs', {}))
File "/usr/local/lib/python2.7/dist-packages/saltapi/__init__.py", line 90, in runner
return runner.low(fun, kwargs)
File "/usr/lib/python2.7/dist-packages/salt/runner.py", line 135, in low
self._verify_fun(fun)
File "/usr/lib/python2.7/dist-packages/salt/runner.py", line 79, in _verify_fun
raise salt.exceptions.CommandExecutionError(err)
CommandExecutionError: Function u'fileserver.envs' is unavailable
[INFO ] 192.168.77.90 - - [18/Feb/2016:16:25:59] "POST /run HTTP/1.1" 500 57 "" "Ruby"
==> /var/log/foreman-proxy/proxy.log <==
E, [2016-02-18T16:25:59.496302 #25977] ERROR -- : Failed to list environments: Failed to query Salt API (500): {"status": 500, "return": "An unexpected error occurred"}
==> /etc/salt/master
external_auth:
pam:
saltuser:
- '@runner'
rest_cherrypy:
port: 9191
host: 0.0.0.0
ssl_key: /var/lib/puppet/ssl/private_keys/vmg-utf-foreman-000.pem
ssl_crt: /var/lib/puppet/ssl/certs/vmg-utf-foreman-000.pem
SSL_ Files exists
User saltuser exists (do it need a special linux group?)
==> /etc/foreman-proxy/settings.d/salt.yml
:enabled: https
:autosign_file: /etc/salt/autosign.conf
:salt_command_user: root
# Some features require using the Salt API - such as listing environments and retrieving state info
:use_api: true
:api_url: https://vmg-utf-salt-master.to3.zone.loc:9191
:api_auth: pam
:api_username: saltuser
:api_password: saltpasswd
==> /etc/salt/master
external_auth:
pam:
saltuser:
- '@runner'
--You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
vmg-utf-saltmaster-000:/# salt-master --version
salt-master 2015.8.7 (Beryllium)
vmg-utf-saltmaster-000:/# salt-api --version
salt-api 0.8.4.1
external_auth:
pam:
saltuser:
- .*
- '@runner'
- '@wheel'
- '@jobs'
rest_cherrypy:
port: 9191
host: 0.0.0.0
ssl_key: /var/lib/puppet/ssl/private_keys/vmg-utf-foreman-000.to3.zone.loc.pem
ssl_crt: /var/lib/puppet/ssl/certs/vmg-utf-foreman-000.to3.zone.loc.pem
:enabled: https
:autosign_file: /etc/salt/autosign.conf
:salt_command_user: root
# Some features require using the Salt API - such as listing environments and retrieving state info
:use_api: true
:api_auth: pam
:api_username: saltuser
:api_password: saltpasswd
vmg-utf-saltmaster-000:/# salt-api -l trace --log-file=/var/log/salt/salt-api.log --log-file-level=trace
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: vmg-utf-saltmaster-000.to3.zone.loc
[TRACE ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found the in the configuration. Not loading the Logstash logging handlers module.
[TRACE ] The required configuration section, 'fluent_handler', was not found the in the configuration. Not loading the fluent logging handlers module.
[DEBUG ] Configuration file path: /etc/salt/master
[DEBUG ] Created pidfile: /var/run/salt-api.pid
[ERROR ] An un-handled exception was caught by salt's global exception handler:
AttributeError: 'module' object has no attribute '_create_loader'
Traceback (most recent call last):
File "/usr/local/bin/salt-api", line 11, in <module>
main()
File "/usr/local/bin/salt-api", line 8, in main
sapi.run()
File "/usr/local/lib/python2.7/dist-packages/saltapi/cli.py", line 67, in run
client.run()
File "/usr/local/lib/python2.7/dist-packages/saltapi/client.py", line 23, in run
netapi = saltapi.loader.netapi(self.opts)
File "/usr/local/lib/python2.7/dist-packages/saltapi/loader.py", line 16, in netapi
load = salt.loader._create_loader(
AttributeError: 'module' object has no attribute '_create_loader'
Traceback (most recent call last):
File "/usr/local/bin/salt-api", line 11, in <module>
main()
File "/usr/local/bin/salt-api", line 8, in main
sapi.run()
File "/usr/local/lib/python2.7/dist-packages/saltapi/cli.py", line 67, in run
client.run()
File "/usr/local/lib/python2.7/dist-packages/saltapi/client.py", line 23, in run
netapi = saltapi.loader.netapi(self.opts)
File "/usr/local/lib/python2.7/dist-packages/saltapi/loader.py", line 16, in netapi
load = salt.loader._create_loader(
AttributeError: 'module' object has no attribute '_create_loader'
curl -L https://bootstrap.saltstack.com -o install_salt.sh
sudo sh install_salt.sh -P -MSounds like a bootstrap bug. Please file an issue in that repository.
In the meantime `apt-get install salt-api` should do the trick.
It's a tad confusing since the pip command of the same name is incorrect. It's because the Debian packages are split apart when they're created, whereas the correct PyPI install is just plain 'salt'.
--