Bug #11566
closedDatabase Error Salt ENC
Description
I just performed a fresh install of salt and foreman on CentOS7. I followed the guide docs per the foreman install guidelines for my OS choice. I'm trying to use the master_tops system to assign classes to my minions, but the ENC is throwing a Postgres Error. Here's the error code:
@ | Started GET "/salt/node/salt-minion1.wx.noaa.gov?format=yml" for 137.75.232.199 at 2015-08-25 15:12:57 -0400
2015-08-25 15:12:57 [app] [I] Processing by ForemanSalt::MinionsController#node as YML
2015-08-25 15:12:57 [app] [I] Parameters: {"id"=>"salt-minion1.wx.noaa.gov"}
2015-08-25 15:12:57 [app] [W] Failed to generate external nodes for salt-minion1.wx.noaa.gov with PGError: ERROR: column reference "name" is ambiguous
| LINE 1: SELECT name FROM "salt_modules" INNER JOIN "salt_module_envi...
| ^
| : SELECT name FROM "salt_modules" INNER JOIN "salt_module_environments" ON "salt_module_environments"."salt_module_id" = "salt_modules"."id" INNER JOIN "salt_environments" ON "salt_environments"."id" = "salt_module_environments"."salt_environment_id" WHERE "salt_module_environments"."salt_environment_id" = 1 AND "salt_modules"."id" IN (138, 139) ORDER BY salt_modules.name@
Here is my master configuration:
@
autosign_file: /etc/salt/autosign.conf
external_auth:
pam:
saltuser:
- '@runner'
master_tops:
ext_nodes: /usr/bin/foreman-node
file_roots:
base:
- /srv/salt/base/states
its:
- /srv/salt/its/states
dev:
- /srv/salt/dev/states
ext_pillar:
- puppet: /usr/bin/foreman-node
rest_cherrypy:
port: 9191
host: 0.0.0.0
ssl_crt: /var/lib/puppet/ssl/certs/salt-foreman.wx.noaa.gov.pem
ssl_key: /var/lib/puppet/ssl/private_keys/salt-foreman.wx.noaa.gov.pem
@
Here's the foreman.yaml in /etc/salt:
@
---
:proto: https
:host: salt-foreman.wx.noaa.gov
:port: 443
:ssl_ca: "/var/lib/puppet/ssl/ca/ca_crt.pem"
:ssl_cert: "/var/lib/puppet/ssl/certs/salt-foreman.wx.noaa.gov.pem"
:ssl_key: "/var/lib/puppet/ssl/private_keys/salt-foreman.wx.noaa.gov.pem"
:timeout: 10
:salt: /usr/bin/salt
:upload_grains: true
@
Sudoers entry:
#Foreman Configuration for working with Salt
Cmnd_Alias SALT = /usr/bin/salt, /usr/bin/salt-key
foreman-proxy ALL = NOPASSWD: SALT
Defaults:foreman-proxy !requiretty
Finally, the salt.yml in /etc/foreman-proxy/settings.d
@---
: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://localhost:9191
:api_auth: pam
:api_username: saltuser
:api_password: XXXXXXXXXXXX
@
Updated by Charles Burton over 9 years ago
Another interesting point I noticed is that clicking on the ENC button from the Hosts menu works until I actually assign states to machines. If I accept a machine, it shows up as a host that I can use. If I perform any kind of salt configuration on that machine this error happens.
Updated by Charles Burton over 9 years ago
Additional log output:
/var/log/messages:
Aug 25 16:30:17 salt-foreman salt-master: [ERROR ] Command '/usr/bin/foreman-node salt-minion1.wx.noaa.gov' failed with return code: 1
Aug 25 16:30:17 salt-foreman salt-master: [ERROR ] output: Couldn't retrieve ENC data: Error retrieving node salt-minion1.wx.noaa.gov: Net::HTTPNotFound
Aug 25 16:30:17 salt-foreman salt-master: Check Foreman's /var/log/foreman/production.log for more information.
/var/log/salt/master:
2015-08-25 16:30:20,463 [salt.daemons.masterapi][ERROR ]2264 Top function ext_nodes failed with error mapping values are not allowed here
in "<string>", line 1, column 69:
... trieving node dave-test8-centos6: Net::HTTPNotFound
^ for minion dave-test8-centos6
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_salt/pull/48 added
- Pull request deleted (
)
Updated by Stephen Benjamin over 9 years ago
- Status changed from Ready For Testing to Closed
- Assignee set to Tom Caspy
- Pull request added
- Pull request deleted (
https://github.com/theforeman/foreman_salt/pull/48)
Thanks for the report, it's been fixed in foreman_salt 3.0.2, we should have packages up in the repos in a few days (things are being reorganized a bit there, so it might be delayed). In the interim, you can try the small patch in the GitHub PR: https://github.com/theforeman/foreman_salt/pull/48
Updated by Stephen Benjamin over 9 years ago
- Pull request https://github.com/theforeman/foreman_salt/pull/48 added
- Pull request deleted (
)