Report detail on failure #49

Open
opened 2026-08-20 05:42:09 +00:00 by mih · 0 comments
Owner

I am using collection_read_record_with_pid() in a Python script. I had to debug it, because I got the following error:

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://pool.v0.trr379.de/api/protected/record?pid=trr379%3Asubjects%2Fq01-A0001&format=json

I had to compose the corresponding dtc get-records call to see:

{"detail":"invalid token for collection protected: ForgejoAuthenticationSource failed 
with: invalid token: (401): {\"message\":\"token signature is invalid: crypto/rsa: 
verification error\\naccess token does not exist \\ntoken is unverifiable: error while 
executing keyfunc: unexpected signing method: RS256\\ntask with token \\\"***\\\": resource
does not exist\\nauthorized integration: parse JWT error: token is unverifiable: error 
while executing keyfunc: claim mismatch: claim \\\"workflow\\\" must match glob 
\\\"update-subject-records.yaml\\\", but value \\\"convert-to-tsv.yaml\\\" did not 
match\",\"url\":\"https://hub.trr379.de/api/swagger\"}\n, ForgejoAuthenticationSource 
failed with: invalid token: (401): {\"message\":\"token signature is invalid: crypto/rsa: 
verification error\\naccess token does not exist \\ntoken is unverifiable: error while 
executing keyfunc: unexpected signing method: RS256\\ntask with token \\\"***\\\": resource
does not exist\\nauthorized integration: parse JWT error: token is unverifiable: error 
while executing keyfunc: claim mismatch: claim \\\"workflow\\\" must match glob 
\\\"update-subject-records.yaml\\\", but value \\\"convert-to-tsv.yaml\\\" did not 
match\",\"url\":\"https://hub.trr379.de/api/swagger\"}\n, ConfigAuthenticationSource failed
with: Token not valid for collection `protected`"}

it would be super-helpful to relay this information also via the Python exceptions. It clarifies that the issue is not that the token is not authorized for the protected collection (red herring), but that the token itself is invalid on its own.

I am using `collection_read_record_with_pid()` in a Python script. I had to debug it, because I got the following error: ``` requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://pool.v0.trr379.de/api/protected/record?pid=trr379%3Asubjects%2Fq01-A0001&format=json ``` I had to compose the corresponding `dtc get-records` call to see: ```json {"detail":"invalid token for collection protected: ForgejoAuthenticationSource failed with: invalid token: (401): {\"message\":\"token signature is invalid: crypto/rsa: verification error\\naccess token does not exist \\ntoken is unverifiable: error while executing keyfunc: unexpected signing method: RS256\\ntask with token \\\"***\\\": resource does not exist\\nauthorized integration: parse JWT error: token is unverifiable: error while executing keyfunc: claim mismatch: claim \\\"workflow\\\" must match glob \\\"update-subject-records.yaml\\\", but value \\\"convert-to-tsv.yaml\\\" did not match\",\"url\":\"https://hub.trr379.de/api/swagger\"}\n, ForgejoAuthenticationSource failed with: invalid token: (401): {\"message\":\"token signature is invalid: crypto/rsa: verification error\\naccess token does not exist \\ntoken is unverifiable: error while executing keyfunc: unexpected signing method: RS256\\ntask with token \\\"***\\\": resource does not exist\\nauthorized integration: parse JWT error: token is unverifiable: error while executing keyfunc: claim mismatch: claim \\\"workflow\\\" must match glob \\\"update-subject-records.yaml\\\", but value \\\"convert-to-tsv.yaml\\\" did not match\",\"url\":\"https://hub.trr379.de/api/swagger\"}\n, ConfigAuthenticationSource failed with: Token not valid for collection `protected`"} ``` it would be super-helpful to relay this information also via the Python exceptions. It clarifies that the issue is not that the token is not authorized for the protected collection (red herring), but that the token itself is invalid on its own.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
orinoco/dump-things-pyclient#49
No description provided.