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

store_object exception messaging is unclear #90

Closed
doulikecookiedough opened this issue May 22, 2024 · 1 comment
Closed

store_object exception messaging is unclear #90

doulikecookiedough opened this issue May 22, 2024 · 1 comment

Comments

@doulikecookiedough
Copy link
Contributor

doulikecookiedough commented May 22, 2024

When store_object fails, the calling methods log the relevant errors as expected, but when the exception reaches store_object, the actual cause/message is lost (only the exception type is displayed at this time). Even though the appropriate exceptions/errors are logged, this is a bit confusing (and cause misunderstanding).

Revise exception messaging (minimize amount of errors shown via logging levels to reduce confusion?) and ensure store_object shows an appropriate exception message when an object fails to be stored.

Example:

2024-05-21 17:34:59 - ERROR - FileHashStore - _verify_object_information: Hex digest and checksum do not match - file not stored for pid: urn:uuid:018c0136-e22f-4319-b109-140c99afd7c7. Algorithm: md5. Checksum provided: null != HexDigest: 2fc94682032f18f380d042e5f88a517c. Tmp file (/home/mok/testing/knbvm_hashstorecp/objects/tmp/tmpdzxb37pq) deleted.
2024-05-21 17:34:59 - ERROR - FileHashStore - _move_and_get_checksums: Object exists but cannot be verified (validation error): /home/mok/testing/knbvm_hashstorecp/objects/ef/23/eb/20185a54a5dc3e5b5b96d97f158aa5f639b52598cdcc8feaf5df508e15, deleting temporary file. Error: FileHashStore - _verify_object_information: Hex digest and checksum do not match - file not stored for pid: urn:uuid:018c0136-e22f-4319-b109-140c99afd7c7. Algorithm: md5. Checksum provided: null != HexDigest: 2fc94682032f18f380d042e5f88a517c. Tmp file (/home/mok/testing/knbvm_hashstorecp/objects/tmp/tmpdzxb37pq) deleted.
2024-05-21 17:34:59 - ERROR - FileHashStore - store_object: failed to store object for pid: urn:uuid:018c0136-e22f-4319-b109-140c99afd7c7. Unexpected err=ValueError(), type(err)=<class 'ValueError'>
@doulikecookiedough
Copy link
Contributor Author

doulikecookiedough commented May 23, 2024

This has been completed via Feature-90: store_object Exceptions & Logging

Example:

2024-05-22 17:10:49 - ERROR - FileHashStore - store_object: failed to store object for pid: urn:uuid:19aeb87b-ef5e-4f98-996a-0dd02adcad9f. Reference files will not be created or tagged. PidObjectMetadataError: FileHashStore - _move_and_get_checksums: Object already exists for pid: urn:uuid:19aeb87b-ef5e-4f98-996a-0dd02adcad9f , deleting temp file. Reference files will not be created and/or tagged due to an issue with the supplied pid object metadata. FileHashStore - _verify_object_information: Hex digest and checksum do not match - file not stored for pid: urn:uuid:19aeb87b-ef5e-4f98-996a-0dd02adcad9f. Algorithm: sha256. Checksum provided: a553be6d4597e821d886ff63fc5922dd4c56f0be28441f43422675c4bef31f8d != HexDigest: dc08a96bc09f8489605d4a6fd9ff9ccb31f07a67f25682c27ebc92fbdf8cb6e3. Tmp file (/home/mok/testing/knbvm_python/objects/tmp/tmpjcbydo4c) deleted.

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

No branches or pull requests

1 participant