You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Exploring the wallet-api, I have stumbled upon a few unhandled exceptions leading to 500 Internal Server Errors. In this case they were all tied to primary key constraint errors in the DB, so I would guess that they're likely applicable to other persistence back-ends as well.
Specifically they have occurred in the following cases:
Create an account if the account ID (email) already exists. ({"exception":true,"status":"Internal Server Error","code":"500","message":"Could not register user: Account already exists!"})
Create a DID (Web) if the DID already exists. ({"exception": true, "status": "Internal Server Error", "code": "500", "message": "org.sqlite.SQLiteException: [SQLITE_CONSTRAINT_PRIMARYKEY] A PRIMARY KEY constraint failed (UNIQUE constraint failed: wallet_dids.wallet, wallet_dids.did)"})
Import a key (JWK) if the key ID (auto-generated) already exists. ({"exception":true,"status":"Internal Server Error","code":"500","message":"org.sqlite.SQLiteException: [SQLITE_CONSTRAINT_PRIMARYKEY] A PRIMARY KEY constraint failed (UNIQUE constraint failed: wallet_keys.wallet, wallet_keys.kid)"})
To Reproduce
Steps to reproduce the behaviour:
Import a key in JWK format: POST /wallet-api/wallet/{wallet}/keys/import
Import that same key in JWK format again.
Observe the API returning a 500 error due to an unhandled exception.
Expected behaviour
A 409 Conflict or 400 Bad Request error response after successfully handling the exception.
Actual behaviour
An unhandled exception/not gracefully handled exception leading to a 500 Internal Server Error response without significant meaningful context assisting the user to resolve the situation.
eenshots to help explain your problem.
Environment Desktop (please complete the following information):
Browser: curl command line or other scripted (e.g. via Python requests) Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
Exploring the wallet-api, I have stumbled upon a few unhandled exceptions leading to 500 Internal Server Errors. In this case they were all tied to primary key constraint errors in the DB, so I would guess that they're likely applicable to other persistence back-ends as well.
Specifically they have occurred in the following cases:
{"exception":true,"status":"Internal Server Error","code":"500","message":"Could not register user: Account already exists!"}
){"exception": true, "status": "Internal Server Error", "code": "500", "message": "org.sqlite.SQLiteException: [SQLITE_CONSTRAINT_PRIMARYKEY] A PRIMARY KEY constraint failed (UNIQUE constraint failed: wallet_dids.wallet, wallet_dids.did)"}
){"exception":true,"status":"Internal Server Error","code":"500","message":"org.sqlite.SQLiteException: [SQLITE_CONSTRAINT_PRIMARYKEY] A PRIMARY KEY constraint failed (UNIQUE constraint failed: wallet_keys.wallet, wallet_keys.kid)"}
)To Reproduce
Steps to reproduce the behaviour:
POST /wallet-api/wallet/{wallet}/keys/import
500
error due to an unhandled exception.Expected behaviour
A
409 Conflict
or400 Bad Request
error response after successfully handling the exception.Actual behaviour
An unhandled exception/not gracefully handled exception leading to a
500 Internal Server Error
response without significant meaningful context assisting the user to resolve the situation.eenshots to help explain your problem.
Environment
Desktop (please complete the following information):
curl
command line or other scripted (e.g. via Pythonrequests
)Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: