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

BadValsizeError (MBD_BAD_VALSIZE) error thrown when resolving a slightly incorrect oobi url #575

Closed
daidoji opened this issue Sep 26, 2023 · 0 comments

Comments

@daidoji
Copy link
Contributor

daidoji commented Sep 26, 2023

Not a big issue but I noticed that when I

  1. Started the witness demo kli witness demo
  2. Then retrieved the incorrect url http://127.0.0.1:5642/oobi/ (notice the trailing slash that shouldn't be there)

I'd get a traceback Falcon error as below.

Ran this between the demo command and the traceback below. daidoji@darkstar:~$ curl http://127.0.0.1:5642/oobi/

(keri) daidoji@darkstar:~/ssi/keripy$ kli witness demo &
[1] 31993
(keri) daidoji@darkstar:~/ssi/keripy$ Witness wan : BBilc4-L3tFUnfM_wJr4S4OJanAv_VmF_dJNN6vkf2Ha
Witness wil : BLskRTInXnMxWaGqcpSyMgo0nYbalW99cGZESrz3zapM
Witness wes : BIKKuvBwpmDVA4Ds-EpL5bt9OqPzWPja2LigFYZN2YfX
Witness wit : BM35JN8XeJSEfpxopjn5jr7tAHCE5749f0OobhMLCorE
Witness wub : BIj15u5V11bkbtAxMA7gcNJZcax-7TgaBMLsQnMHpYHP
Witness wyz : BF2rZTW79z4IXocYRQnjjsOuvFUQv-ptCf8Yltd7PfsM
2023-09-26 09:44:16 [FALCON] [ERROR] GET /oobi/ => Traceback (most recent call last):
  File "/home/daidoji/ssi/keripy/src/keri/db/basing.py", line 62, in __getitem__
    return super(dbdict, self).__getitem__(k)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: ''

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/daidoji/ssi/keripy/src/keri/end/ending.py", line 571, in on_get
    if aid not in self.hby.kevers:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/daidoji/ssi/keripy/src/keri/db/basing.py", line 78, in __contains__
    self.__getitem__(k)
  File "/home/daidoji/ssi/keripy/src/keri/db/basing.py", line 66, in __getitem__
    if (ksr := self.db.states.get(keys=k)) is None:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/daidoji/ssi/keripy/src/keri/db/koming.py", line 281, in get
    return (self.deserializer(self.db.getVal(db=self.sdb,
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/daidoji/ssi/keripy/src/keri/db/dbing.py", line 449, in getVal
    return( txn.get(key))
            ^^^^^^^^^^^^
lmdb.BadValsizeError: mdb_get: MDB_BAD_VALSIZE: Unsupported size of key/DB name/data, or wrong DUPFIXED size

Seems to be caused by a root issue with empty keys in LMDB and LMDBer when I walked through the code.

daidoji added a commit to daidoji/keripy that referenced this issue Sep 26, 2023
LMBD throws lmdb.BadValSizeError which isn't very helpful (or caught) in
the codebase although KeyErrors are because of the dict abstraction
elsewhere.  (Found while trying to resolve Issue WebOfTrust#575)

So now the LMDB methods throw KeyError where appropriate and tests for
all methods with empty keys now execute regardless of whether those
methods had the issue or not.
daidoji added a commit to daidoji/keripy that referenced this issue Sep 26, 2023
LMBD throws lmdb.BadValSizeError which isn't very helpful (or caught) in
the codebase although KeyErrors are because of the dict abstraction
elsewhere.  (Found while trying to resolve Issue WebOfTrust#575)

So now the LMDB methods throw KeyError where appropriate and tests for
all methods with empty keys now execute regardless of whether those
methods had the issue or not.
pfeairheller pushed a commit that referenced this issue Sep 28, 2023
LMBD throws lmdb.BadValSizeError which isn't very helpful (or caught) in
the codebase although KeyErrors are because of the dict abstraction
elsewhere.  (Found while trying to resolve Issue #575)

So now the LMDB methods throw KeyError where appropriate and tests for
all methods with empty keys now execute regardless of whether those
methods had the issue or not.
@daidoji daidoji closed this as completed Nov 2, 2023
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

1 participant