ietf-tools / bibxml-service

Django-based Web service implementing IETF BibXML APIs
https://bib.ietf.org
BSD 3-Clause "New" or "Revised" License
17 stars 19 forks source link

Validation error with keywords #390

Closed kesara closed 10 months ago

kesara commented 11 months ago

Describe the issue

Recent changes introduce errors with keywords. For example RFC 9000:

Could not export this item, the error was: Source data for item RFC 9000 (IETF) didn’t validate (err: 11 validation errors for BibliographicItem keyword -> 0 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 1 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 2 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 3 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 4 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 5 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 6 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 7 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 8 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword -> 9 instance of KeywordType, tuple or dict expected (type=type_error.dataclass; class_name=KeywordType) keyword KeywordType.__init__() takes from 1 to 2 positional arguments but 11 were given (type=type_error))

Code of Conduct

kesara commented 11 months ago

I've rolled back bibxml.ietf.org to v2023.11.3_1.

kesara commented 11 months ago

@stefanomunarini I think keyword changes in https://github.com/ietf-tools/bibxml-service/pull/348 are causing this issue.

stefanomunarini commented 10 months ago

Hi @kesara , did this issue arise after re indexation of the sources? I am trying to understand how to replicate the issue on my local machine, but seem unable to do so. Thanks

kesara commented 10 months ago

@stefanomunarini I think this was before the reindexing. And rolling back the change fixed the issue without having to reindex.

stefanomunarini commented 10 months ago

I think this is the issue @kesara , source data needs to be reindexed for that code to work. Let me confirm this, I am testing to see if I can replicate the issue.

In case, is there a day/time that this update could be released with the least disruption? Indexation of sources takes some time (not sure how long it does in production, as I do not have access to the management GUI, but on my local machine is about 1 hour for all the sources)

stefanomunarini commented 10 months ago

I can confirm I was able to replicate the issue rolling back to an old commit. Rebuilding the service with the upgraded relaton-py and re indexing the sources fixed the issue.

Please note: It might take a few minutes for the changes to appear in the GUI after reindexing due to caching.

kesara commented 10 months ago

@stefanomunarini Thanks for looking at it. Should I wait for #393?

stefanomunarini commented 10 months ago

Hi @kesara . No #393 should also be merged after upgrading relaton version (it simply list the keywords values, instead of a dictionary of the format {"content": "value"}) in the citation details page.

kesara commented 10 months ago

Fixed with the reindexing.