DCOR-dev / dcor_control

Maintenance tasks and integrity checks for DCOR
GNU General Public License v3.0
0 stars 0 forks source link

Additional meta information for dataset results in Authorization Error during upload #14

Closed B-Hartmann closed 2 years ago

B-Hartmann commented 2 years ago

DCOR-Aid 0.11.8 dclab 0.46.0 upload to dcor-colab

When uploading data via the cli command dcoraid.cli.upload_task, and making sure I have access rights to the respective circle and collections, I get the following error message when uploading data:

The following dir will be uploaded: path\to\my\dataset
path\to\my\dataset\upload_job.dcoraid-task
Initializing.
Dataset ID is XXX-XXX-XXX.
Compressing resources.
Uploading resources.
Traceback (most recent call last):
  File "C:\Users\lab\Documents\BDA\dcor_uploads\venv\lib\site-packages\dcoraid\cli.py", line 77, in upload_task
    uj.task_upload_resources()
  File "C:\Users\lab\Documents\BDA\dcor_uploads\venv\lib\site-packages\dcoraid\upload\job.py", line 424, in task_upload_resources
    srv_time = resource_add(
  File "C:\Users\lab\Documents\BDA\dcor_uploads\venv\lib\site-packages\dcoraid\api\dataset.py", line 241, in resource_add
    api.post("package_revise", revise_dict)
  File "C:\Users\lab\Documents\BDA\dcor_uploads\venv\lib\site-packages\dcoraid\api\ckan_api.py", line 317, in post
    resp = self.handle_response(req, api_call)
  File "C:\Users\lab\Documents\BDA\dcor_uploads\venv\lib\site-packages\dcoraid\api\ckan_api.py", line 137, in handle_response
    raise APIAuthorizationError(msg)
dcoraid.api.errors.APIAuthorizationError: Authorization Error: message: Access denied: Editing not allowed: sp:cells:cell type=blood, sp:cells:fixed=False, sp:cells:frozen=False, sp:cells:live=True, sp:cells:organism=human, sp:cells:pathology=long covid, sp:experiment:buffer osmolality=284.0, sp:experiment:buffer ph=7.4 (for 'package_revise')

The .rtdc files get actually uploaded, but when DCOR or dcoraid try to change the metadata on the server, the error is thrown.

It seems that the additional supplementary resource metadata is the problem. This DCOR instance seems to not accept it. I can also not enter this information in the DCOR-Aid GUI when trying to do a manual upload.

How do we deal with this? Should I just not add supplementary resource metadata (at least when uploading data to the DCOR-colab instance)?

B-Hartmann commented 2 years ago

A more sophisticated solution would be to have a notification that the supplementary metadata is not supported on the given DCOR instance and maybe automatically put them in the "comments" part or the "experimental detail: details" part, where unspecified information could be added in general, I guess and upload anyway.
Or just give a detailed error message and not upload.

paulmueller commented 2 years ago

The error message is misleading. These metadata supplements are probably not defined for DCOR-colab and they should be added. I also have to check whether any of that information got lost during the migration from the DCOR to the DCOR-colab instance.

B-Hartmann commented 2 years ago

Alright! I can see that the older, migrated data still has these metadata supplements, so that should be fine. Just keep me updated about adding the support for these supplements, then I can continue uploading once it's there :)

paulmueller commented 2 years ago

I fixed it and updated dcor_control on DCOR-colab. Could you please check whether it works now?

B-Hartmann commented 2 years ago

It works! Thanks!