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

TypeError on InstanceV1.list_servers #774

Closed
otlet opened this issue Dec 1, 2024 · 2 comments
Closed

TypeError on InstanceV1.list_servers #774

otlet opened this issue Dec 1, 2024 · 2 comments
Assignees
Labels
bug Something isn't working python Pull requests that update Python code

Comments

@otlet
Copy link

otlet commented Dec 1, 2024

Example code:

from os import getenv
from scaleway import Client
from scaleway.instance.v1 import InstanceV1API

access_key = getenv("SCW_ACCESS_KEY", "")
secret_key = getenv("SCW_SECRET_KEY", "")
client = Client(
    access_key=access_key,
    secret_key=secret_key,
)
api = InstanceV1API(client)
response = api.list_servers(zone="pl-waw-2")
print(response)

Error:

Traceback (most recent call last):
  File "/home/otlet/XXX/inventory.debug.py", line 12, in <module>
    response = api.list_servers(zone="pl-waw-2")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/otlet/.local/share/virtualenvs/XXX-XXX/lib/python3.12/site-packages/scaleway/instance/v1/api.py", line 435, in list_servers
    return unmarshal_ListServersResponse(res.json())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/otlet/.local/share/virtualenvs/XXX-XXX/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 2022, in unmarshal_ListServersResponse
    [unmarshal_Server(v) for v in field] if field is not None else None
     ^^^^^^^^^^^^^^^^^^^
  File "/home/otlet/.local/share/virtualenvs/XXX-XXX/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 827, in unmarshal_Server
    {key: unmarshal_VolumeServer(value) for key, value in field.items()}
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/otlet/.local/share/virtualenvs/XXX-XXX/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 715, in unmarshal_VolumeServer
    return VolumeServer(**args)
           ^^^^^^^^^^^^^^^^^^^^
TypeError: VolumeServer.__init__() missing 5 required positional arguments: 'name', 'organization', 'size', 'state', and 'project'

Looks like regress with other issue: #557

SDK Version:

        "scaleway": {
            "hashes": [
                "sha256:006a70416f37f9cd8774859a7508cf14af64bc2cb3209a8cff96ddcf48d14627",
                "sha256:745fbd4114caa47d3c6bc5445b8bec5377a93c776ef9984b8741df6749cf519b"
            ],
            "index": "pypi",
            "version": "==2.7.0"
        },
        "scaleway-async": {
            "hashes": [
                "sha256:59d44806ffc2210abd9298b72171e7064779fe1fc67a47bdf13278e66dd52ac0",
                "sha256:9b2cbd9898b92a60debb888529e3506cd4e63369a9ed469fc95a3a674759bfd5"
            ],
            "index": "pypi",
            "version": "==2.7.0"
        },
        "scaleway-core": {
            "hashes": [
                "sha256:1ff173236ffa77239c75942a184d2774c7575d2dbc1303dbb8459a03cf907879",
                "sha256:897b2570fb4a1ab6e4533121ba61cf2d0557d14bd07f9fda68d803b759ae0f11"
            ],
            "markers": "python_version >= '3.8' and python_version < '4.0'",
            "version": "==2.7.0"
        },

Python 3.12.2

@Laure-di
Copy link
Contributor

Hello,

The issue has been raised to the product team, and a fix should be released at the beginning of January. We apologize for the inconvenience and the delay.

Thank you for reporting this and for your patience.

Laure

@Laure-di
Copy link
Contributor

You can use the master branch to fix the issue; it should be definitively fixed with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

2 participants