Artifact download fails with FATAL: Missing runner credentials
Summary
Customer raised a ticket as their jobs were intermittently failing with
Downloading artifacts
00:00
Downloading artifacts for something-or-other (12345)...
FATAL: Missing runner credentials
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
GitLab team members can read more in the ticket.
There are no issues referring to this error, and no solution was found for the only other support ticket for this problem.
Steps to reproduce
Unknown
Actual behavior
It seems improbable that the failure is as described, exactly. The git clone
/ git fetch
runs immediately prior, and this succeeds, so the job has credentials.
Clearer guidance required on why artifacts-downloader
is unable to execute.
Expected behavior
Code is more precise about the problem so we can troubleshoot it.
if c.URL == "" || c.Token == "" {
logrus.Fatalln("Missing runner credentials")
}
if c.ID <= 0 {
logrus.Fatalln("Missing build ID")
}
args := []string{
"artifacts-downloader",
"--url",
info.Build.Runner.URL,
"--token",
job.Token,
"--id",
strconv.FormatInt(job.ID, 10),
}
-
if c.URL == "" || c.Token == ""
doesn't just test credentials, it also tests the URL, so this could be a missing URL. - Separating the test would be good.
- Given the order of parameters passed by
abstract.go
it would useful to know if theurl
was passed at all .. and if so, what it is. If it were poisoning the parameters somehow, it might not be seeing--token
or--id
at all.
Relevant logs and/or screenshots
job log
Add the job log
Environment description
config.toml contents
Add your configuration here
Used GitLab Runner version
14.8.2 Helm deployment