WebOfTrust / keria

KERI Agent in the cloud
https://keria.readthedocs.io/en/latest/
Apache License 2.0
17 stars 26 forks source link

500 on /boot after restarting KERIA for existing agent. 400 is expected. #180

Closed kentbull closed 5 months ago

kentbull commented 5 months ago

Problem - Actual Behavior

An HTTP 500 is being returned from the /boot endpoint for an agent that already exists. The problem is that in the self.agency.agents call here is empty after server startup. It seems like this list should be populated with all of the known agents. If that is not yet the case then this issue can be marked as a feature request rather than a bug.

Expected Behavior

Return a 400 Bad Request status when I try to re-create the same identifier.

Suggestion

Ideally the return status would be a 409 since 409 Conflict makes more sense than 400 Bad Request due to the fact that a 400 typically means the request is improperly formatted and 409 is a nice way to distinguish improperly formatted requests from identifier conflicts.

Reproduction steps

  1. Start KERIA.
  2. Create an agent using SignifyTS.
  3. Shutdown KERIA.
  4. Start up KERIA.
  5. Try to make the same agent again with SignifyTS.
  6. Observe the 500 error that gets returned.
kentbull commented 5 months ago

https://github.com/WebOfTrust/keria/pull/181 addresses this.