mirror of
https://github.com/open-webui/oikb.git
synced 2026-11-05 01:27:25 +00:00
[GH-ISSUE #92] oikb validate --deep crashes with cryptic TypeError: ('parser', <class 'module'>) on Windows #60
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/oikb#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Nemo08 on GitHub (Aug 3, 2026).
Original GitHub issue: https://github.com/open-webui/oikb/issues/92
Title
oikb validate --deepcrashes with crypticTypeError: ('parser', <class 'module'>)on Windows — actual cause is staletrioincompatible with Python 3.13'spathlib.Path.parserSummary
On Windows,
oikb validate --deep(and in fact anyoikbcommand that constructs anhttpx.Client) can fail with a confusing, non-actionable error:This looks like a network/connectivity problem, but it isn't —
httpx.Client()never even gets to make a request. The root cause is an environment issue (outdatedtrio), but oikb's error handling incli.pyswallows the real traceback and prints onlystr(e), which for multi-arg exceptions is justrepr(e.args). This makes the message actively misleading for anyone trying to diagnose a "connectivity" failure that has nothing to do with the network.Environment
selenium/trio-websocket, used byhttpcore._synchronizationfor sync primitivesRoot cause
httpcore._synchronizationimportstrioon Windows for its locking primitives.trio's_path.pydefinestrio.Pathby wrapping every method ofpathlib.Path/PurePathvia a metaclass (AsyncAutoWrapperType.generate_forwards), iterating overpathlib.Path's class attributes.Python 3.13 added a new class attribute to
pathlib.PurePath:parser(a module reference, e.g.posixpath/ntpath, part of the new path-flavour abstraction). Older versions oftrio(e.g. 0.23.1) assume every wrapped attribute is callable/descriptor-like and blow up when it encounters a bare module:This exception propagates all the way up through
httpcore→httpx.Client.__init__→oikb._make_client(), wherecli.pycatches it as a genericExceptionand prints:Since the
TypeErrorwas raised with two positional args,str(e)renders asrepr(e.args)— hence the odd('parser', <class 'module'>)output, with zero indication that this is an import-time failure unrelated to networking.Fix on the user side:
pip install --upgrade trio(0.23.1 → 0.33.0 resolves it).Reproduction
On an affected environment (Python 3.13 + trio < ~0.26) this raises the traceback below instead of returning silently.
Full traceback
Suggested fixes for oikb
None of this is oikb's bug per se (it's an upstream
trio/Python 3.13 incompatibility), but oikb's error handling makes it very hard to diagnose. Suggestions, roughly in order of preference:_make_client()/ thevalidate --deephandler, catch import/construction errors fromhttpx.Client()separately and print the full exception type + traceback (or at leastrepr(e)instead ofstr(e)) so users can see it's aTypeErroron import, not a connection failure.httpcore's optionaltriobackend needs to be pulled in at all for oikb's use case (oikb only uses the synchttpx.Client, nothttpx.AsyncClient) — if there's a way to avoid triggering the trio import path for sync-only usage, that would sidestep this class of issue entirely.trioversion (or addtrio>=0.26as an explicit constraint) inpyproject.tomlifhttpcore/trioend up in the dependency tree on Windows, since oldertriois incompatible with Python 3.13.Additional notes
Direct connectivity to Open WebUI was confirmed working the whole time (
curl -i $OPEN_WEBUI_URL/healthreturned200 OK) whileoikb validate --deepreported "Cannot reach Open WebUI" — worth flagging explicitly in any fix/doc update that this message can be a false negative for network reachability.