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

InstanceV1API list_servers raises an exception for any query because it does not instantiate ServerIp correctly #572

Open
cdonadeo opened this issue Jun 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working priority:highest Bugs filled by customers, security issues

Comments

@cdonadeo
Copy link

  • Python 3.12.4
  • scaleway 2.4.1

Example:

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

client = Client(
  access_key=SCW_ACCESS_KEY_ID,
  secret_key=SCW_SECRET_KEY,
  default_project_id=SCW_PROJECT_ID,
  default_region='fr-par',
  default_zone='fr-par-1',
  default_page_size=100
)

api = InstanceV1API(client)
result = api.list_servers()
print('Got %i results' % len(result))

Result:

$ python example.py
Traceback (most recent call last):
  File "/Users/jcd/Repos/iplistgen/example.py", line 18, in <module>
    result = api.list_servers()
             ^^^^^^^^^^^^^^^^^^
  File "/Users/jcd/Library/Caches/pypoetry/virtualenvs/iplistgen-gpgcOG1k-py3.12/lib/python3.12/site-packages/scaleway/instance/v1/api.py", line 435, in list_servers
    return unmarshal_ListServersResponse(res.json())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcd/Library/Caches/pypoetry/virtualenvs/iplistgen-gpgcOG1k-py3.12/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 2018, in unmarshal_ListServersResponse
    [unmarshal_Server(v) for v in field] if field is not None else None
     ^^^^^^^^^^^^^^^^^^^
  File "/Users/jcd/Library/Caches/pypoetry/virtualenvs/iplistgen-gpgcOG1k-py3.12/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 798, in unmarshal_Server
    args["public_ip"] = unmarshal_ServerIp(field)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jcd/Library/Caches/pypoetry/virtualenvs/iplistgen-gpgcOG1k-py3.12/lib/python3.12/site-packages/scaleway/instance/v1/marshalling.py", line 565, in unmarshal_ServerIp
    return ServerIp(**args)
           ^^^^^^^^^^^^^^^^
TypeError: ServerIp.__init__() missing 2 required positional arguments: 'gateway' and 'ipam_id'
@Codelax Codelax added bug Something isn't working priority:highest Bugs filled by customers, security issues labels Jul 1, 2024
@Laure-di
Copy link
Contributor

Hello,

Could you please provide more information about your issue? To help us better understand, you can add the following code to enable logging:

import logging

logger = logging.getLogger("scaleway")
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
This will generate logs that you can share with us for further analysis.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:highest Bugs filled by customers, security issues
Projects
None yet
Development

No branches or pull requests

3 participants