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

Ensure ModStatus.resources isn't None #330

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

HebaruSan
Copy link
Member

Problem

Instead of working, the Indexer has been spamming errors:

netkan.status.ModStatus.DoesNotExist: Item does not exist

During handling of the above exception, another exception occurred:

  File "/home/netkan/.local/lib/python3.10/site-packages/netkan/indexer.py", line 152, in _process_ckan
    ModStatus(**self.status_attrs(True)).save()

pynamodb.exceptions.AttributeNullError: Attribute 'resources' cannot be None

Cause

The ModStatus.resources pynamodb column both defaults to None and forbids it as a value. Somehow this was tripped after KSP-CKAN/NetKAN#9958 and KSP-CKAN/NetKAN#9960.

Changes

Now the default for this column is dict, which is how pynamodb requires you to say {}.

https://pynamodb.readthedocs.io/en/latest/api.html#pynamodb.attributes.Attribute

@HebaruSan HebaruSan added Bug Something isn't working Status It's about the inflation status (page or db) Indexer Receives inflated modules and adds them to CKAN-meta labels Mar 16, 2024
@HebaruSan HebaruSan merged commit b4660c3 into KSP-CKAN:master Mar 16, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/resources-none branch March 16, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Indexer Receives inflated modules and adds them to CKAN-meta Status It's about the inflation status (page or db)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant