Skip to content

Conversation

@shiavm006
Copy link
Contributor

@shiavm006 shiavm006 commented Nov 3, 2025

Problem

The remote client (podman --remote) incorrectly throws an error when --detach-keys="" is specified:

Error: invalid detach keys: Unknown character: ''

According to the documentation (docs/source/markdown/options/detach-keys.md):

Specifying "" disables this feature
The local client handles this correctly and was fixed in v1.7.0 (issue #5166), but the remote client was missed.

The remote client bindings call term.ToBytes() directly on the user-provided string, which fails for empty strings. The local implementation checks for empty string first before calling term.ToBytes().

Solution

Added the same empty string check in pkg/bindings/containers/attach.go that exists in the local code path (libpod/oci_conmon_attach_common.go:199):

if options.GetDetachKeys() == "" {
    detachKeysInBytes = []byte{}
} else {
    detachKeysInBytes, err = term.ToBytes(options.GetDetachKeys())
    // ...
}

Fixes: #27414

'None'

@mheon
Copy link
Member

mheon commented Nov 3, 2025

/approve
LGTM

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2025
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, can you squash your commits please into one and add Fixes: #27414 as part of the commit message to properly cross link the issue and have it closed on merge.

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

@zhangguanzhang
Copy link
Collaborator

need to rebase:

git rebase -i HEAD~2 

The remote client (podman --remote) was incorrectly throwing an error
when --detach-keys="" was specified for attach, run, or start commands.
According to documentation and the v1.7.0 release notes, specifying an
empty string should disable detaching, not cause an error.

Fixes: containers#27414

Signed-off-by: shiavm006 <shivammittal42006@gmail.com>
@shiavm006 shiavm006 force-pushed the fix-remote-detach-keys-empty-string branch from 061ed77 to c0ae1a9 Compare November 4, 2025 03:42
@shiavm006
Copy link
Contributor Author

Thanks, can you squash your commits please into one and add Fixes: #27414 as part of the commit message to properly cross link the issue and have it closed on merge.

thanks i missed that done.

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I am rerunning flaky tests.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Honny1, Luap99, mheon, shiavm006

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Honny1,Luap99,mheon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 4bd8730 into containers:main Nov 4, 2025
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

podman --remote run --detach-keys="" reports Error: invalid detach keys: Unknown character: ''

5 participants