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

Intermittent KERIA Internal Server Errors (HTTP 500) when listing registries. #147

Closed
lenkan opened this issue Dec 13, 2023 · 5 comments
Closed
Assignees

Comments

@lenkan
Copy link
Collaborator

lenkan commented Dec 13, 2023

I am getting intermittent internal server errors from KERIA when listing registries. It has happened the last couple of weeks. The stack trace is this:

keri-sandbox-keri-agent-1  | Sending TEL events to witnesses
keri-sandbox-keri-agent-1  | 2023-12-13 12:32:04 [FALCON] [ERROR] GET /identifiers/multisig/registries => Traceback (most recent call last):
keri-sandbox-keri-agent-1  |   File "falcon/app.py", line 365, in falcon.app.App.__call__
keri-sandbox-keri-agent-1  |   File "/keria/src/keria/app/credentialing.py", line 91, in on_get
keri-sandbox-keri-agent-1  |     state=asdict(registry.tever.state())
keri-sandbox-keri-agent-1  |   File "/keria/venv/lib/python3.10/site-packages/keri/vdr/credentialing.py", line 198, in tever
keri-sandbox-keri-agent-1  |     return self.reger.tevers[self.regk]
keri-sandbox-keri-agent-1  |   File "/keria/venv/lib/python3.10/site-packages/keri/vdr/viring.py", line 48, in __getitem__
keri-sandbox-keri-agent-1  |     raise ex  # reraise KeyError
keri-sandbox-keri-agent-1  |   File "/keria/venv/lib/python3.10/site-packages/keri/vdr/viring.py", line 43, in __getitem__
keri-sandbox-keri-agent-1  |     return super(rbdict, self).__getitem__(k)
keri-sandbox-keri-agent-1  | KeyError: 'ECKz_AJZmLmSHqwlztCFnH8Zi6rDBNFhxcJ_dq3FIs2T'
keri-sandbox-keri-agent-1  |
keri-sandbox-keri-agent-1  | Witness receipts complete, EEJPy1xYu3qwUdzVLwm0utcPYCFdJw4B_SBUC0Nq5TVU confirmed.

This happens when the registry does not have any backers. I do not have a clear reproduction yet.

@psteniusubi
Copy link
Contributor

I'm seeing this too. Looks like this sometimes happens when invoking registries.list immediately after registry creation for a multisig identifier is completed.

My workaround is to retry once the registries.list operation after a small delay.

@lenkan
Copy link
Collaborator Author

lenkan commented Jan 25, 2024

I added a commented out step that triggers this in PR WebOfTrust/signify-ts#202 in signify.

@psteniusubi
Copy link
Contributor

I have found a possible cause for this issue. Turns out there are a couple of long running operations that have metadata.depends set to an other long running operation: Registries.create() and Credentials.issue().

It looks like waiting for both operations to complete will make things more reliable and avoid the server side error.

How to resolve this issue? I think the server side of GET /operations/{aid} should also check dependencies. In the same way DELETE /operations/{aid} should delete dependencies. Possibly controlled by query parameter.

Below a sample operation from Registries.create() with metadata.depends set:

{
  "name": "registry.ELPrxeE2UtppYnCRh3JioNw3I2nY8a1FhnPle9prIov6",
  "metadata": {
    "anchor": {
      "i": "EA6OPxtGks_x-cY0HHD2w5dkJ4QWSb91KlK2s-ROnchQ",
      "s": "0",
      "d": "EA6OPxtGks_x-cY0HHD2w5dkJ4QWSb91KlK2s-ROnchQ"
    },
    "depends": {
      "name": "witness.ELPrxeE2UtppYnCRh3JioNw3I2nY8a1FhnPle9prIov6",
      "metadata": {
        "sn": 1
      },
      "done": false,
      "error": null,
      "response": null
    }
  },
  "done": false,
  "error": null,
  "response": null
}

@pfeairheller pfeairheller self-assigned this Feb 1, 2024
@kentbull
Copy link
Contributor

kentbull commented Feb 1, 2024

I believe I may have found the cause of this in KERIpy as stated in WebOfTrust/keripy#667.

The Tever.reload function expects a Serder instance yet is getting a RegStateRecord.

psteniusubi added a commit to psteniusubi/signify-ts that referenced this issue Feb 8, 2024
client side fix for WebOfTrust/keria#147
add markNotification and markAndRemoveNotification
lenkan pushed a commit to WebOfTrust/signify-ts that referenced this issue Feb 11, 2024
* fix addEndRole return type

* update Operation type, add list and delete methods to Operations

* fix Notifications.delete

* make waitOperation check dependent operations

client side fix for WebOfTrust/keria#147
add markNotification and markAndRemoveNotification

* use waitOperation and markAndRemoveNotification where needed

* rename to assertOperations

* rename to assertNotifications

* cleanup

* simplify with toHaveLength(0)

* adds warnNotifications

* uses warnNotifications

* fixed to handle all notifications

* npm run pretty

* unit tests for operations.list and .delete

* add missing await
pfeairheller added a commit to pfeairheller/keria that referenced this issue Feb 23, 2024
pfeairheller added a commit to pfeairheller/keria that referenced this issue Feb 24, 2024
pfeairheller added a commit to pfeairheller/keria that referenced this issue Feb 24, 2024
pfeairheller added a commit that referenced this issue Feb 26, 2024
* Fix credential registry list endpoint to account for a not yet fully committed registry.  Closes #147

Signed-off-by: pfeairheller <[email protected]>

* Fix long running endpoint to allow for an operaiton for a KEL event not yet processed.

Signed-off-by: pfeairheller <[email protected]>

* Remove extra test condition pulled in from development

Signed-off-by: pfeairheller <[email protected]>

* Add test for invalid sequence number in long running witness operation.

Signed-off-by: pfeairheller <[email protected]>

* Add test for satisfied witness receipts for long running operation

Signed-off-by: pfeairheller <[email protected]>

* Fix reference to revocation anchor event.

Signed-off-by: pfeairheller <[email protected]>

* Add test coverage for multisig revocation.

Signed-off-by: pfeairheller <[email protected]>

* Rev version number

Signed-off-by: pfeairheller <[email protected]>

---------

Signed-off-by: pfeairheller <[email protected]>
@pfeairheller
Copy link
Member

Fixed with PR #197

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

4 participants