Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wsman KeyError exception with auth.contexts #101

Open
goooroooX opened this issue Mar 22, 2021 · 0 comments
Open

wsman KeyError exception with auth.contexts #101

goooroooX opened this issue Mar 22, 2021 · 0 comments

Comments

@goooroooX
Copy link

Hi!

I have a code that querying some information from Windows server with pypsrp. The code works fine on all tested instances (10+) with one single exception. I have no access to that particular Windows box so troubleshooting is hardly possible.

Here is the log:

2021-02-26 15:37:32,414 ERROR    [48330] [main] Traceback (most recent call last):
  File "/opt/app-root/app/query_xxxxxx.py", line 175, in main
    exch = MainClass(server=server, port=port, username=username, password=password, ssl=ssl, auth=auth, cert_validation=cert_validation, conf=conf)
  File "base.py", line 913, in app.base.MainClass.__init__
  File "base.py", line 977, in app.base.MainClass.check_data
  File "base.py", line 1096, in app.base.MainClass.run_export
  File "/usr/local/lib/python3.6/site-packages/pypsrp/powershell.py", line 205, in __enter__
    self.open()
  File "/usr/local/lib/python3.6/site-packages/pypsrp/powershell.py", line 513, in open
    self.shell.open(options, open_content)
  File "/usr/local/lib/python3.6/site-packages/pypsrp/shell.py", line 204, in open
    option_set=options)
  File "/usr/local/lib/python3.6/site-packages/pypsrp/wsman.py", line 270, in create
    option_set, selector_set, timeout)
  File "/usr/local/lib/python3.6/site-packages/pypsrp/wsman.py", line 389, in invoke
    response = self.transport.send(xml)
  File "/usr/local/lib/python3.6/site-packages/pypsrp/wsman.py", line 734, in send
    elif self.session.auth.contexts[hostname].response_auth_header == 'kerberos':
KeyError: 'server.host.name' 

Some related details:

  • the server.host.name mentioned above is the one I'm connecting to
  • the code is executed from Linux box within docker image
  • KRB5 is properly configured and no authentication issues here, kinit is OK

Can you please take a look on this? Any ideas where to start digging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant