Build pod stuck Running with status Init:0/2

Solution Verified - Updated -

Environment

  • OpenShift Container Platform 3.9
  • OpenShift Container Platform 3.7
  • OpenShift Container Platform 3.6

Issue

  • Build pod is stuck with status Init:0/2, and this is causing deployments to fail. After increasing the log level, we can see something like the following:
Receiving source from STDIN as archive ...
Extracting...
bsdtar: Pathname can't be converted from UTF-8 to current locale.
bsdtar: Error exit delayed from previous errors.
  • We have a pod with one init container and two regular containers. The pod went from a running state to a pending state, and then flipped over to Init:0/2.

Resolution

  • Enure that the locale for the shell matches every locale in the image build.
  • Verify that en_US.utf8 is among the available locale on the machine:
locale -a | grep en_US.utf8
  • Remove the files from repository that contain non UTF-8 file names. When present, differences in locale will cause the compatibility errors that we see above.
  • This older KCS mentions that if you are not running the latest sub version of OCP 3.6 and 3.7, this issue will occur as well.

Root Cause

A locale is a geographic stamp in Linux and Unix systems that denotes time, language, and country for a program or shell session. On Red Hat systems, the global locale for the machine is located at /etc/sysconfig/i18n:

LANG="en_US.UTF-8"
SUPPORTED="en_IN.utf8:en_IN:en_US.UTF-8:en_US:en"

If you have locale conflicts, the build will throw the above error and fail.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.