Skip to content

fix: replace efs-proxy bind panic with graceful error exit#355

Open
guessi wants to merge 1 commit into
aws:masterfrom
guessi:fix/efs-proxy-bind-panic-issue-323
Open

fix: replace efs-proxy bind panic with graceful error exit#355
guessi wants to merge 1 commit into
aws:masterfrom
guessi:fix/efs-proxy-bind-panic-issue-323

Conversation

@guessi

@guessi guessi commented Jun 17, 2026

Copy link
Copy Markdown

Problem

efs-proxy panics with an unhelpful Rust backtrace when it cannot bind to 127.0.0.1:<port>. This is reproducible in Bottlerocket/EKS containers and surfaces as:

thread 'main' panicked at src/controller.rs:89:13:
Failed to bind 127.0.0.1:20381

The mount then fails with a DeadlineExceeded or timeout error, giving the user no actionable information about the root cause.

Fixes #323

Change

  • Controller::new now returns Result<Self, io::Error> instead of panicking.
  • On bind failure, an error! log is emitted with the address and the OS error (e.g. permission denied, address already in use).
  • main() calls process::exit(1) on failure, producing a non-zero exit code that the mount helper already detects and surfaces in mount.log.

Testing

  • Existing cargo test suite passes.
  • Verified cargo build succeeds with no warnings on the changed files.

efs-proxy panicked with an unhelpful backtrace when it failed to bind
to 127.0.0.1:<port>. This manifested as a hard crash with no actionable
error message in environments like Bottlerocket/EKS containers where
the loopback bind can fail (e.g. permission denied, address in use).

Change Controller::new to return Result<Self, io::Error> and have
main() exit with code 1 and a clear error message instead of panicking.
The mount helper already detects a non-zero efs-proxy exit and surfaces
it to the user via mount.log.

Fixes aws#323
@guessi guessi force-pushed the fix/efs-proxy-bind-panic-issue-323 branch from f6e1db7 to d2fc42d Compare June 17, 2026 11:56
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.

EFS mount fails on Bottlerocket: efs-proxy cannot bind to localhost

1 participant