Skip to content

fix(create): report actual exit status when nsenter exits unsuccessfully#676

Open
mdryaan wants to merge 2 commits into
urunc-dev:main-pr676from
mdryaan:fix/nsenter-nil-error-wrap
Open

fix(create): report actual exit status when nsenter exits unsuccessfully#676
mdryaan wants to merge 2 commits into
urunc-dev:main-pr676from
mdryaan:fix/nsenter-nil-error-wrap

Conversation

@mdryaan
Copy link
Copy Markdown

@mdryaan mdryaan commented May 14, 2026

Description

handleNsenterRet in cmd/urunc/create.go wraps err with %w inthe branch that handles an unsuccessful nsenter exit. That branch isonly reachable when err == nil — the err != nil case is handled above it. The resulting error message always reads
"nsenter unsuccessful exit: <nil>", hiding the actual exit code.

Fixed by formatting the exit code from status.ExitCode() directly instead of wrapping err.

Related issues

How was this tested?

Fix verified by code inspection — the branch is only reachable when err is nil, making the %w wrap provably wrong. All CI checks pass locally:

  • golangci-lint run -v --timeout=5m — 0 issues
  • go test ./pkg/unikontainers/... ./internal/metrics/... ./pkg/network/... — PASS
  • make — builds successfully

LLM usage

N/A

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 6b01d06
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a06f9cd70396700081033bf

@cmainas
Copy link
Copy Markdown
Contributor

cmainas commented May 14, 2026

Hello @mdryaan ,

you will need to add yourself in https://github.com/urunc-dev/urunc/blob/main/.github/contributors.yaml

@mdryaan mdryaan force-pushed the fix/nsenter-nil-error-wrap branch 3 times, most recently from f3f17ca to 31917e1 Compare May 15, 2026 02:00
@mdryaan
Copy link
Copy Markdown
Author

mdryaan commented May 15, 2026

Hello @mdryaan ,

you will need to add yourself in https://github.com/urunc-dev/urunc/blob/main/.github/contributors.yaml

@cmainas Done! Please take a look

@cmainas
Copy link
Copy Markdown
Contributor

cmainas commented May 15, 2026

Hello @mdryaan ,

there are some conflicts that need to get resolved.

@mdryaan
Copy link
Copy Markdown
Author

mdryaan commented May 15, 2026

@cmainas Done

@cmainas
Copy link
Copy Markdown
Contributor

cmainas commented May 15, 2026

Hello @mdryaan ,

please do not use merge commits. Simply rebase your changes over main

Signed-off-by: mdryaan <alikhurshid842001@gmail.com>
@mdryaan mdryaan force-pushed the fix/nsenter-nil-error-wrap branch from 6b01d06 to ca2ca2e Compare May 15, 2026 18:52
Signed-off-by: mdryaan <alikhurshid842001@gmail.com>
Signed-off-by: Md Raiyan <alikhurshid842001@gmail.com>
@mdryaan mdryaan force-pushed the fix/nsenter-nil-error-wrap branch from ca2ca2e to 4dfc0e8 Compare May 15, 2026 18:59
@mdryaan
Copy link
Copy Markdown
Author

mdryaan commented May 15, 2026

Hey @cmainas Done! Also after merging this please have a look on #674, I think its ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report actual exit status when nsenter exits unsuccessfully

2 participants