splunk / splunk-sdk-python

Splunk Software Development Kit for Python
http://dev.splunk.com
Apache License 2.0
687 stars 369 forks source link

Unable to use id/password auth with 7.3 #306

Closed ryanfaircloth closed 4 years ago

ryanfaircloth commented 4 years ago

Running a test matrix against 7.1 7.2 7.3 8.0 with 1.6.12 I am unable to authenticate against 7.3, but am all other versions reverted to .11 to work around

test_1 | self.login() test_1 | else: test_1 | # Try the request anyway without authentication. test_1 | # Most requests will fail. Some will succeed, such as test_1 | # 'GET server/info'. test_1 | with _handle_auth_error("Request aborted: not logged in."): test_1 | return request_fun(self, *args, kwargs) test_1 | try: test_1 | # Issue the request test_1 | return request_fun(self, *args, *kwargs) test_1 | except HTTPError as he: test_1 | if he.status == 401 and self.autologin: test_1 | # Authentication failed. Try logging in, and then test_1 | # rerunning the request. If either step fails, throw test_1 | # an AuthenticationError and give up. test_1 | with _handle_auth_error("Autologin failed."): test_1 | self.login() test_1 | with _handle_auth_error( test_1 | "Autologin succeeded, but there was an auth error on " test_1 | "next request. Something is very wrong."): test_1 | return request_fun(self, args, kwargs) test_1 | elif he.status == 401 and not self.autologin: test_1 | raise AuthenticationError( test_1 | > "Request failed: Session is not logged in.", he) test_1 | E splunklib.binding.AuthenticationError: Request failed: Session is not logged in. test_1 | test_1 | /usr/local/lib/python3.7/site-packages/splunklib/binding.py:304: AuthenticationError test_1 | --------------- generated xml file: /work/test-results/test.xml ---------------- test_1 | =================== 86 failed, 1 skipped in 71.39s (0:01:11) ===================

fantavlik commented 4 years ago

Thanks @rfaircloth-splunk we're looking into this now.

zenmoto commented 4 years ago

Neither @rfaircloth-splunk nor I were able to replicate this behavior with these version combinations, so I'm closing this and we can open a new issue if we can get a better handle on what the problem is.

ryanfaircloth commented 4 years ago

Confirmed this was a timing issue, the most recent Splunk container seems to be restarting during startup a cache issue caused the real problem to go unnoticed