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

[BUG] AttributeError: 'GSSError' object has no attribute 'message' #210

Closed
JacobCallahan opened this issue Feb 1, 2024 · 1 comment · Fixed by #213
Closed

[BUG] AttributeError: 'GSSError' object has no attribute 'message' #210

JacobCallahan opened this issue Feb 1, 2024 · 1 comment · Fixed by #213
Assignees
Labels
Milestone

Comments

@JacobCallahan
Copy link

Describe the bug
When an error with the kerberos realm is encountered this library attempts to add an error message to the GSSError's message. However, that message attribute doesn't exist, so an attribute error is raised (See below).

Version-Release number
29.0

To Reproduce
Steps to reproduce the behavior:

  1. Set AUTH_METHOD = "krbv"
  2. Either don't set a KRB_REALM or set an incorrect one
  3. Attempt to run any command that would reach out to a hub
  4. See error

Actual behavior

...
  File "/home/jake/Programming/broker/venvbroker/lib64/python3.12/site-packages/bkr/client/commands/cmd_job_list.py", line 269, in run
    self.hub._login()
  File "/home/jake/Programming/broker/venvbroker/lib64/python3.12/site-packages/bkr/common/hub.py", line 114, in _login
    login_method()
  File "/home/jake/Programming/broker/venvbroker/lib64/python3.12/site-packages/bkr/common/hub.py", line 203, in _login_krbv
    ex.message += ". Make sure you correctly set KRB_REALM (current value: %s)." % realm
    ^^^^^^^^^^
AttributeError: 'GSSError' object has no attribute 'message'

Expected behavior
The expected error message would be correctly added to the GSSError message

Additional context
added an IPython embed inside the except clause to inspect the ex object.

In [1]: ex.MESSAGE
Out[1]: 'Major ({maj_stat}): {maj_str}, Minor ({min_stat}): {min_str}'

In [2]: ex.gen_message()
Out[2]: 'Major (...): Unspecified GSS failure.  Minor code may provide more information, Minor (...): Server HTTP/...@....COM not found in Kerberos database'

In [3]: ex.__dict__
Out[3]: 
{'maj_code': ...,
 'min_code': ...,
 'token': None,
 'calling_code': None,
 'routine_code': ...,
 'supplementary_code': None}

In [4]: dir(ex)
Out[4]: 
['MESSAGE',
 '__cause__',
 ... other dunders ...
 '_parse_major_code',
 'add_note',
 'args',
 'calling_code',
 'gen_message',
 'get_all_statuses',
 'maj_code',
 'min_code',
 'routine_code',
 'supplementary_code',
 'token',
 'with_traceback']
@StykMartin StykMartin self-assigned this Feb 9, 2024
StykMartin added a commit that referenced this issue Feb 9, 2024
Resolves: #210
Signed-off-by: Martin Styk <mart.styk@gmail.com>
@StykMartin StykMartin added this to the 29.Y milestone Feb 9, 2024
StykMartin added a commit that referenced this issue Feb 9, 2024
Resolves: #210
Signed-off-by: Martin Styk <mart.styk@gmail.com>
@StykMartin
Copy link
Contributor

Changeset merged into release-29. This will be released as part of 29.1.

@StykMartin StykMartin linked a pull request Feb 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants