inveniosoftware / invenio-app-rdm

Turn-key research data management platform.
https://inveniordm.docs.cern.ch
MIT License
100 stars 144 forks source link

Record files endpoint not found #54

Closed zzacharo closed 4 years ago

zzacharo commented 4 years ago

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 commented 4 years ago

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 (https://github.com/inveniosoftware/invenio-app-rdm/pull/61). Feel free to merge.

ppanero commented 4 years ago

https://github.com/inveniosoftware/invenio-app-rdm/pull/64 reopens the issue

ppanero commented 4 years ago

Related to https://github.com/inveniosoftware/invenio-records-permissions/pull/41