Gitlab API picking up system time zone instead of configured one from gitlab.yml
Hi
We have recently upgraded our omnibus-gitlab instance from 12.10
to 13.2.2
and there seems to a weird issue.
Summary
Our timezone in /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
file is pointing to time_zone: "Asia/Kolkata"
Our system timezone is configured to UTC Sun Aug 2 13:21:18 UTC 2020
. Before upgrade API used to give us timestamp in IST format only but post this upgrade the time for created_at
and other attribute is showing as UTC
.
Steps to reproduce
- Set system timezone to
UTC
- Set Gitlab timezone to
Asia/Kolkata
- Make API call to
Jobs
result would carrycreated_at
and other time specific attributes inUTC
format. which should have beenIST
Example Project
Tested on omnibus-Gitlab.
What is the current bug behavior?
Gitlab API should give output as per configuration of gitlab.yml
file but its taking system timezone.
What is the expected correct behavior?
Gitlab API should give output as per configuration of gitlab.yml
file
Relevant logs and/or screenshots
CMD: cat /var/opt/gitlab/gitlab-rails/etc/gitlab.yml | grep -5 'time_zone'
OUTPUT:
# Uncomment and customize if you can't use the default user to run GitLab (default: 'git')
user: git
## Date & Time settings
time_zone: "Asia/Kolkata"
## Email settings
# Uncomment and set to false if you need to disable email sending from GitLab (default: true)
email_enabled:
# Email address used in the "From" field in mails sent by GitLab
CMD: date
Output:
Sun Aug 2 13:21:18 UTC 2020
Output of checks
Possible fixes
One possible solution would be to change timezone for system, but I'm not sure if it will impact any other thing.