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

AttributeError: 'Satellite' object has no attribute '_session' #334

Closed
lhellebr opened this issue Nov 5, 2024 · 0 comments · Fixed by #343
Closed

AttributeError: 'Satellite' object has no attribute '_session' #334

lhellebr opened this issue Nov 5, 2024 · 0 comments · Fixed by #343
Assignees

Comments

@lhellebr
Copy link

lhellebr commented Nov 5, 2024

When running pytest --collect-only, I'm getting this on stderr without any immediately noticeable problem caused by that:

Exception ignored in: <function Host.__del__ at 0x7f01bee44400>
Traceback (most recent call last):
  File "/home/lhellebr/git/robottelo/venv/lib64/python3.12/site-packages/broker/hosts.py", line 77, in __del__
    self.close()
  File "/home/lhellebr/git/robottelo/venv/lib64/python3.12/site-packages/broker/hosts.py", line 147, in close
    if self._session is not None:
       ^^^^^^^^^^^^^
AttributeError: 'Satellite' object has no attribute '_session'

When investigating, I get to

        if self._session is not None:
            self._session.disconnect()
        self._session = None

So it seems like _session is neither a session object nor None. At this point I'm stopping investigation as out of scope of what I'm doing.

$ broker --version | grep 'Broker 0'
                           Broker 0.6.2 
@JacobCallahan JacobCallahan self-assigned this Jan 15, 2025
JacobCallahan added a commit to JacobCallahan/broker that referenced this issue Jan 15, 2025
As identified in SatelliteQE#334, we can get into a state during garbage collection
where a Host instance's _session attribute is missing.
However, the del method calls close, which expects that attribute to be
in place.
In this change, we add a couple of conditions to the del to gate the
close call.

fixes SatelliteQE#334
JacobCallahan added a commit to JacobCallahan/broker that referenced this issue Jan 21, 2025
As identified in SatelliteQE#334, we can get into a state during garbage collection
where a Host instance's _session attribute is missing.
However, the del method calls close, which expects that attribute to be
in place.
In this change, we add a couple of conditions to the del to gate the
close call.

fixes SatelliteQE#334
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

Successfully merging a pull request may close this issue.

2 participants