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

Closed
cdonadeo opened this issue Jun 30, 2024 · 4 comments
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!

@FrPellissier
Copy link

FrPellissier commented Nov 28, 2024

I had the same problem when upgrading from v1.8.0 to v2.7.0.

Please give us a workaround !

My error is:
Exception has occurred: TypeError
ServerIp.init() missing 2 required positional arguments: 'gateway' and 'ipam_id'

@Laure-di
Copy link
Contributor

Hello,

The issue has been raised to the product team. We apologize for the inconvenience and the delay.

Thank you for reporting this and for your patience.

Laure

@Laure-di
Copy link
Contributor

Laure-di commented Dec 19, 2024

Hello @FrPellissier @cdonadeo,

This bug could occur if an IP was NATed. Now that there is no longer a NAT IP, this problem should no longer occur.

Can you confirm if the bug still exists on your side?

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

4 participants