AuScope / ckan-docker

Scripts and images to run CKAN using Docker Compose
0 stars 2 forks source link

Cannot change data from private to public - doi plugin error #232

Closed kitchenprinzessin3880 closed 5 months ago

kitchenprinzessin3880 commented 5 months ago

@NTaherifar @stuartwoodman @vjf

I am including all of you as i am not sure the origin of the error (100%).

Repository - PROD Dataset - https://repository.data.auscope.org.au/dataset/cloncurry-metal-multimodal-integrated-mineral-system-characterisation-data

I cannot change from private to public - Internal error; see logs below:

File "/srv/app/src/ckan/ckan/logic/action/update.py", line 351, in package_update item.after_dataset_update(context, data) File "/srv/app/src/ckanext-doi/ckanext/doi/plugin.py", line 83, in after_dataset_update metadata_dict = build_metadata_dict(pkg_show_dict) File "/srv/app/src/ckanext-doi/ckanext/doi/lib/metadata.py", line 277, in build_metadata_dict min_long, min_lat, max_long, max_lat = pkg_dict.get('bounding_box').split(',') AttributeError: 'NoneType' object has no attribute 'split'

kitchenprinzessin3880 commented 5 months ago

this issue has been resolved by @vjf (can change from private to public) notes: (cause) This code is a victim of the changes in metadata schema over time. It did work at the time it was written, where there was a 'bounding_box', but now the coords are in the 'location_data' field

I tested it with point and bounding box coords and checked the parsing of all the other package data structures and they seem up to be up to date.

kitchenprinzessin3880 commented 5 months ago

related issue - ensure CKANEXTDOITEST_MODE=False in vault for the PROD repository; otherwise DOI will be minted using the test DOI service.

kitchenprinzessin3880 commented 5 months ago

@vjf ref (prod) data : https://repository.data.auscope.org.au/dataset/edit/cloncurry-metal-multimodal-integrated-mineral-system-characterisation-data

when i updated the data above on prod, no doi was minted. the reason is that the prefix (10.82669/) is still refers to the test doi prefix in the database; i manually updated it with prod prefix (see below)

Screenshot 2024-06-17 at 7 21 42 PM

I updated the data, but then I get internal server error. we need to register the dataset with the doi 10.60623/e4z8agwk as the data author already used it in his document. How can we fix it?

Note: I can manually create the doi above at https://doi.datacite.org/repositories/auscope.repo1/dois/new with minimum metadata and then update it via repository UI to get the rest of the metadata sent to datacite. But I am unsure if this is the cleanest/right way to do it - does the doi plugin have other dependencies???

2024-06-17 11:15:28,868 ERROR [ckan.config.middleware.flask_app] Access is denied Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.10/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args) File "/usr/lib/python3.10/site-packages/flask/views.py", line 84, in view return current_app.ensure_sync(self.dispatch_request)(*args, *kwargs) File "/usr/lib/python3.10/site-packages/flask/views.py", line 158, in dispatch_request return current_app.ensure_sync(meth)(args, kwargs) File "/srv/app/src/ckan/ckan/config/middleware/../../views/dataset.py", line 745, in post pkg_dict = get_action(u'package_update')(context, data_dict) File "/srv/app/src/ckan/ckan/logic/init.py", line 551, in wrapped result = _action(context, data_dict, **kw) File "/usr/lib/python3.10/site-packages/ckanext/auscope_theme/logic/action.py", line 72, in package_update return next_action(context, data_dict) File "/srv/app/src/ckan/ckan/logic/action/update.py", line 351, in package_update item.after_dataset_update(context, data) File "/srv/app/src/ckanext-doi/ckanext/doi/plugin.py", line 97, in after_dataset_update client.set_metadata(doi.identifier, xml_dict) File "/srv/app/src/ckanext-doi/ckanext/doi/lib/api.py", line 146, in set_metadata self.client.metadata_post(xml_doc) File "/usr/lib/python3.10/site-packages/datacite/client.py", line 136, in metadata_post raise DataCiteError.factory(resp.status_code, resp.text)