[GH-ISSUE #4309] [TUI] the launcher skips the bundled runtime when access(X_OK) is denied (Docker's default seccomp profile) #1904

Open
opened 2026-11-04 01:55:12 +07:00 by bsakaguchi · 3 comments
Owner

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=unconfined the same image and the same command work.

Environment:

  • Host: Ubuntu 20.04.3 LTS, kernel 5.15.0-58, glibc 2.31, two-socket Xeon Gold 5218, 125.6 GiB RAM
  • Docker 19.03.15 (client and server), SecurityOptions: apparmor, seccomp(profile=default)
  • GPU: RTX 5090 32 GB, driver 580.142
  • Image: ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13 (mirror of ghcr.io/niko1221/strata:0.2.2-cuda13; image id sha256:64b9e2de4f19e1155b85a023f75b2575407970ac75919ebf5febd7670104d5c5), engine 0.1.47

Reproduce: nothing is downloaded and no model is needed.

# fails on this daemon
docker run --rm --gpus device=1 ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13 strata --version
# works on the same daemon, same image
docker run --rm --gpus device=1 --security-opt seccomp=unconfined \
  ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13 strata --version

Expected: strata 0.2.2 (build 0.1.47; python 3.12.15 at /opt/strata/terminal/python/bin/python3)

Actual (first command):

strata: no usable Python found.

This distribution is meant to run on its own. If you are seeing this, the private runtime is
missing from the install and no Python 3.10+ is on your PATH.

Evidence — the runtime is present and runs, only the permission test disagrees (same image, default seccomp):

test -x on the private python : FALSE
test -r on the private python : FALSE
test -e (exists)              : TRUE
readlink -f                   : /opt/strata/terminal/python/bin/python3.12
direct exec                   : Python 3.12.15
command -v python3            : NOT FOUND

With --security-opt seccomp=unconfined the same three checks become TRUE/FOUND and the launcher prints its version.

Cause: bin/strata in pick_python() uses [ -x "$candidate" ] for every candidate. This daemon's seccomp profile denies access(X_OK)/faccessat for X_OK, so test -x answers false for a file the shell can still execute (direct exec of the same path works). The bundled runtime is skipped, command -v python3 is 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.md has 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 when test -x says no) and will open it as a pull request that references this issue.

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=unconfined` the same image and the same command work. Environment: - Host: Ubuntu 20.04.3 LTS, kernel 5.15.0-58, glibc 2.31, two-socket Xeon Gold 5218, 125.6 GiB RAM - Docker 19.03.15 (client and server), `SecurityOptions: apparmor, seccomp(profile=default)` - GPU: RTX 5090 32 GB, driver 580.142 - Image: `ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13` (mirror of `ghcr.io/niko1221/strata:0.2.2-cuda13`; image id `sha256:64b9e2de4f19e1155b85a023f75b2575407970ac75919ebf5febd7670104d5c5`), engine 0.1.47 Reproduce: nothing is downloaded and no model is needed. ```sh # fails on this daemon docker run --rm --gpus device=1 ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13 strata --version # works on the same daemon, same image docker run --rm --gpus device=1 --security-opt seccomp=unconfined \ ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13 strata --version ``` Expected: `strata 0.2.2 (build 0.1.47; python 3.12.15 at /opt/strata/terminal/python/bin/python3)` Actual (first command): ```text strata: no usable Python found. This distribution is meant to run on its own. If you are seeing this, the private runtime is missing from the install and no Python 3.10+ is on your PATH. ``` Evidence — the runtime is present and runs, only the permission test disagrees (same image, default seccomp): ```text test -x on the private python : FALSE test -r on the private python : FALSE test -e (exists) : TRUE readlink -f : /opt/strata/terminal/python/bin/python3.12 direct exec : Python 3.12.15 command -v python3 : NOT FOUND ``` With `--security-opt seccomp=unconfined` the same three checks become `TRUE`/`FOUND` and the launcher prints its version. Cause: `bin/strata` in `pick_python()` uses `[ -x "$candidate" ]` for every candidate. This daemon's seccomp profile denies `access(X_OK)`/`faccessat` for `X_OK`, so `test -x` answers false for a file the shell can still execute (direct `exec` of the same path works). The bundled runtime is skipped, `command -v python3` is 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.md` has 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 when `test -x` says no) and will open it as a pull request that references this issue.
Author
Owner

@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:

$ docker run --rm --network none --gpus device=1 -v /tmp/probe:/data ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13
[X] The engine in this image does not match this computer's graphics card, or the card is not visible to the container.
    strata: no usable Python found.
    ...
      NVIDIA  docker run --gpus all ... (needs nvidia-container-toolkit on the host; driver 580+ for the cuda13 image, 575+ for cuda12)
    Then pick the image for your card: docs/DOCKER.md.

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:

Lines Daemon seccomp PYBIN Running it
shipped default python3 python3: not found
patched default /opt/strata/terminal/python/bin/python3 Python 3.12.15
patched unconfined same Python 3.12.15

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.

<!-- gh-comment-id:6443051389 --> @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: ```text $ docker run --rm --network none --gpus device=1 -v /tmp/probe:/data ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13 [X] The engine in this image does not match this computer's graphics card, or the card is not visible to the container. strata: no usable Python found. ... NVIDIA docker run --gpus all ... (needs nvidia-container-toolkit on the host; driver 580+ for the cuda13 image, 575+ for cuda12) Then pick the image for your card: docs/DOCKER.md. ``` 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: | Lines | Daemon seccomp | PYBIN | Running it | | --- | --- | --- | --- | | shipped | default | python3 | python3: not found | | patched | default | /opt/strata/terminal/python/bin/python3 | Python 3.12.15 | | patched | unconfined | same | Python 3.12.15 | 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.
Author
Owner

@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 have
just 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, and doctor is the
command that answers "is the installation fine?" already.

What it would do:

  • Say whether this process looks like a container: /.dockerenv, /run/.containerenv, a container=
    environment variable, /proc/1/cgroup markers, and STRATA_* environment variables (the image sets
    STRATA_COMPONENTS_DIR and STRATA_INSTALL_DIR).
  • For each bundled runtime that is present beside the terminal packages (python/bin/python3,
    python/bin/python, python/python.exe), do both permission tests: os.access(path, os.X_OK) and
    actually running [path, "-V"].
  • When os.access says no but the run succeeds, print one sentence naming the cause (the default
    seccomp profile of a Docker daemon older than 20.10 denies access(X_OK)) and the one option that
    fixes it (--security-opt seccomp=unconfined).
  • Print the container line and nothing else when the two tests agree, so a normal system sees no
    warning. --output json carries the same data.
  • Read-only: no download, no container restart, no settings change; every existing check and the exit
    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.

<!-- gh-comment-id:6555466830 --> @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 have just 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, and `doctor` is the command that answers "is the installation fine?" already. What it would do: - Say whether this process looks like a container: `/.dockerenv`, `/run/.containerenv`, a `container=` environment variable, `/proc/1/cgroup` markers, and `STRATA_*` environment variables (the image sets `STRATA_COMPONENTS_DIR` and `STRATA_INSTALL_DIR`). - For each bundled runtime that is present beside the terminal packages (`python/bin/python3`, `python/bin/python`, `python/python.exe`), do both permission tests: `os.access(path, os.X_OK)` and actually running `[path, "-V"]`. - When `os.access` says no but the run succeeds, print one sentence naming the cause (the default seccomp profile of a Docker daemon older than 20.10 denies `access(X_OK)`) and the one option that fixes it (`--security-opt seccomp=unconfined`). - Print the container line and nothing else when the two tests agree, so a normal system sees no warning. `--output json` carries the same data. - Read-only: no download, no container restart, no settings change; every existing check and the exit 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.
Author
Owner

@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.

<!-- gh-comment-id:6555693367 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1904
No description provided.