Locale issues

Open
#199 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker

Research direction

Inspect the Dockerfile entries referenced around lines 17-18 and 40-41, then build or run the image and check its locale with the locale command. Confirm that a fresh container uses en_US.UTF-8 without manual locale-gen or environment setup; reproduce the reported JSON encoding case to verify the fix.

Written by the indexing model from the issue text.

Description

Locale is not properly set in the docker container

/__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/json-2.9.0/lib/json/common.rb:221:in `encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError)
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/json-2.9.0/lib/json/common.rb:221:in `parse'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/json-2.9.0/lib/json/common.rb:221:in `parse'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb:93:in `block in load_standards_database_new'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb:92:in `each'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb:92:in `load_standards_database_new'

The locale isn't actually set, so it's POSIX

root@d2baf72eee0d:/var/simdata/openstudio# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

I have to run

locale-gen en_US en_US.UTF-8
# Either this
update-locale LANG=en_us.UTF-8
# or this
export LANG=en_us.UTF-8

Then it works.


It's possible my setup for the actual test I'm running is different than plain usage, because this still does work

$ docker run -it --rm nrel/openstudio:3.8.0

root@d2baf72eee0d:/var/simdata/openstudio# gem install openstudio-standards
root@d2baf72eee0d:/var/simdata/openstudio# ruby -e "require 'openstudio-standards'"

But the locale should probably be set to en_US.UTF-8 since that was the intent given

https://github.com/NREL/docker-openstudio/blob/2b53f0925ec52cb0fd1eafeca7e2f6cc1dd6c36c/Dockerfile#L17-L18

and

https://github.com/NREL/docker-openstudio/blob/2b53f0925ec52cb0fd1eafeca7e2f6cc1dd6c36c/Dockerfile#L40-L41

Dominant language
Dockerfile
Stars
22
Forks
21
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NatLabRockies/docker-openstudio

All issues in NatLabRockies/docker-openstudio

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.