{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/27138","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/27138/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/27138/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/27138/events","html_url":"https://github.com/saltstack/salt/issues/27138","id":106589689,"number":27138,"title":"Exception occurred while authenticating: 'dict' object has no attribute 'endswith' with external_auth: ldap","user":{"login":"maschinetheist","id":11669303,"avatar_url":"https://avatars0.githubusercontent.com/u/11669303?v=4","gravatar_id":"","url":"https://api.github.com/users/maschinetheist","html_url":"https://github.com/maschinetheist","followers_url":"https://api.github.com/users/maschinetheist/followers","following_url":"https://api.github.com/users/maschinetheist/following{/other_user}","gists_url":"https://api.github.com/users/maschinetheist/gists{/gist_id}","starred_url":"https://api.github.com/users/maschinetheist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maschinetheist/subscriptions","organizations_url":"https://api.github.com/users/maschinetheist/orgs","repos_url":"https://api.github.com/users/maschinetheist/repos","events_url":"https://api.github.com/users/maschinetheist/events{/privacy}","received_events_url":"https://api.github.com/users/maschinetheist/received_events","type":"User","site_admin":false},"labels":[{"id":41387723,"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":67287385,"url":"https://api.github.com/repos/saltstack/salt/labels/Core","name":"Core","color":"fef2c0","default":false},{"id":41388135,"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143","default":false},{"id":194766302,"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestone/13","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars0.githubusercontent.com/u/507599?v=4","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2471,"closed_issues":6900,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2018-03-31T01:19:14Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-09-15T16:06:06Z","updated_at":"2018-04-01T07:28:05Z","closed_at":null,"author_association":"NONE","body":"Hello,\n\nI'm getting the following exception when trying to do external_auth: ldap with LDAP (FreeIPA 3.x to be more precise):\n\nOutput of salt-master -l all\n\n```\nResults of YAML rendering:\n{}\n[TRACE   ] AES payload received with command _mine\n[TRACE   ] Master function call _mine took 0.00154590606689 seconds\n[INFO    ] Clear payload received with command publish\n[DEBUG   ] Attempting LDAP bind with user dn: uid=joeschmoe,cn=users,cn=accounts,dc=company,dc=com\n[DEBUG   ] Successfully authenticated user dn via LDAP: uid=joeschmoe,cn=users,cn=accounts,dc=company,dc=com\n[DEBUG   ] ldap bind to determine group membership succeeded!\n[ERROR   ] Exception occurred while authenticating: 'dict' object has no attribute 'endswith'\n```\n\nI get this after running:\n\n```\nsalt -a ldap 'hostname' test.ping\nFailed to authenticate! This is most likely because this user is not permitted to execute commands, but there is a small possibility that a disk error occurred (check disk/inode usage).\n```\n\nClearly the auth portion works but it just chokes on something afterwards and I'm not sure what.  I figure it does this when trying to gather groups that my user is part of.\n\n/etc/salt/master snippet:\n\n``` yaml\nexternal_auth:\n  ldap:\n    - sysadmins%:\n      - .*\n\nauth.ldap.server: localhost\nauth.ldap.port: 389\nauth.ldap.tls: False\nauth.ldap.scope: 3\nauth.ldap.uri: ''\nauth.ldap.no_verify: False\nauth.ldap.anonymous: False\nauth.ldap.groupou: 'groups'\nauth.ldap.groupclass: 'posixgroup'\nauth.ldap.accountattributename: 'member'\nauth.ldap.basedn: dc=company,dc=com\nauth.ldap.binddn: uid={{ username }},cn=users,cn=accounts,dc=company,dc=com\nauth.ldap.filter: uid={{ username }}\n```\n\nVersions report:\n\n``` yaml\n           Salt: 2015.5.3\n         Python: 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)\n         Jinja2: 2.2.1\n       M2Crypto: 0.20.2\n msgpack-python: 0.4.6\n   msgpack-pure: Not Installed\n       pycrypto: 2.0.1\n        libnacl: Not Installed\n         PyYAML: 3.10\n          ioflo: Not Installed\n          PyZMQ: 14.3.1\n           RAET: Not Installed\n            ZMQ: 3.2.4\n           Mako: Not Installed\n        Tornado: Not Installed\n```\n\nSalt-master is running as 'salt' user.\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/377768587","html_url":"https://github.com/saltstack/salt/issues/27138#issuecomment-377768587","issue_url":"https://api.github.com/repos/saltstack/salt/issues/27138","id":377768587,"user":{"login":"thatsk","id":15324013,"avatar_url":"https://avatars3.githubusercontent.com/u/15324013?v=4","gravatar_id":"","url":"https://api.github.com/users/thatsk","html_url":"https://github.com/thatsk","followers_url":"https://api.github.com/users/thatsk/followers","following_url":"https://api.github.com/users/thatsk/following{/other_user}","gists_url":"https://api.github.com/users/thatsk/gists{/gist_id}","starred_url":"https://api.github.com/users/thatsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatsk/subscriptions","organizations_url":"https://api.github.com/users/thatsk/orgs","repos_url":"https://api.github.com/users/thatsk/repos","events_url":"https://api.github.com/users/thatsk/events{/privacy}","received_events_url":"https://api.github.com/users/thatsk/received_events","type":"User","site_admin":false},"created_at":"2018-04-01T07:28:05Z","updated_at":"2018-04-01T07:28:05Z","author_association":"NONE","body":"Getting this error.\r\n2018-04-01 07:23:52,728 [salt.loaded.int.auth.ldap][DEBUG   ][18985] ldap bind to determine group membership succeeded!\r\n2018-04-01 07:23:52,729 [salt.master      ][ERROR   ][18985] Exception occurred while authenticating: 'dict' object has no attribute 'endswith'\r\n2018-04-01 07:23:52,731 [salt.master      ][ERROR   ][18985] ['Traceback (most recent call last):\\n', '  File \"/usr/lib/python2.7/site-packages/salt/master.py\", line 2070, in publish\\n    group_perm_keys = [item for item in self.opts[\\'external_auth\\'][extra[\\'eauth\\']] if item.endswith(\\'%\\')]  # The configured auth groups\\n', \"AttributeError: 'dict' object has no attribute 'endswith'\\n\"]\r\ntest@inslt01p1.infra.smf1.mobitv: ~$ salt -a ldap 'svcar01p1.ci-cp.dev.smf1.mobitv' test.ping\r\nusername: test\r\npassword:\r\nFailed to authenticate! This is most likely because this user is not permitted to execute commands, but there is a small possibility that a disk error occurred (check disk/inode usage).\r\n"}}
{"actor":{"display_login":"thatsk"}}