OffPeakPeriods on Ubuntu 18.04 zoneinfo.zip: no such file or directory
Summary
Hello, I'm using 12.2 gitlab-runner installed from repo on Ubuntu 18.04
When I'm setting up OffPeakPeriods --machine-off-peak-timezone="Europe/Berlin"
, i'm getting this message:
Failed to load config Invalid OffPeakPeriods value: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
And indeed, there is no such file on ubuntu. As far as i understand, this is hardcoded path in Go.
As a workaround, i had to run
mkdir -p /usr/local/go/lib/time/
zip /usr/local/go/lib/time/zoneinfo.zip /usr/share/zoneinfo/
Which fixed a problem with not accessible file, but it's not what we want i think.
Steps to reproduce
Register runner on latest ubuntu 18.04 from cli with:
sudo gitlab-runner register \
-n \
--url "https://git.domain.com/" \
--registration-token "-" \
....
--machine-off-peak-timezone="Europe/Berlin"
Actual behavior
It fails to setup properly timezones, and according to documentation, it suppose to use local
, if not specified, but somehow it fails to use local, and scheduling is not working.
Expected behavior
Use Ubuntu default location for timezones:
/usr/share/zoneinfo/
Relevant logs and/or screenshots
Sep 3 18:36:07 ip-10-52-140-228 gitlab-runner[19738]: #033[31;1mERROR: Failed to load config Invalid OffPeakPeriods value: not a directory#033[0;m #033[31;1mbuilds#033[0;m=0
Sep 3 18:36:07 ip-10-52-140-228 gitlab-runner[19738]: message repeated 3 times: [ #033[31;1mERROR: Failed to load config Invalid OffPeakPeriods value: not a directory#033[0;m #033[31;1mbuilds#033[0;m=0]
Sep 3 18:36:58 ip-10-52-140-228 gitlab-runner[19738]: #033[31;1mERROR: Failed to load config Invalid OffPeakPeriods value: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory#033[0;m #033[31;1mbuilds#033[0;m=0
Sep 3 18:36:58 ip-10-52-140-228 gitlab-runner[19738]: message repeated 3 times: [ #033[31;1mERROR: Failed to load config Invalid OffPeakPeriods value: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory#033[0;m #033[31;1mbuilds#033[0;m=0]
Environment description
Custom runner-spawner setup, based on https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/
config.toml contents
concurrent = 100
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "runner-spawner"
limit = 15
output_limit = 10000000
request_concurrency = 2
url = "https://git.domain.com/"
token = "cut"
executor = "docker+machine"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "docker:19.03-dind"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/usr/bin/kubectl:/usr/bin/kubectl", "/var/run/docker.sock:/var/run/docker.sock", "/usr/bin/ec2metadata:/usr/bin/ec2metadata", "/home/gitlab-runner/.m2/repository:/root/.m2/repository", "/home/gitlab-runner/.npm:/root/.npm", "/home/gitlab-runner/.gradle/caches:/root/.gradle/caches", "/home/gitlab-runner/.gradle/wrapper:/root/.gradle/wrapper", "/builds:/root/builds", "/cache:/root/cache", "/cache"]
shm_size = 2147483648
[runners.cache]
Type = "s3"
Path = "cached"
Shared = true
[runners.cache.s3]
ServerAddress = "s3.amazonaws.com"
BucketName = "toolbox-np-s3-gitlab-runner-cache"
BucketLocation = "eu-central-1"
[runners.cache.gcs]
[runners.machine]
IdleCount = 1
IdleTime = 300
MachineDriver = "amazonec2"
MachineName = "gitlab-runner-machine-%s"
MachineOptions = ["amazonec2-request-spot-instance=true", "amazonec2-instance-type=c5.2xlarge", "amazonec2-spot-price=0.20", "amazonec2-root-size=50", "amazonec2-use-private-address=true", "amazonec2-private-address-only=true", "amazonec2-ssh-keypath=/home/gitlab-runner/.ssh/gitlab", "amazonec2-iam-instance-profile=profile-docker-builder", "amazonec2-region=eu-central-1", "amazonec2-zone=a", "amazonec2-vpc-id=vpc-92bc9efa", "amazonec2-subnet-id=subnet-014e396a", "amazonec2-ami=ami-0929425bb551543a4", "amazonec2-security-group=np-sg-git-runner", "amazonec2-tags=Name,np-ec2-gitlab-docker-machine-runner,topic,np,stage,np,application,runner-spawner,resourceManagedBy,terraform,systemManagedBy,ansible,executionItem,cut,costcenter,cut,contact,me@mail.com"]
OffPeakPeriods = ["* * 0-7,19-23 * * mon-fri *", "* * * * * sat,sun *"]
OffPeakTimezone = "Europe/Berlin"
OffPeakIdleCount = 0
OffPeakIdleTime = 300
Used GitLab Runner version
Version: 12.2.0
Git revision: a987417a
Git branch: 12-2-stable
GO version: go1.8.7
Built: 2019-08-22T13:06:00+0000
OS/Arch: linux/amd64