{"record":{"id":"edd769e5e49fa591","repo":"odysseus-dev/odysseus","slug":"invalid-ssh-port-edd769","errorCode":null,"errorMessage":"Invalid ssh_port","messagePattern":"Invalid ssh_port","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"routes/shell_routes.py","lineNumber":1238,"sourceCode":"            if user_site and os.path.isdir(user_site):\n                # Use addsitedir(), NOT a bare sys.path.append(). When a package\n                # is `pip install --user`'d at runtime (Cookbook → Install) the\n                # long-lived server process started before the user-site existed,\n                # so site never processed it — including its `.pth` hooks. On\n                # Python 3.12+ `distutils` is gone from stdlib and is only\n                # restored by setuptools' `distutils-precedence.pth`, which ships\n                # in user-site. basicsr (a realesrgan dep) does `import distutils`\n                # at import time, so a plain append left the package importable\n                # but `import distutils` failing → realesrgan probed as\n                # not-installed until a full process restart. addsitedir() replays\n                # the `.pth` files so the shim is active.\n                site.addsitedir(user_site)\n        except Exception:\n            pass\n        if ssh_port and str(ssh_port).strip() not in (\"\", \"22\"):\n            _port = str(ssh_port).strip()\n            if not _SSH_PORT_RE.match(_port) or not (1 <= int(_port) <= 65535):\n                raise HTTPException(400, \"Invalid ssh_port\")\n        packages = [\n            # ── System ── OS binaries, not pip packages\n            {\n                \"name\": \"tmux\",\n                \"pip\": \"\",\n                \"desc\": \"Required for Linux/Termux Cookbook background downloads and serves\",\n                \"category\": \"System\",\n                \"target\": \"remote\",\n                \"kind\": \"system\",\n                \"install_hint\": \"Run Cookbook server setup, or install tmux with apt/pacman/dnf/apk/zypper.\",\n            },\n            {\n                \"name\": \"docker\",\n                \"pip\": \"\",\n                \"desc\": \"Required only for Docker-backed launch commands\",\n                \"category\": \"System\",\n                \"target\": \"remote\",\n                \"kind\": \"system\",","sourceCodeStart":1220,"sourceCodeEnd":1256,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/shell_routes.py#L1220-L1256","documentation":"Error \"Invalid ssh_port\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Enter a port number between 1 and 65535.","Leave the port empty to use the default."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}