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

list_images: sbs_snapshot volume unmarshalling error #928

Open
Timost opened this issue Mar 24, 2025 · 1 comment
Open

list_images: sbs_snapshot volume unmarshalling error #928

Timost opened this issue Mar 24, 2025 · 1 comment
Assignees

Comments

@Timost
Copy link

Timost commented Mar 24, 2025

Hi,

First of all thank you for the sdk. 🙏

This is issue is very similar to: #636

It would seem that when the extra_volume is of type sbs_snapshots some data is missing from the API response.

This is the API response I get

{'arch': 'x86_64',
 'creation_date': '<redacted>'
 'default_bootscript': None,
 'extra_volumes': {'1': {'id': '<redacted>',
                         'name': '',
                         'size': 0,
                         'volume_type': 'sbs_snapshot'}},
 'from_server': '<redacted>',
 'id': '<redacted>',
 'modification_date': '<redacted>',
 'name': '<redacted>',
 'organization': '<redacted>',
 'project': '<redacted>',
 'public': False,
 'root_volume': {'id': '<redacted>',
                 'name': '<redacted>',
                 'size': 20000000000,
                 'volume_type': 'l_ssd'},
 'state': 'available',
 'tags': [],
 'zone': 'fr-par-1'}

It seems the Python code at https://github.com/scaleway/scaleway-sdk-python/blob/main/scaleway/scaleway/instance/v1/marshalling.py#L263 is expecting tags, project etc. for the extra_volumes field which are missing from the response.

The results is the following Exception:

lib/python3.11/site-packages/scaleway/instance/v1/marshalling.py", line 335, in unmarshal_Volume
    return Volume(**args)
           ^^^^^^^^^^^^^^
TypeError: Volume.__init__() missing 5 required positional arguments: 'organization', 'project', 'tags', 'state', and 'zone'

Maybe unmarshal_VolumeSummary should be used instead when the extra volume is of type sbs_snapshot ?

Could you please take a look ? This is preventing me from managing my backups properly. Thank you 🙏

@Timost
Copy link
Author

Timost commented Mar 24, 2025

For now, I'm monkey patching the unmarshal_Image method with a custom one that uses unmarshal_VolumeSummary for sbs_snapshot volumes

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

No branches or pull requests

2 participants