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

pycsw_dist update is failing #236

Closed
mortenwh opened this issue Oct 4, 2024 · 3 comments · Fixed by #249
Closed

pycsw_dist update is failing #236

mortenwh opened this issue Oct 4, 2024 · 3 comments · Fixed by #249
Assignees

Comments

@mortenwh
Copy link
Collaborator

mortenwh commented Oct 4, 2024

The recurring issue with pycsw returning Record serialization failed: Start tag expected, \'<\' not found, line 1, column 1 (<string>, line 1) is caused by the update command in dmci.

We need to check the update functionality and see if we can change something in DMCI or if it is really a problem in pycsw.

@magnarem
Copy link
Contributor

magnarem commented Oct 4, 2024

It could be that something fails in the csw_dist.
Its very hacky and complex with usage of the requests-module to do this requests to csw.

Would it not be a much better approach to actually use the owslib.csw for doing inserting and updating after the incoming mmd is translated to iso?

The owslibalso probably give back more sane error messages etc. And it have more control over transactions against csw etc.

@mortenwh
Copy link
Collaborator Author

mortenwh commented Oct 7, 2024

I have thought a bit about this, and I am pretty sure that the pycsw update method only takes in the changes, not the entire xml file when making updates. This is a bit challenging to encode, so the easiest solution is probably to just delete and reinsert the dataset. Note that with #239, we should force the deletion to avoid just changing the MMD file.

@magnarem
Copy link
Contributor

magnarem commented Oct 7, 2024

Ok. That probably makes sense, also when I look at the owslib.csw docs ( https://owslib.readthedocs.io/en/latest/usage.html#csw), there is no exaple, of using update and update the whole xml. Just change values of the fields.
So then the solution is probably to modify the update function in pycsw_dist so that it will have to first call the delete function and then the insert function in pycsw_dist for the update functionality to work correctly for pycsw_dist.

@mortenwh mortenwh self-assigned this Nov 11, 2024
@mortenwh mortenwh mentioned this issue Nov 12, 2024
10 tasks
mortenwh added a commit that referenced this issue Nov 12, 2024
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

Successfully merging a pull request may close this issue.

2 participants