NHMDenmark / DaSSCo-Integration

This Repo will include integration of dassco storage from northtec
0 stars 0 forks source link

Duplicate entry #121

Open Baeist opened 1 month ago

Baeist commented 1 month ago

Just stumbled across this. "ucloud-test-270" shows up twice in the inprogress endpoint. It gives a status 500 back for both get asset and get asset status. { "asset_guid": "ucloud-test-270", "parent_guid": null, "error_timestamp": null, "status": "METADATA_RECEIVED", "error_message": null, "share_allocation_mb": 611 }, { "asset_guid": "ucloud-test-270", "parent_guid": null, "error_timestamp": null, "status": "METADATA_RECEIVED", "error_message": null, "share_allocation_mb": 611 }, { "asset_guid": "thomas-1", "parent_guid": null, "error_timestamp": null, "status": "METADATA_RECEIVED", "error_message": null, "sh

Baeist commented 1 week ago

Today had the asset dev-ucloud.-527_400 do the same thing. I compiled all the info i have on it here:

From asset creation log. First request times out 504, then the request to see if the asset exist is given a 404 (which is fine, just saying the asset doesnt exist). Asset is then attempted created again and this last request receives the response back with the success at the end:

total amount in system: 19437/20000 631 {'asset_pid': 'INSERT_FOR_TESTING_PURPOSES', 'asset_guid': 'dev-ucloud-504_72', 'parent_guid': 'dev-ucloud-504', 'status': 'WORKING_COPY', 'multi_specimen': False, 'specimens': [{'institution': 'NHMD', 'collection': 'Vascular plants', 'barcode': '00937897', 'specimen_pid': '', 'preparation_type': 'sheet'}], 'funding': 'DaSSCo', 'subject': 'specimen', 'payload_type': 'thumbnail', 'file_formats': ['JPEG'], 'asset_locked': False, 'restricted_access': [], 'audited': False, 'date_asset_taken': '2024-04-10T14:09:59+02:00', 'institution': 'NHMD', 'collection': 'Vascular plants', 'pipeline': 'PIPEHERB0001', 'workstation': 'WORKHERB0001', 'digitiser': 'Sara Stenz', 'tags': {'metadataTemplate': 'v2_1_0'}} im alive pid='INSERT_FOR_TESTING_PURPOSES' guid='dev-ucloud-504_72' status='WORKING_COPY' multi_specimen=False specimens=[SpecimenModel(institution='NHMD', collection='Vascular plants', barcode='00937897', pid='', preparation_type='sheet')] funding='DaSSCo' subject='specimen' payload_type='thumbnail' file_formats=['JPEG'] asset_locked=False restricted_access=[] institution='NHMD' collection='Vascular plants' pipeline='PIPEHERB0001' digitiser='Sara Stenz' parent_guid='dev-ucloud-504' audited=False internal_status='METADATA_RECEIVED' tags={'metadataTemplate': 'v2_1_0'} http_info=HTTPInfoModel(path='/assetfiles/NHMD/Vascular plants/dev-ucloud-504_72/', hostname='https://dassco.dk', total_storage_mb=299999, cache_storage_mb=200, remaining_storage_mb=188157, allocated_storage_mb=631, allocation_status_text=None, http_allocation_status='SUCCESS') total amount in system: 18235/20000

1011 {'asset_pid': 'INSERT_FOR_TESTING_PURPOSES', 'asset_guid': 'dev-ucloud-527_400', 'parent_guid': 'dev-ucloud-527', 'status': 'WORKING_COPY', 'multi_specimen': False, 'specimens': [{'institution': 'NHMD', 'collection': 'Vascular plants', 'barcode': '00937897', 'specimen_pid': '', 'preparation_type': 'sheet'}], 'funding': 'DaSSCo', 'subject': 'specimen', 'payload_type': 'image', 'file_formats': ['TIF'], 'asset_locked': False, 'restricted_access': [], 'audited': False, 'date_asset_taken': '2024-04-10T14:09:59+02:00', 'institution': 'NHMD', 'collection': 'Vascular plants', 'pipeline': 'PIPEHERB0001', 'workstation': 'WORKHERB0001', 'digitiser': 'Sara Stenz', 'tags': {'metadataTemplate': 'v2_1_0'}} im alive im alive im alive dev-ucloud-527_400 got time out status: 504 Checking if asset was created.

Failed to create an asset

Api or wrapper fail: API request failed with status code 404: b'{"timestamp":"2024-10-07T11:02:22.121+00:00","status":404,"error":"Not Found","path":"/ars/api/v1/assets/status/dev-ucloud-527_400"}' total amount in system: 19457/20000

Gets a 404 on checking if the asset was created

1011 {'asset_pid': 'INSERT_FOR_TESTING_PURPOSES', 'asset_guid': 'dev-ucloud-527_400', 'parent_guid': 'dev-ucloud-527', 'status': 'WORKING_COPY', 'multi_specimen': False, 'specimens': [{'institution': 'NHMD', 'collection': 'Vascular plants', 'barcode': '00937897', 'specimen_pid': '', 'preparation_type': 'sheet'}], 'funding': 'DaSSCo', 'subject': 'specimen', 'payload_type': 'image', 'file_formats': ['TIF'], 'asset_locked': False, 'restricted_access': [], 'audited': False, 'date_asset_taken': '2024-04-10T14:09:59+02:00', 'institution': 'NHMD', 'collection': 'Vascular plants', 'pipeline': 'PIPEHERB0001', 'workstation': 'WORKHERB0001', 'digitiser': 'Sara Stenz', 'tags': {'metadataTemplate': 'v2_1_0'}} im alive pid='INSERT_FOR_TESTING_PURPOSES' guid='dev-ucloud-527_400' status='WORKING_COPY' multi_specimen=False specimens=[SpecimenModel(institution='NHMD', collection='Vascular plants', barcode='00937897', pid='', preparation_type='sheet')] funding='DaSSCo' subject='specimen' payload_type='image' file_formats=['TIF'] asset_locked=False restricted_access=[] institution='NHMD' collection='Vascular plants' pipeline='PIPEHERB0001' digitiser='Sara Stenz' parent_guid='dev-ucloud-527' audited=False internal_status='METADATA_RECEIVED' tags={'metadataTemplate': 'v2_1_0'} http_info=HTTPInfoModel(path='/assetfiles/NHMD/Vascular plants/dev-ucloud-527_400/', hostname='https://dassco.dk', total_storage_mb=299999, cache_storage_mb=200, remaining_storage_mb=184914, allocated_storage_mb=1011, allocation_status_text=None, http_allocation_status='SUCCESS') total amount in system: 19857/20000 im alive

On retry gets a 200 but then there are 2 entries in db

From postman get in progress assets, get status for assets being worked on:

{
    "asset_guid": "dev-ucloud-527_400",
    "parent_guid": "dev-ucloud-527",
    "error_timestamp": null,
    "status": "METADATA_RECEIVED",
    "error_message": null,
    "share_allocation_mb": 1011
},
{
    "asset_guid": "dev-ucloud-527_400",
    "parent_guid": "dev-ucloud-527",
    "error_timestamp": null,
    "status": "METADATA_RECEIVED",
    "error_message": null,
    "share_allocation_mb": 1011
},
{
    "asset_guid": "dev-ucloud-537_400",
    "parent_guid": "dev-ucloud-537",
    "error_timestamp": null,
    "status": "METADATA_RECEIVED",
    "error_message": null,
    "share_allocation_mb": 1011
},

From our HPC server we get this call telling us the asset was uploaded to ARS:

INFO: 10.42.13.96:0 - "POST /dev/api/v1/derivative_uploaded?asset_guid=dev-ucloud-527_400 HTTP/1.1" 200 OK

Get asset or get asset status calls to postman for the asset results in a status 500 internal server error with no further information.

List available files gives this:

[ "https://dassco.dk/file_proxy/api/assetfiles/NHMD/Vascular plants/dev-ucloud-527_400/parent/dev-ucloud-527.tif" ]

List file info returns empty.

@bhsi-snm

bhsi-snm commented 1 week ago

@Baeist look up in db shared_assets from ars gives

dassco_asset_service=# select * from shared_assets where asset_guid = 'dev-ucloud-527_400'; shared_asset_id | asset_guid | creation_datetime | directory_id -----------------+--------------------+----------------------------+-------------- 5832 | dev-ucloud-527_400 | 2024-10-07 11:01:22.087979 | 5833 5837 | dev-ucloud-527_400 | 2024-10-07 11:02:23.800928 | 5838 (2 rows)

dassco_asset_service=# select from shared_assets; dassco_asset_service=# select from shared_assets; dassco_asset_service=# select * from shared_assets where asset_guid = 'ucloud-test-270'; shared_asset_id | asset_guid | creation_datetime | directory_id -----------------+-----------------+----------------------------+-------------- 974 | ucloud-test-270 | 2024-08-12 12:10:10.927185 | 975 975 | ucloud-test-270 | 2024-08-12 12:10:11.210806 | 976 (2 rows)