FS#51333 - [gitlab-ci-multi-runner] Wrong User-Agent

Attached to Project: Community Packages
Opened by Mathieu (mfc_alpha) - Tuesday, 11 October 2016, 22:39 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 23 May 2017, 18:04 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
gitlab-ci-multi-runner regularly ask gitlab-workhorse by HTTP if jobs are available.
When doing that, gitlab-workhorse check user agent given by the runner.
The user agent NORMALLY contains gitlab-runner version (e.g. 1.6.0~beta.167.g2b2bacc (1-5-stable; go1.6.3; linux/amd64)) that help gitlab-workhorse to behave differently.
(e.g use 204 http request instead of 404 and then avoid spamming journalctl https://gitlab.com/dblessing/gitlab-ce/commit/5fdd92df39030ba4297189a274b8055fbca4b580)

But our user agent contains "gitlab-ci-multi-runner dev (HEAD; go1.7.1; linux/amd64)" and completely miss the version number.


Additional info:
* 1.6.0-1

Steps to reproduce:
* activate gitlab runner and wait for log from gitlab-workhorse in journalctl
... gitlab-workhorse[558]: ... "POST /ci/api/v1/builds/register.json HTTP/1.1" 404 27 "" "gitlab-ci-multi-runner dev (HEAD; go1.7.1; linux/amd64)" 0.026087
* You can also use tcpdump to check the user-agent
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Tuesday, 23 May 2017, 18:04 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 13 October 2016, 11:18 GMT
Can you provide a patch against the PKGBUILD that will fix this for you?
Comment by Mathieu (mfc_alpha) - Thursday, 13 October 2016, 12:00 GMT
Not in a reasonable amount of time :)I've never player with a go based build system
Comment by Sven-Hendrik Haase (Svenstaro) - Sunday, 23 October 2016, 17:08 GMT
Does the issue persist in the current version of gitlab-ci-multi-runner? If so, please report an upstream bug.

EDIT: However, I do believe I have fixed the issue now by just building from the git repo directly which will enable the build script to find out its version.
Comment by Mathieu (mfc_alpha) - Monday, 24 October 2016, 20:05 GMT
Sadly, this is still not good : "gitlab-ci-multi-runner dev (HEAD; go1.7.3; linux/amd64)".
It looks like this information is build here : common/version.go.
The information written in this file are suppose to be override at runtime ? Rebuild at build time ?
Comment by Mathieu (mfc_alpha) - Monday, 24 October 2016, 20:38 GMT
Humm, looks like they are over-ridden at build time c.f. Makefile.
May be just add -X main.BRANCH=${pkgver} -X main.VERSION=${pkgver} to the build cmd in the PKGBUILD ?

In the original build, they are build this way:
REVISION := $(shell git rev-parse --short HEAD || echo unknown)
BRANCH := $(shell git show-ref | grep "$(REVISION)" | grep -v HEAD | awk '{print $$2}' | sed 's|refs/remotes/origin/||' | sed 's|refs/heads/||' | sort | head -n 1)
Comment by Sven-Hendrik Haase (Svenstaro) - Tuesday, 23 May 2017, 18:04 GMT
Should be fixed now.

Loading...