Skip to content

Testcontainers' Mongo, and other exec-based containers, start on Kiri - #390

Merged
libracoder merged 2 commits into
libracoder:mainfrom
luben93:exec-start-200-without-upgrade
Nov 16, 2026
Merged

libracoder merged 2 commits into
libracoder:mainfrom
luben93:exec-start-200-without-upgrade

Conversation

@luben93

@luben93 luben93 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

exec start and attach answered 101 UPGRADED to every client. Docker does that only for a client
that sent Upgrade: tcp (the docker CLI); to others it sends 200 OK with the raw stream as the body.
docker-java, so Testcontainers, sends no Upgrade: against Kiri it stopped reading after the last
output frame and inspected the exec before the exit code was recorded, which failed with a
NullPointerException in execInContainer (for example MongoDBContainer).

http::upgrade_if_asked replies 101 only to a request that has an Upgrade header (Moby checks
presence, not the value), and 200 OK with Content-Type: application/vnd.docker.raw-stream otherwise.
The USB endpoint keeps its own upgrade.

Same change as #126 (closed), here with the exec exit-code symptom and a unit test.

Fixes #387.

Checked

  • cargo test -p kiri upgrades_only_when_asked: new unit test, both replies.
  • cargo test -p kiri: all pass except mac_sources_follow_links_and_etc_is_the_macs, which also fails
    on main on this machine (/etc/fstab).
  • Against a running 0.2.1 daemon, a proxy that rewrites this 101 into the 200 the patch sends made
    Testcontainers' MongoDBContainer start (3 of 3 runs failed without it). The patched daemon itself
    and tests/e2e.sh are not run.

🤖 Generated with Claude Code

@luben93
luben93 force-pushed the exec-start-200-without-upgrade branch from 78311c1 to 9c0b257 Compare November 16, 2026 14:17
@libracoder

Copy link
Copy Markdown
Owner

@luben93 thanks for this PR. Before it can be reviewed and merged, every commit needs to be signed. GitHub shows these as unsigned: ffaaec1, 9c0b257. Please sign them (GPG or SSH, with the key added to your GitHub account as a signing key), then force-push. GitHub's guide: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

luben93 and others added 2 commits November 16, 2026 18:34
exec start and attach answered 101 to every client. Docker does that only
for a request with an Upgrade header, and sends 200 OK with the raw stream
as the body otherwise. docker-java (Testcontainers) sends none, and read no
ExitCode from the exec.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@luben93
luben93 force-pushed the exec-start-200-without-upgrade branch from 9c0b257 to e54b809 Compare November 16, 2026 17:36
@luben93

luben93 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@libracoder both commits are signed now (SSH key added as a signing key) and show as Verified: 0247916 and e54b809. Could you take a look when you have time?

Since the last push I also ran the patched build as a separate Kiri Dev instance on macOS (arm64, installed 0.2.1 guest kernel and disk):

  • Testcontainers (Java 1.21.3) MongoDBContainer, Kafka and Ryuk start. The same test failed 3 of 3 times on unpatched 0.2.1.
  • The new exec check (tests/testcontainers-api.py, also run from tests/e2e.sh) passes here. On unpatched 0.2.1 it fails with "exec start without Upgrade answered 101".
  • tests/e2e.sh: 523 passed, 29 failed, 6 skipped. The failures come from how I ran it (Finder mount off, no Compose or buildx plugin in my throwaway docker config, no kiri-dev context for the login and push checks), plus bind-inotify, which I think needs a newer guest agent than the one I used. I did not rerun them on an unpatched build.
  • Not run: Windows, Linux, and the UI parity suite.

Related: #126 makes the same change for attach.

@libracoder
libracoder merged commit 4074bce into libracoder:main Nov 16, 2026
7 checks passed
libracoder pushed a commit that referenced this pull request Nov 16, 2026
…#390)

* Testcontainers' Mongo, and other exec-based containers, start on Kiri

exec start and attach answered 101 to every client. Docker does that only
for a request with an Upgrade header, and sends 200 OK with the raw stream
as the body otherwise. docker-java (Testcontainers) sends none, and read no
ExitCode from the exec.

* e2e: exec start answers 200 without Upgrade and 101 with it

---------

Co-authored-by: lucas persson <4030216+luben93@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exec start / attach answer 101 to clients that didn't ask to upgrade; Testcontainers reads no ExitCode

2 participants