Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpod: correctly pass env so alternative locales work #18863

Closed
wants to merge 2 commits into from

Conversation

haircommander
Copy link
Collaborator

in addition to b6167ce we also need to pass LANG. Do so, and add a test to verify

Does this PR introduce a user-facing change?

fixes containers/conmon#272

Fix a bug where locales weren't passed to conmon correctly, resulting in a crash if some characters were specified over CLI

@rhatdan
Copy link
Member

rhatdan commented Jun 12, 2023

/approve
LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, rhatdan

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2023
test/e2e/logs_test.go Outdated Show resolved Hide resolved
test/e2e/logs_test.go Outdated Show resolved Hide resolved
libpod/oci_conmon_common.go Show resolved Hide resolved
test/e2e/logs_test.go Outdated Show resolved Hide resolved
@haircommander haircommander force-pushed the lang-fix branch 2 times, most recently from b8d9c77 to ac9e9cc Compare June 15, 2023 16:53
@edsantiago
Copy link
Collaborator

Tests are failing on (1) all debian and (2) all containerized. Finding the common factor is left as an exercise for the reader.

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Friendly ping

@haircommander
Copy link
Collaborator Author

sorry I don't have bandwidth to find the issue with the failing tests. Does anyone have any to help me?

@edsantiago
Copy link
Collaborator

In debian-12 I see:

... --log-opt tag=äöüß quay.io/libpod/alpine:latest echo podman
conmon: option parsing failed: Invalid byte sequence in conversion input

Same in f38 container.

Maybe an old/bad version of conmon? Might be worth rebasing on main, since I think we have a new Debian VM?

Containers: maybe this diff could help?

diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index 3e88fed73..d55f034f4 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -96,7 +96,7 @@ EPOCH_TEST_COMMIT="$CIRRUS_BASE_SHA"                                                                                                         
 PASSTHROUGH_ENV_EXACT='CGROUP_MANAGER|DEST_BRANCH|DISTRO_NV|GOCACHE|GOPATH|GOSRC|NETWORK_BACKEND|OCI_RUNTIME|ROOTLESS_USER|SCRIPT_BASE|SKIP_USERNS|EC2_INST_TYPE|PODMAN_DB'
 
 # List of envariable patterns which must match AT THE BEGINNING of the name.
-PASSTHROUGH_ENV_ATSTART='CI|TEST'
+PASSTHROUGH_ENV_ATSTART='CI|TEST|LC_|LANG'
 
 # List of envariable patterns which can match ANYWHERE in the name
 PASSTHROUGH_ENV_ANYWHERE='_NAME|_FQIN'

in addition to containers@b6167ce
we also need to pass LANG. Do so, and add a test to verify

Signed-off-by: Peter Hunt <pehunt@redhat.com>
@haircommander
Copy link
Collaborator Author

thanks @edsantiago I have adopted your suggestions :)

@edsantiago
Copy link
Collaborator

Grumble. Try this instead:

PASSTHROUGH_ENV_ATSTART='CI|LANG|LC_|TEST'

Reason:

    # because passthrough_envars always returns a sorted list and (see
    # subshell comments above) we're incrementally adding to our env.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
@edsantiago
Copy link
Collaborator

Oh well, it was worth a try. Someone with access to hack/ci-vm.sh needs to look at what's going on in Debian.

@Luap99
Copy link
Member

Luap99 commented Aug 15, 2023

I took a quick look, I think this locale is simply not installed/generated on debian
From a hack/get_ci_vm I see

# locale -a
C
C.utf8
POSIX

So I would assume the answer is to make sure en_US.UTF-8 is there as well with locale-gen en_US.UTF-8, properly best to do this once at VM image build time.

@Luap99
Copy link
Member

Luap99 commented Aug 15, 2023

Closing in favor of #19635

@Luap99 Luap99 closed this Aug 15, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[logging] multibyte-characters break input conversion
5 participants