Skip to content

HTTP 500 error when creating contact object containing int or boolean fields #416

@Sotatek-Patrick-Vu

Description

@Sotatek-Patrick-Vu

Version

0.2.0-rc2

Environment

No response

Expected behavior

Can create/update contact object with int/bool fields

Actual behavior

keri: Parsed Request: PUT /contacts/EF3MwcdfdoSupOK4_4QOersKdGjXl9F5UhHuiQ2Phf2T (1, 1)

keri: Headers/Body: Hict([('host', '127.0.0.1:3901'), ('connection', 'keep-alive'), ('signify-resource', 'EKkus3rLXvSoqxxQeqMgMnglztTaZqbzJmKsV4OeRXmm'), ('signify-timestamp', '2026-02-09T10:07:38.714000+00:00'), ('content-type', 'application/json'), ('signature-input', 'signify=("@method" "@path" "signify-resource" "signify-timestamp");created=1770631658;keyid="DNF9y_YDisSarN1v1XX2y80dQ4eSDm93CVaSCoqcjTwH";alg="ed25519"'), ('signature', 'indexed="?0";signify="0BA9DTLtrtva2h6ob_nGvNg043UMUvSnj--ZiCGZN_O6WH4FSfvaIkowtsXD2GASNsFFEO3l28CfCGGewf6_cR0K"'), ('accept', '/'), ('accept-language', '*'), ('sec-fetch-mode', 'cors'), ('user-agent', 'node'), ('accept-encoding', 'gzip, deflate'), ('content-length', '252')]) -- bytearray(b'{"alias":"contacts-bob-e17c1f08","oobi":"http://keria:3902/oobi/EF3MwcdfdoSupOK4_4QOersKdGjXl9F5UhHuiQ2Phf2T/agent/ELAjSASkyeUSBCBySiA63w-NrRFSEiHipoLRC71Q6ngM","email":"bob@example.com","label":"vip","priority":7,"active":false,"phone":"+15551231234"}')

2026-02-09 10:07:38 [FALCON] [ERROR] PUT /contacts/EF3MwcdfdoSupOK4_4QOersKdGjXl9F5UhHuiQ2Phf2T => Traceback (most recent call last):

File "falcon/app.py", line 440, in falcon.app.App.call

File "/keria/src/keria/app/aiding.py", line 2213, in on_put

agent.org.update(prefix, body)

File "/keria/venv/lib/python3.12/site-packages/keri/app/organizing.py", line 54, in update

self.fielddb.pin(keys=(pre, field), val=val)

File "/keria/venv/lib/python3.12/site-packages/keri/db/subing.py", line 379, in pin

return (self.db.setVal(db=self.sdb,

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/keria/venv/lib/python3.12/site-packages/keri/db/dbing.py", line 536, in setVal

return (txn.put(key, val))

        ^^^^^^^^^^^^^^^^^

TypeError: a bytes-like object is required, not 'int'

Steps to reproduce

Create contact like this:

{"alias":"contacts-bob-e17c1f08","oobi":"http://keria:3902/oobi/EF3MwcdfdoSupOK4_4QOersKdGjXl9F5UhHuiQ2Phf2T/agent/ELAjSASkyeUSBCBySiA63w-NrRFSEiHipoLRC71Q6ngM","email":"bob@example.com","label":"vip","priority":7,"active":false,"phone":"+15551231234"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions