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

Internal server error on exchanges query after IPEX grant message #115

Closed
lenkan opened this issue Oct 17, 2023 · 0 comments · Fixed by #117
Closed

Internal server error on exchanges query after IPEX grant message #115

lenkan opened this issue Oct 17, 2023 · 0 comments · Fixed by #117
Assignees

Comments

@lenkan
Copy link
Collaborator

lenkan commented Oct 17, 2023

I tried using the branch here WebOfTrust/signify-ts#118 to create a credential and sending an IPEX grant message to a holder AID. The holder receives a notification as I would expect.

However, when I was trying to figure out how to send back an "admit" message from the holder I inspected the /identifiers/{name}/exchanges/query endpoint in KERIA and noticed an internal server error originating from here:

rep.data = json.dumps(exns).encode("utf-8")

The error is that bytearray is not serializable to JSON. The values in the "pathed" dictionary that are of type bytearray. I probably shouldn't be using the /exchanges/query endpoint directly (?). But I thought it might be important to catch the error anyway. Unfortunately I cannot navigate the KERIA codebase well enough to create a minimal reproduction at the moment.

This is the received error message:

keri: Parsed Request:
POST /identifiers/recipient/exchanges/query {(1, 1)
Hict([('host', '127.0.0.1:3901'), ('connection', 'keep-alive'), ('content-type', 'application/json'), ('signature', 'indexed="?0";signify="..."'), ('signature-input', 'signify=("@method" "@path" "signify-resource" "signify-timestamp");created=1697557238;keyid="...";alg="ed25519"'), ('signify-resource', '...'), ('signify-timestamp', '2023-10-17T15:40:38.274000+00:00'), ('accept', '*/*'), ('accept-language', '*'), ('sec-fetch-mode', 'cors'), ('user-agent', 'undici'), ('accept-encoding', 'gzip, deflate'), ('content-length', '2')])

2023-10-17 15:40:38 [FALCON] [ERROR] POST /identifiers/recipient/exchanges/query => Traceback (most recent call last):
  File "falcon/app.py", line 365, in falcon.app.App.__call__
  File "/usr/local/lib/python3.10/site-packages/keria/peer/exchanging.py", line 143, in on_post
    rep.data = json.dumps(exns).encode("utf-8")
  File "/usr/local/lib/python3.10/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/local/lib/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/lib/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytearray is not JSON serializable
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

Successfully merging a pull request may close this issue.

2 participants