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 GET /oobi/ (trailing slash) #126

Closed
lenkan opened this issue Nov 14, 2023 · 1 comment · Fixed by #178
Closed

Internal Server Error on GET /oobi/ (trailing slash) #126

lenkan opened this issue Nov 14, 2023 · 1 comment · Fixed by #178

Comments

@lenkan
Copy link
Collaborator

lenkan commented Nov 14, 2023

Steps to reproduce

Start agent

keria start

Send a HTTP GET to message endpoint /oobi/

curl -v http://localhost:3902/oobi/

Actual result

Keria responds with internal server error

*   Trying 127.0.0.1:3902...
* Connected to localhost (127.0.0.1) port 3902 (#0)
> GET /oobi/ HTTP/1.1
> Host: localhost:3902
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Content-Type: application/json
< Vary: Accept
< Content-Length: 38
< Server: Ioflo WSGI Server
< Date: Tue, 14 Nov 2023 12:59:46 GMT
<
* Connection #0 to host localhost left intact
{"title": "500 Internal Server Error"}

Logs:

2023-11-14 13:59:46 [FALCON] [ERROR] GET /oobi/ => Traceback (most recent call last):
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/db/dbing.py", line 458, in getVal
    return(txn.get(key))
lmdb.BadValsizeError: mdb_get: MDB_BAD_VALSIZE: Unsupported size of key/DB name/data, or wrong DUPFIXED size

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "falcon/app.py", line 365, in falcon.app.App.__call__
  File "/home/lenkan/code/keria/src/keria/end/ending.py", line 57, in on_get
    agent = self.agency.lookup(pre=aid)
  File "/home/lenkan/code/keria/src/keria/app/agenting.py", line 253, in lookup
    if (prefixer := self.adb.aids.get(keys=(pre,))) is not None:
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/db/subing.py", line 258, in get
    val = self.db.getVal(db=self.sdb, key=self._tokey(keys))
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/db/dbing.py", line 460, in getVal
    raise KeyError(f"Key: `{key}` is either empty, too big (for lmdb),"
KeyError: "Key: `b''` is either empty, too big (for lmdb), or wrong DUPFIXED size. ref) lmdb.BadValsizeError"

Expected result

Keria returns with HTTP 4xx. Probably with a 404 as with GET /oobi/missing-aid endpoint:

$ curl -v http://localhost:3902/oobi/missing-aid
*   Trying 127.0.0.1:3902...
* Connected to localhost (127.0.0.1) port 3902 (#0)
> GET /oobi/abc HTTP/1.1
> Host: localhost:3902
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Content-Type: application/json
< Vary: Accept
< Content-Length: 72
< Server: Ioflo WSGI Server
< Date: Tue, 14 Nov 2023 13:02:36 GMT
<
* Connection #0 to host localhost left intact
{"title": "404 Not Found", "description": "AID not found for this OOBI"}

Or a 400 saying that an empty AID is invalid.

pfeairheller added a commit to pfeairheller/keria that referenced this issue Jan 30, 2024
pfeairheller added a commit that referenced this issue Jan 30, 2024
… a blank string. (#178)

Closes #126 and closes #176

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

Closed with PR #178 that is in the 0.1.0 release candidate

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