Bug 1404297 - Candlepin Docker Images UTF8
Summary: Candlepin Docker Images UTF8
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Alex Wood
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-13 14:55 UTC by Filip Nguyen
Modified: 2017-01-24 21:53 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-24 21:53:07 UTC


Attachments (Terms of Use)

Description Filip Nguyen 2016-12-13 14:55:29 UTC
Description of problem:
When I build Candlepin docker images, they don't have UTF8 locale. That breaks Candlepin checkstyle checks, linter and unit tests. 

This may be (pure speculation) caused by update to centos:7 base image that we use.

Version-Release number of selected component (if applicable):

How reproducible:
always

Steps to Reproduce:
1. cd candlepin/docker/candlepin-base/
2. sudo ./build.sh
3. cd candlepin/docker/candlepin-postgresql/
4. sudo ./build.sh
5. sudo docker run -i -P --rm -t -v art:/artifacts/ candlepin/candlepin-postgresql /bin/bash
6. cp-test -l -b jenkins -c "5fc768b7bf82f6ffcc23d14c3138879928b1c07e"

Actual results:
Bundle complete! 18 Gemfile dependencies, 52 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Running linter...
Buildr aborted!
ArgumentError : invalid byte sequence in US-ASCII

Expected results:
linter and checkstyle checks go through without an error

Additional info:
I currently use a workaround. I added the following at the end of our setup-*.sh scripts in candlepin-postgresql and candlepin-mysql images:

 localedef --quiet -v -c -i en_US -f UTF-8 en_US.UTF-8 || true
 echo "Locale output: "
 locale

The first line generates the locale and the command 'locale' is for debugging output.

Comment 1 Alex Wood 2017-01-24 21:53:07 UTC
I spent a few hours on this to no avail.  The candlepin-base image has LANG set to en_US.utf8 in the Dockerfile and the base image had UTF-8 locales (English only though according to `locale -a`).  If I ran a shell in the container and exported LANG to something like "es_ES.utf8" (a locale which the container doesn't even show as available), then I would see the "invalid byte sequence in US-ASCII" error, but I wasn't able to reproduce it with en_US.

Incidentally, if I ran `localedef --quiet -v -c -i es_ES -f UTF-8 es_ES.UTF-8` prior to running cp-test, I avoided the "invalid byte sequence" error.

I'm closing this for now as WORKSFORME.  If others run into it, they should feel free to reopen.


Note You need to log in before you can comment on or make changes to this bug.