"Can't verify CSRF token authenticity" on Gitlab Runner

Hi,

During upgrading GitLab (installed from source, currently at 12.4) at some point in time the CI started getting 403 errors while asking for jobs. However, it is able to fetch jobs and build them. In production.log I’m getting the following:

Started POST "/api/v4/jobs/request" for 163.172.129.77 at 2019-11-03 19:57:07 +0000
Processing by Gitlab::RequestForgeryProtection::Controller#index as JSON
  Parameters: {"info"=>{"name"=>"gitlab-runner", "version"=>"12.4.1", "revision"=>"05161b14", "platform"=>"linux", "architecture"=>"amd64", "executor"=>"docker", "shell"=>"bash", "features"=>{"variables"=>"[FILTERED]", "image"=>true, "services"=>true, "artifacts"=>true, "cache"=>true, "shared"=>false, "upload_multiple_artifacts"=>true, "upload_raw_artifacts"=>true, "session"=>true, "terminal"=>true, "refspecs"=>true, "masking"=>true, "proxy"=>false}}, "token"=>"[FILTERED]", "last_update"=>"ea51766d0f094112f52624cd7b7f92c4", "request_forgery_protection"=>{"info"=>{"name"=>"gitlab-runner", "version"=>"12.4.1", "revision"=>"05161b14", "platform"=>"linux", "architecture"=>"amd64", "executor"=>"docker", "shell"=>"bash", "features"=>{"variables"=>"[FILTERED]", "image"=>true, "services"=>true, "artifacts"=>true, "cache"=>true, "shared"=>false, "upload_multiple_artifacts"=>true, "upload_raw_artifacts"=>true, "session"=>true, "terminal"=>true, "refspecs"=>true, "masking"=>true, "proxy"=>false}}, "token"=>"[FILTERED]", "last_update"=>"ea51766d0f094112f52624cd7b7f92c4"}}
Can't verify CSRF token authenticity.
This CSRF token verification failure is handled internally by `GitLab::RequestForgeryProtection`
Unlike the logs may suggest, this does not result in an actual 422 response to the user
For API requests, the only effect is that `current_user` will be `nil` for the duration of the request
Completed 422 Unprocessable Entity in 1ms (ActiveRecord: 0.0ms | Elasticsearch: 0.0ms)

In the runner logs I get:

ERROR: Checking for jobs... forbidden               runner=[some key]

Why is that happening?