mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 21:05:40 +07:00
[GH-ISSUE #4309] [TUI] the launcher skips the bundled runtime when access(X_OK) is denied (Docker's default seccomp profile) #1904
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1904
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 @XiaoBinGan on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4309
Problem: inside the official image, the Terminal launcher (
/opt/strata/terminal/bin/strata) prints "no usable Python found" even though the bundled runtime is present and executable. It appears on hosts whose Docker daemon uses an older default seccomp profile (Docker 19.03.15 here). With--security-opt seccomp=unconfinedthe same image and the same command work.Environment:
SecurityOptions: apparmor, seccomp(profile=default)ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13(mirror ofghcr.io/niko1221/strata:0.2.2-cuda13; image idsha256:64b9e2de4f19e1155b85a023f75b2575407970ac75919ebf5febd7670104d5c5), engine 0.1.47Reproduce: nothing is downloaded and no model is needed.
Expected:
strata 0.2.2 (build 0.1.47; python 3.12.15 at /opt/strata/terminal/python/bin/python3)Actual (first command):
Evidence — the runtime is present and runs, only the permission test disagrees (same image, default seccomp):
With
--security-opt seccomp=unconfinedthe same three checks becomeTRUE/FOUNDand the launcher prints its version.Cause:
bin/stratainpick_python()uses[ -x "$candidate" ]for every candidate. This daemon's seccomp profile deniesaccess(X_OK)/faccessatforX_OK, sotest -xanswers false for a file the shell can still execute (directexecof the same path works). The bundled runtime is skipped,command -v python3is empty for the same reason, and the launcher reports a missing runtime it has.Scope: any container runtime whose default seccomp profile is the pre-20.10 Docker one, plus any environment where
access(X_OK)is restricted but execution is allowed. It also makes the message actively misleading: it sends people to reinstall a runtime that is already there.Related:
docs/DOCKER.mdhas no troubleshooting entry for this daemon/driver combination; the only permission-related entries are SELinux labels and the NVIDIA toolkit.Reproduction status: reproduced locally, four times, with the exact commands above. The A/B (same daemon, same image, only the seccomp option changed) is the evidence that the runtime is fine and the permission test is what fails.
I have a one-function fix for
bin/strata(fall back to actually starting the candidate whentest -xsays no) and will open it as a pull request that references this issue.@XiaoBinGan commented on GitHub (Oct 27, 2026):
Stronger evidence for the entrypoint side of this, added to the pull request #4312: a real container start with the shipped entrypoint on the same daemon, no network so it cannot download anything:
So a reader on such a host is sent to check the card, the toolkit and the image flavour, while the engine, the card and the runtime are all fine. docker/entrypoint.sh line 29 is the same [ -x ] test as the launcher and resolves PYBIN=python3 here, which is not installed in the image; that is the start that produces this line. Measured in the same image, replayed both ways:
I included that second file in #4312 rather than a separate pull request, because it is the same cause and the same fix; say if you would rather have them split.
@XiaoBinGan commented on GitHub (Nov 1, 2026):
Scope I would like to agree before opening a pull request: add a read-only "container and permissions"
section to
strata doctor, shown by default rather than behind a new flag. The people this helps havejust been told "The engine in this image does not match this computer's graphics card" and
"
strata: no usable Python found"; they will not know to ask for a new flag, anddoctoris thecommand that answers "is the installation fine?" already.
What it would do:
/.dockerenv,/run/.containerenv, acontainer=environment variable,
/proc/1/cgroupmarkers, andSTRATA_*environment variables (the image setsSTRATA_COMPONENTS_DIRandSTRATA_INSTALL_DIR).python/bin/python3,python/bin/python,python/python.exe), do both permission tests:os.access(path, os.X_OK)andactually running
[path, "-V"].os.accesssays no but the run succeeds, print one sentence naming the cause (the defaultseccomp profile of a Docker daemon older than 20.10 denies
access(X_OK)) and the one option thatfixes it (
--security-opt seccomp=unconfined).warning.
--output jsoncarries the same data.code stay as they are.
This is the diagnostic half of this issue; the launcher and entrypoint themselves are #4312. The
decision logic would be covered by unit tests with fake paths — this checkout is Windows, so the
container cases cannot be exercised end to end here, and I would say so under Not run.
@XiaoBinGan commented on GitHub (Nov 1, 2026):
Opened #4889 for the diagnostic half: strata doctor now reports a container and permissions section, and when os.access(X_OK) denies a bundled runtime that actually starts with -V it names the old Docker default seccomp profile and --security-opt seccomp=unconfined. Four unit tests cover the decisions; they were run on this Windows checkout, which cannot produce the seccomp denial itself. The launcher/entrypoint fix remains #4312.