Skip to content
Snippets Groups Projects
Unverified Commit 287a8b6e authored by Tomasz Maczukin's avatar Tomasz Maczukin
Browse files

Add faq entry describing how to handle missing zoneinfo.zip problem

parent f2060a0e
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ stages: ...@@ -8,6 +8,7 @@ stages:
variables: variables:
CI_IMAGE: registry.gitlab.com/gitlab-org/gitlab-ci-multi-runner:ci-1.7 CI_IMAGE: registry.gitlab.com/gitlab-org/gitlab-ci-multi-runner:ci-1.7
GOROOT: /usr/local/go
image: $CI_IMAGE image: $CI_IMAGE
......
...@@ -357,10 +357,14 @@ release_packagecloud: ...@@ -357,10 +357,14 @@ release_packagecloud:
# Releasing to https://packages.gitlab.com/runner/ # Releasing to https://packages.gitlab.com/runner/
@./ci/release_packagecloud "$$CI_JOB_NAME" @./ci/release_packagecloud "$$CI_JOB_NAME"
release_s3: prepare_index release_s3: prepare_zoneinfo prepare_index
# Releasing to S3 # Releasing to S3
@./ci/release_s3 @./ci/release_s3
prepare_zoneinfo:
# preparing the zoneinfo file
@cp $$GOROOT/lib/time/zoneinfo.zip out/
prepare_index: prepare_index:
# Preparing index file # Preparing index file
@./ci/prepare_index @./ci/prepare_index
......
...@@ -225,3 +225,70 @@ and the service should be started properly. ...@@ -225,3 +225,70 @@ and the service should be started properly.
[microsoft-manually-set-seservicelogonright]: https://technet.microsoft.com/en-us/library/dn221981 [microsoft-manually-set-seservicelogonright]: https://technet.microsoft.com/en-us/library/dn221981
[microsoft-ntrights-download]: https://www.microsoft.com/en-us/download/details.aspx?id=17657 [microsoft-ntrights-download]: https://www.microsoft.com/en-us/download/details.aspx?id=17657
[microsoft-ntrights-usage-on-win7]: https://technet.microsoft.com/en-us/library/dd548356(WS.10).aspx [microsoft-ntrights-usage-on-win7]: https://technet.microsoft.com/en-us/library/dd548356(WS.10).aspx
## 14. `zoneinfo.zip: no such file or directory` error when using `OffPeakTimezone`
In `v1.11.0` we've added a possibility to configure timezone in which `OffPeakPeriods`
are described. The feature should work on most Unix systems out of the box. However on some
Unix systems, and probably on most non-Unix systems (including Windows, for which we're providing
Runner's binaries), when used it will crash Runner at start with an error similar to:
```
Failed to load config Invalid OffPeakPeriods value: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
```
The error is caused by `time` package in Go. Go uses the IANA Time Zone database to load
configuration of specified timezone. On most Unix systems this database is already present on
one of well-known paths (`/usr/share/zoneinfo`, `/usr/share/lib/zoneinfo`, `/usr/lib/locale/TZ/`).
Go's `time` package looks for the Time Zone database in all three paths. If it will not find any
of them, but the machine has a configured Go development environment (with a proper `$GOPATH`
present for Runner's process) then it will fallback to the `$GOROOT/lib/time/zoneinfo.zip` file.
If none of these path is present (for example on a production Windows host) the above error is thrown.
In case if your system has support for IANA Time Zone database, but it's not available by default, you
can try to install it. For Linux systems it can be done for example by:
```bash
# on Debian/Ubuntu based systems
root@host:# apt-get install tzdata
# on RPM based systems
root@host:# yum install tzdata
# on Linux Alpine
root@host:# apk add -U tzdata
```
If your system doesn't provide this database in a _native_ way, then you can make `OffPeakTimezone`
working by:
1. Downloading the [`zoneinfo.zip`][zoneinfo-file]. Starting with version v9.1.0 you can download
the file from a tagged path. In that case you should replace `latest` with the tag name (e.g. `v9.1.0`)
in the `zoneinfo.zip` download URL.
1. Store this file in a well known directory. We're suggesting to use the same directory where
the `config.toml` file is present. So for example, if you're hosting Runner on Windows machine
and your config file is stored at `C:\gitlab-runner\config.toml` then save the `zoneinfo.zip`
at `C:\gitlab-runner\zoneinfo.zip`.
1. Set the `ZONEINFO` environment variable containing a full path to the `zoneinfo.zip` file. If you
are starting Runner using the `run` command, then you can do this by:
```bash
$ ZONEINFO=/etc/gitlab-runner/zoneinfo.zip gitlab-runner run [other options ...]
```
or
```powershell
C:\gitlab-runner> set ZONEINFO=C:\gitlab-runner\zoneinfo.zip
C:\gitlab-runner> gitlab-runner run [other options ...]
```
If you are starting Runner as a system service then you will need to update/override
service configuration in a way that is provided by your service manager software
(unix systems) or by adding the `ZONEINFO` variable to the list of environment variables
available for Runner's user through System Settings (Windows).
[zoneinfo-file]: https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/zoneinfo.zip
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment