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

Hang and failure when accessing attributes like Server and Images #304

Closed
maxice8 opened this issue Sep 25, 2023 · 1 comment · Fixed by #305
Closed

Hang and failure when accessing attributes like Server and Images #304

maxice8 opened this issue Sep 25, 2023 · 1 comment · Fixed by #305
Labels
bug Something isn't working confirmed add this to a confirmed bug

Comments

@maxice8
Copy link

maxice8 commented Sep 25, 2023

Bug Report

Current Behavior

Accesing an attribute acquired via client.servers.get_all() or client.images.get_all() hangs

Input Code

>>> from hcloud import Client
>>> c = Client(token="<REDACTED>")
>>> servers = c.servers.get_all()
>>> servers
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/domain.py", line 16, in __repr__
    kwargs = [f"{key}={getattr(self, key)!r}" for key in self.__slots__]  # type: ignore[var-annotated]
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/domain.py", line 16, in <listcomp>
    kwargs = [f"{key}={getattr(self, key)!r}" for key in self.__slots__]  # type: ignore[var-annotated]
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/domain.py", line 16, in __repr__
    kwargs = [f"{key}={getattr(self, key)!r}" for key in self.__slots__]  # type: ignore[var-annotated]
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/domain.py", line 16, in <listcomp>
    kwargs = [f"{key}={getattr(self, key)!r}" for key in self.__slots__]  # type: ignore[var-annotated]
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/domain.py", line 16, in __repr__
    kwargs = [f"{key}={getattr(self, key)!r}" for key in self.__slots__]  # type: ignore[var-annotated]
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/domain.py", line 16, in <listcomp>
    kwargs = [f"{key}={getattr(self, key)!r}" for key in self.__slots__]  # type: ignore[var-annotated]
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/client.py", line 83, in __getattr__
    self.reload()
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/core/client.py", line 90, in reload
    bound_model = self._client.get_by_id(self.data_model.id)
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/servers/client.py", line 468, in get_by_id
    response = self._client.request(url=f"/servers/{id}", method="GET")
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/_client.py", line 228, in request
    self._raise_exception_from_content(content)
  File "/home/howard/Repositories/ocr-server/.venv/lib/python3.10/site-packages/hcloud/_client.py", line 182, in _raise_exception_from_content
    raise APIException(
hcloud._exceptions.APIException: server with ID '36571141' not found

Expected behavior/code

It should not hang, in the case of the REPL it should show something like

[<hcloud.servers.client.BoundServer object at 0x7f5457481ed0>]

Environment

  • Python Version: Python 3.10.13
  • Hcloud-Python Version: 1.29.0
@jooola jooola added bug Something isn't working confirmed add this to a confirmed bug labels Sep 26, 2023
@jooola
Copy link
Member

jooola commented Sep 26, 2023

Thanks for the bug report, should be fixed in 1.29.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed add this to a confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants