Skip to content

[REQ] Improved error messages for authentication failures with --push #1315

@duffney

Description

@duffney

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

When authentication to a container registry fails during patching operations, Copacetic produces a confusing "panic: send on closed channel" error instead of surfacing the underlying authentication error. The actual authentication error is only visible when debug logging is enabled.

Expected Behavior

Authentication failures should produce clear, actionable error messages that help users understand and resolve the issue, such as:

  • "Authentication failed: invalid credentials for registry docker.io"
  • "Registry authentication required but no credentials provided"
  • "Failed to authenticate to registry: [specific error details]"

Actual Behavior

Authentication failures result in a runtime panic with a confusing stack trace that doesn't indicate the root cause:

panic: send on closed channel
goroutine 320 [running]:
github.com/project-copacetic/copacetic/pkg/patch.ExecutePatchCore(0x0?, 0xc0008cdb80)
        /home/runner/work/copacetic/copacetic/pkg/patch/core.go:104 +0x813
github.com/project-copacetic/copacetic/pkg/patch.executePatchBuild.func1({0x135e8f0?, 0xc00003caf0?}, {0x1364a30?, 0xc0007b5d80?})
        /home/runner/work/copacetic/copacetic/pkg/patch/single.go:418 +0x128

Steps to Reproduce

  1. Attempt to patch a container image that requires authentication
  2. Use invalid credentials or no credentials
  3. Observe the panic instead of a clear authentication error
  4. Enable debug logging to see the actual authentication failure

Are you willing to submit PRs to contribute to this feature request?

  • Yes, I am willing to implement it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

🏗 In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions