From 1b472c037faaa5a1e0b0a7da340ed5f9b003429f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 29 Jun 2021 18:51:25 -0700 Subject: [PATCH] ci-operator/step-registry/gather/aws-console: Use LC_ALL instead of PYTHONIOENCODING 24b834c01d (ci-operator/step-registry/gather/aws-console: UTF-8 for output, 2021-06-29, #19827) is not doing well in the wild. For example, [1]: INFO[2021-06-29T20:14:28Z] Gathering console logs for i-008f73fde1ef3f0dc 'ascii' codec can't encode character '\u2026' in position 13999: ordinal not in range(128) {"component":"entrypoint","error":"wrapped process failed: exit status 1","file":"prow/entrypoint/run.go:80","func":"k8s.io/test-infra/prow/entrypoint.Options.Run","level":"error","msg":"Error executing test process","severity":"error","time":"2021-06-29T20:14:27Z"} error: failed to execute wrapped command: exit status 1 Apparently the AWS CLI is not using Python's default stream encoding here. But from [2,3,4] there is the suggestion that LC_ALL=en_US.UTF-8 will help. [1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/periodic-ci-openshift-release-master-ci-4.9-e2e-aws/1409949910362492928 [2]: https://awscli.amazonaws.com/v2/documentation/api/latest/topic/config-vars.html#locale [3]: https://github.com/aws/aws-cli/blob/2.2.5/awscli/compat.py#L121-L146 [4]: https://docs.python.org/3/library/locale.html#locale.getpreferredencoding --- .../gather/aws-console/gather-aws-console-commands.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-operator/step-registry/gather/aws-console/gather-aws-console-commands.sh b/ci-operator/step-registry/gather/aws-console/gather-aws-console-commands.sh index 1cd70da0d1ed..c9bdf67b066a 100755 --- a/ci-operator/step-registry/gather/aws-console/gather-aws-console-commands.sh +++ b/ci-operator/step-registry/gather/aws-console/gather-aws-console-commands.sh @@ -37,6 +37,6 @@ REGION="$(jq -r .aws.region "${SHARED_DIR}/metadata.json")" cat "${TMPDIR}/node-provider-IDs.txt" | sort | grep . | uniq | while read -r INSTANCE_ID do echo "Gathering console logs for ${INSTANCE_ID}" - PYTHONIOENCODING=UTF-8:backslashreplace aws --region "${REGION}" ec2 get-console-output --instance-id "${INSTANCE_ID}" --output text > "${ARTIFACT_DIR}/${INSTANCE_ID}" & + LC_ALL=en_US.UTF-8 aws --region "${REGION}" ec2 get-console-output --instance-id "${INSTANCE_ID}" --output text > "${ARTIFACT_DIR}/${INSTANCE_ID}" & wait "$!" done