Skip to content

fix: handle curl network errors in smoke test polling loop#265

Merged
DeepDiver1975 merged 1 commit intomasterfrom
fix/smoke-test-curl-exit-code
May 6, 2026
Merged

fix: handle curl network errors in smoke test polling loop#265
DeepDiver1975 merged 1 commit intomasterfrom
fix/smoke-test-curl-exit-code

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Contributor

Root cause

The smoke test step runs under bash -e -o pipefail. When Docker starts a container with -p 8080:8080 -d, the userland proxy binds the host port immediately and accepts TCP connections — before Apache inside the container is ready. While ownCloud's first-run SQLite installation is running, the proxy accepts the connection then immediately resets it. curl exits with code 56 (CURLE_RECV_ERROR — "failure in receiving network data"), which is non-zero and causes bash to abort the entire step with set -e.

The EXIT trap then runs docker stop with its default 10 s grace period, producing the characteristic ~10 s gap between Polling … and the ##[error]Process completed with exit code 56. seen in CI.

Fix

Add || STATUS="000" so curl network errors (exit codes 7, 56, etc.) are caught and treated as "not ready yet", allowing the loop to continue polling for the full 60 s.

Test plan

  • Re-run smoke test CI against owncloud-docker/server PR #600 — all matrix builds should poll through the init phase and get HTTP 200

🤖 Generated with Claude Code

With bash -e -o pipefail, a curl exit code 56 (CURLE_RECV_ERROR)
causes the polling loop to abort immediately on the first iteration.

This happens because Docker's userland proxy binds the host port and
accepts TCP connections right away, but then immediately resets them
while the container's init scripts are still running. The result is
a connection reset rather than ECONNREFUSED, so curl exits non-zero.

Add || STATUS="000" so connection-level errors are treated as "not
ready yet" and the loop continues polling until the 60 s timeout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975 DeepDiver1975 merged commit 9d357f8 into master May 6, 2026
5 checks passed
@DeepDiver1975 DeepDiver1975 deleted the fix/smoke-test-curl-exit-code branch May 6, 2026 05:00
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.

2 participants