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

Keria crashes when resolving oobi with invalid / unknown domain name #125

Closed
lenkan opened this issue Nov 14, 2023 · 2 comments
Closed

Keria crashes when resolving oobi with invalid / unknown domain name #125

lenkan opened this issue Nov 14, 2023 · 2 comments

Comments

@lenkan
Copy link
Collaborator

lenkan commented Nov 14, 2023

See reproduction script here: WebOfTrust/signify-ts#136

Steps to reproduce

In keria repository, checkout development branch, install dependencies, then run

keria start

In signify-ts repository, checkout branch of PR WebOfTrust/signify-ts#136, then run, install dependencies, and build project according to README. Then run

npx ts-node --esm examples/integration-scripts/resolve-invalid-oobi.ts

Expected result

Script logs an HTTP 4xx error, or perhaps even a HTTP 500 error. Can also be a HTTP 200, but with a failed operation.

Actual result

Script logs SocketError: other side closed and keria process crashed with

Traceback (most recent call last):
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/core/coring.py", line 25, in normalizeHost
    info =  socket.getaddrinfo(host,
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Traceback (most recent call last):
  File "/home/lenkan/code/keria/.venv/bin/keria", line 33, in <module>
    sys.exit(load_entry_point('keria', 'console_scripts', 'keria')())
  File "/home/lenkan/code/keria/src/keria/app/cli/keria.py", line 31, in main
    raise ex
  File "/home/lenkan/code/keria/src/keria/app/cli/keria.py", line 25, in main
    doers = args.handler(args)
  File "/home/lenkan/code/keria/src/keria/app/cli/commands/start.py", line 20, in <lambda>
    parser.set_defaults(handler=lambda args: launch(args))
  File "/home/lenkan/code/keria/src/keria/app/cli/commands/start.py", line 74, in launch
    runAgent(name=args.name,
  File "/home/lenkan/code/keria/src/keria/app/cli/commands/start.py", line 107, in runAgent
    directing.runController(doers=doers, expire=expire)
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/app/directing.py", line 665, in runController
    doist.do(doers=doers)
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/base/doing.py", line 156, in do
    self.recur()  # increments .tyme runs recur context
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/base/doing.py", line 275, in recur
    tock = dog.send(self.tyme)  # yielded tock == 0.0 means re-run asap
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/base/doing.py", line 922, in do
    self.done = self.recur(tyme=tyme)  # equv of doist.recur
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/base/doing.py", line 1026, in recur
    tock = dog.send(tyme)  # yielded tock == 0.0 means re-run asap
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/base/doing.py", line 922, in do
    self.done = self.recur(tyme=tyme)  # equv of doist.recur
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/base/doing.py", line 1026, in recur
    tock = dog.send(tyme)  # yielded tock == 0.0 means re-run asap
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/app/oobiing.py", line 386, in scoobiDo
    self.processFlows()
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/app/oobiing.py", line 394, in processFlows
    self.processOobis()
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/app/oobiing.py", line 439, in processOobis
    self.request(url, obr)
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/app/oobiing.py", line 583, in request
    client = self.clienter.request("GET", url=url)
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/keri/app/httping.py", line 224, in request
    client = http.clienting.Client(scheme=purl.scheme,
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/core/http/clienting.py", line 766, in __init__
    host = coring.normalizeHost(hostname)
  File "/home/lenkan/code/keria/.venv/lib/python3.10/site-packages/hio/core/coring.py", line 34, in normalizeHost
    info =  socket.getaddrinfo(host,
  File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
@lenkan
Copy link
Collaborator Author

lenkan commented Dec 13, 2023

Similar thing is now happening if the oobi url contains unicode characters. KERIA process crashes. For example when copying an URL from slack by selecting text instead of "Copy address"

http://example.com:5631/oobi/EOpQzDTQ_5xWDID40pZAUcn_gpp_[…]i-MARyehQIqwWH0Uh2z9eyrFQ_kHmmANs

@lenkan
Copy link
Collaborator Author

lenkan commented Jan 25, 2024

Tested with new images. Seems to be OK now. Closing this issue.

@lenkan lenkan closed this as completed Jan 25, 2024
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