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

Record files endpoint not found #54

Closed
zzacharo opened this issue Jan 15, 2020 · 3 comments · Fixed by #61 or inveniosoftware/invenio-records-permissions#41
Closed

Record files endpoint not found #54

zzacharo opened this issue Jan 15, 2020 · 3 comments · Fixed by #61 or inveniosoftware/invenio-records-permissions#41
Assignees

Comments

@zzacharo
Copy link
Member

Following the installation docs and at the part of attaching a file to a record, the record generated is having a link to "files": "https://localhost/api/records/<recid>/files". Following this link the server responds with 404.

Note
Accessing the file directly through api, e.g https://localhost/api/records/<recid>/files/my-image.jpg works as expected.

@ppanero ppanero self-assigned this Feb 3, 2020
@ppanero
Copy link
Member

ppanero commented Feb 4, 2020

The issue comes from invenio-rdm-records config:

RECORDS_FILES_REST_ENDPOINTS = {
    'RECORDS_REST_ENDPOINTS': {
        'recid': '/files',
    }
}

However, the ext.py file is app.config.setdefault(k, getattr(config, k)) which does not set it because it already exists from invenio-records-files.

If we set the above piece of config in invenio-rdm-records it does work.

Note When doing invenio shell on invenio-app-rdm it does not find the mounts /api. For that you need to go around PostFix like app.wsgi_app.app.mounts['/api'].url_map instead of app.wsgi_app.mounts['/api'].url_map

Pinging @fenekku cuz of knowledge/battles fought with config loading.

If this is the way to go there is a PR for it (#61). Feel free to merge.

@ppanero
Copy link
Member

ppanero commented Feb 17, 2020

#64 reopens the issue

@ppanero ppanero reopened this Feb 17, 2020
@ppanero
Copy link
Member

ppanero commented Feb 18, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants