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

Unable to upload record data to InvenioRDM #42

Closed
bootsa opened this issue Feb 3, 2022 · 3 comments
Closed

Unable to upload record data to InvenioRDM #42

bootsa opened this issue Feb 3, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@bootsa
Copy link

bootsa commented Feb 3, 2022

Describe the bug
Posting data to the InvenioRDM API (POST to /api/records) gives a 400 bad request. (https://inveniordm.docs.cern.ch/reference/rest_api_drafts_records/)

On a local instance there is an issue with pushing through a self generated SSL certificate - though the docs say that the local instance should be running in Flask debug mode which disables enforced trusted SSL checks.

On the CERN demo instance the error returned is for a missing referer. If a referer header is given it comes back as Referer checking failed - https://localhost:3000/ does not match any trusted origins.

A missing CSRF (Cross Site Request Forgery) token error is also sometimes given - though that should only apply to fetch requests from a browser - not backend (Python or Node).

No different whether using application tokens creating in InvenioRDM user profile.

Asked in the InvenioRDM discord channel:
https://discord.com/channels/692989811736182844/724974365451747329/938798216877596742

Awaiting response.

@bootsa bootsa added the bug Something isn't working label Feb 3, 2022
@bootsa bootsa self-assigned this Feb 3, 2022
@bootsa
Copy link
Author

bootsa commented Feb 3, 2022

Related to #20

@bootsa
Copy link
Author

bootsa commented Mar 3, 2022

Resolved. I was using the wrong token. Need to use the Personal Access Token.

@bootsa bootsa closed this as completed Mar 3, 2022
@bootsa
Copy link
Author

bootsa commented Mar 16, 2022

For future ref: A bad referer error can be caused by an invalid token (as above). The InvenioRDM test site is sometimes reset - meaning all logins, uploads and personal access tokens are lost. The Referer error is misleading as it's not actually the cause or relevant.

Reported: inveniosoftware/invenio-rest#132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants