Docker-gitlab: Won't restart and no useful debug output when timezone setting wrong

Created on 14 Feb 2016  路  4Comments  路  Source: sameersbn/docker-gitlab

I received constant respawn and death of unicorn and sidekiq when starting the container.

I played only with environment variables TZ, GITLAB_TIMEZONE, GITLAB_HOST, GITLAB_SECRETS_DB_PASS and DEBUG.

After some fiddling I believe the problem was an invalid value in one of the timezone variables. I tried to set Asia/Shanghai and Shanghai.

You should probably validate these or fail loudly.

Setting them back to UTC fixed the problem, and this would arguably be a more intelligent default for a globally deployed software image.

All 4 comments

Sorry, this may be totally unrelated, but I just remembered this answer on StackOverflow :smile:

You need to set timezone to Beijing not Shanghai. Please refer http://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html. This is mentioned in the readme.

Wow. So you maintain this package and you are fine to use nonstandard timezone settings that fail silently? Way to care for your users. :-1:

@globalcitizen The configuration is Rails specific. Validating these parameters and reporting a sensible error, in this case, is left to rails. I try my best to catch configuration issues whenever possible while expecting users to make sense of errors message and refer to the README and the past issues when things don't go as expected.

In this specific case, the log clearly indicates that Shanghai is not a valid timezone.

gitlab_1     | Configuring gitlab-shell...
gitlab_1     | Setting up GitLab for firstrun. Please be patient, this could take a while...
gitlab_1     | rake aborted!
gitlab_1     | ArgumentError: Invalid Timezone: Shanghai
gitlab_1     | /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.1/lib/active_support/core_ext/time/zones.rb:72:in `rescue in find_zone!'

If you have a solution for cleanly handling this issue in some other way i'm all ears or better yet please send a PR with your solution.

FYI, GitLab Inc maintains an official docker image for GitLab which you can downloaded using:

# for community edition:

docker pull gitlab/gitlab-ce

# for enterprise edition

docker pull gitlab/gitlab-ee
Was this page helpful?
0 / 5 - 0 ratings