Description
Running deadend --target <url> fails immediately with:
Failed to instantiate agent: Failed to create sandbox: APIError.__init__() missing 1 required positional argument: 'message'
Root cause
Two layers:
-
Missing sandbox image — xoxruns/sandboxed_kali could not be pulled (Docker Hub unreachable in our environment). RPC server log (~/.cache/deadend/logs/rpc-server-*.log):
Error pulling sandboxed Kali image: 500 Server Error ... "Get "https://registry-1.docker.io/v2/": context deadline exceeded"
Image not found xoxruns/sandboxed_kali
Failed to create sandbox: APIError.__init__() missing 1 required positional argument: 'message'
-
Bug masking the real error — in deadend_agent/src/deadend_agent/sandbox/sandbox.py, Sandbox.start() re-raises docker exceptions by constructing a new exception with no message:
except ImageNotFound as exc:
logger.error("Image not found %s", container_image)
raise ImageNotFound from exc # ImageNotFound() → APIError() → TypeError
except NotFound as exc:
logger.error("Docker error: %s", exc.explanation)
raise NotFound from exc
docker.errors.ImageNotFound / NotFound inherit APIError, whose __init__(self, message, response=None, explanation=None) requires message. Constructing ImageNotFound() with no args raises TypeError: APIError.__init__() missing 1 required positional argument: 'message', completely masking the real ImageNotFound and making the actual problem impossible to diagnose. Reproduced with docker SDK 7.1.0:
>>> raise ImageNotFound from None
TypeError: APIError.__init__() missing 1 required positional argument: 'message'
Expected behavior
Re-raise the original exception (raise exc) so callers see the actual docker.errors.ImageNotFound with its explanation.
Environment
- deadend CLI (OpenTUI rewrite, current main)
- docker SDK 7.1.0 (bundled)
- Linux (WSL2 / Kali)
Description
Running
deadend --target <url>fails immediately with:Root cause
Two layers:
Missing sandbox image —
xoxruns/sandboxed_kalicould not be pulled (Docker Hub unreachable in our environment). RPC server log (~/.cache/deadend/logs/rpc-server-*.log):Bug masking the real error — in
deadend_agent/src/deadend_agent/sandbox/sandbox.py,Sandbox.start()re-raises docker exceptions by constructing a new exception with no message:docker.errors.ImageNotFound/NotFoundinheritAPIError, whose__init__(self, message, response=None, explanation=None)requiresmessage. ConstructingImageNotFound()with no args raisesTypeError: APIError.__init__() missing 1 required positional argument: 'message', completely masking the realImageNotFoundand making the actual problem impossible to diagnose. Reproduced with docker SDK 7.1.0:Expected behavior
Re-raise the original exception (
raise exc) so callers see the actualdocker.errors.ImageNotFoundwith its explanation.Environment