Skip to content

executor=docker on windows server fails with level=error msg="Handler for POST /containers/create returned error: invalid --net: "

Bug Description

executor=docker on windows server fails with:

level=error msg="Handler for POST /containers/create returned error: invalid --net: "
level=error msg="HTTP Error" err="invalid --net: " statusCode=500

Steps to Reproduce

  1. Setup docker according to this instructions : https://msdn.microsoft.com/virtualization/windowscontainers/quick_start/inplace_setup?f=255&MSPPError=-2147217396

  2. Download and setup the runner. Config file generated:

concurrent = 1
[[runners]]
  url = "http://192.168.0.142/ci"
  token = "5ca774c09e6a4a5a9d5193d2d2fcee"
  name = "WIN-KPNG84Q4JJ9"
  executor = "docker"
  [runners.docker]
    host = "tcp://127.0.0.1:2375"
    image = "windowsservercore"
    privileged = false

3 - Start a run with --debug:

runner log:

time="2015-10-23T01:05:48-07:00" level=debug msg="0 Checking runner WIN-KPNG84Q4JJ9 url=http://192.168.0.142/ci token=5ca774c09e6a4a5a9d5193d2d2fcee executor=docker on 0"
time="2015-10-23T01:05:48-07:00" level=info msg="5ca774c0 Checking for builds... received"
time="2015-10-23T01:05:48-07:00" level=debug msg="0 Received new build for 5ca774c0 build 16"
time="2015-10-23T01:05:48-07:00" level=debug msg="1 Added a new build id: 16
projectid: 1
commands: |2-

  hostname
repourl: http://gitlab-ci-token:98afacf3da0ed3fb290f8518fbf6c5@192.168.0.142/root/test.git
sha: aca6c610ba4e28610f9363f0b8c7b2a0cf315d79
refname: master
beforesha: 18fc70ca91a9991839fadcdf9598ae73f980a31f
allowgitfetch: true
timeout: 3600
variables: []
options: {}
buildstate: \"\"
buildstarted: {}
buildfinished: {}
buildduration: \"0\"
runner:
  runnercredentials:
    url: http://192.168.0.142/ci
    token: 5ca774c09e6a4a5a9d5193d2d2fcee
  name: WIN-KPNG84Q4JJ9
  limit: null
  executor: docker
  buildsdir: null
  environment: []
  shell: null
  disableverbose: null
  outputlimit: null
  ssh: null
  docker:
    dockercredentials:
      host: tcp://127.0.0.1:2375
      certpath: null
      tlsverify: null
    hostname: null
    image: windowsservercore
    privileged: false
    disablecache: null
    volumes: []
    cachedir: null
    extrahosts: []
    links: []
    services: []
    waitforservicestimeout: null
    allowedimages: []
    allowedservices: []
  parallels: null
globalid: 0
runnerid: 0
projectrunnerid: 0
"
time="2015-10-23T01:05:48-07:00" level=info msg="5ca774c0 16 gitlab-ci-multi-runner 0.6.2 (3227f0a)"
time="2015-10-23T01:05:48-07:00" level=debug msg="5ca774c0 16 Shell script: environment:
- CI_BUILD_REF=aca6c610ba4e28610f9363f0b8c7b2a0cf315d79
- CI_BUILD_BEFORE_SHA=18fc70ca91a9991839fadcdf9598ae73f980a31f
- CI_BUILD_REF_NAME=master
- CI_BUILD_ID=16
- CI_BUILD_REPO=http://gitlab-ci-token:98afacf3da0ed3fb290f8518fbf6c5@192.168.0.142/root/test.git
- CI_PROJECT_ID=1
- CI_PROJECT_DIR=/builds/root/test
- CI=true
- CI_SERVER=yes
- CI_SERVER_NAME=GitLab CI
- CI_SERVER_VERSION=
- CI_SERVER_REVISION=
- GITLAB_CI=true
script: |-
  #!/usr/bin/env bash
  : | eval $'echo Running on $(hostname) via WIN-KPNG84Q4JJ9...\
echo\
\
export $\\'CI_BUILD_REF=aca6c610ba4e28610f9363f0b8c7b2a0cf315d79\\'\
export $\\'CI_BUILD_BEFORE_SHA=18fc70ca91a9991839fadcdf9598ae73f980a31f\\'\
export $\\'CI_BUILD_REF_NAME=master\\'\
export $\\'CI_BUILD_ID=16\\'\
export $\\'CI_BUILD_REPO=http://gitlab-ci-token:98afacf3da0ed3fb290f8518fbf6c5@192.168.0.142/root/test.git\\'\
export $\\'CI_PROJECT_ID=1\\'\
export $\\'CI_PROJECT_DIR=/builds/root/test\\'\
export $\\'CI=true\\'\
export $\\'CI_SERVER=yes\\'\
export $\\'CI_SERVER_NAME=GitLab CI\\'\
export $\\'CI_SERVER_VERSION=\\'\
export $\\'CI_SERVER_REVISION=\\'\
export $\\'GITLAB_CI=true\\'\
\
\
set -eo pipefail\
\
if [[ -d $\\'\\\\\\\\builds\\\\\\\\root\\\\\\\\test\\\\\\\\.git\\' ]]; then\
echo $\\'\\\\x1b[32;1mFetching changes...\\\\x1b[0;m\\'\
cd $\\'/builds/root/test\\'\
git clean -ffdx\
git reset --hard > /dev/null\
git remote set-url origin $\\'http://gitlab-ci-token:98afacf3da0ed3fb290f8518fbf6c5@192.168.0.142/root/test.git\\'\
git fetch origin\
else\
echo $\\'\\\\x1b[32;1mCloning repository...\\\\x1b[0;m\\'\
rm -rf $\\'/builds/root/test\\'\
mkdir -p $\\'/builds/root/test\\'\
git clone $\\'http://gitlab-ci-token:98afacf3da0ed3fb290f8518fbf6c5@192.168.0.142/root/test.git\\' $\\'/builds/root/test\\'\
cd $\\'/builds/root/test\\'\
fi\
echo $\\'\\\\x1b[32;1mChecking out aca6c610 as master...\\\\x1b[0;m\\'\
git checkout -qf aca6c610ba4e28610f9363f0b8c7b2a0cf315d79\
\
echo\
\
echo $\\'\\\\x1b[32;1m$ hostname\\\\x1b[0;m\\'\
hostname\
\
'
command: bash
arguments: []
passfile: false
extension: \"\"
"
time="2015-10-23T01:05:48-07:00" level=info msg="5ca774c0 16 Using Docker executor with image windowsservercore ..."
time="2015-10-23T01:05:48-07:00" level=debug msg="5ca774c0 16 Starting Docker command..."
time="2015-10-23T01:05:48-07:00" level=debug msg="5ca774c0 16 Removed container runner-5ca774c0-project-1-concurrent-0 with No such container: runner-5ca774c0-project-1-concurrent-0"
time="2015-10-23T01:05:48-07:00" level=debug msg="5ca774c0 16 Looking for image windowsservercore:latest ..."
time="2015-10-23T01:05:48-07:00" level=info msg="5ca774c0 16 Pulling docker image windowsservercore:latest ..."
time="2015-10-23T01:05:49-07:00" level=warning msg="5ca774c0 16 Cannot pull the latest version of image windowsservercore:latest : API error (500): manifest unknown: manifest unknown
"
time="2015-10-23T01:05:49-07:00" level=warning msg="5ca774c0 16 Locally found image will be used instead."
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 Creating services..."
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 Creating cache directories..."
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 Creating container runner-5ca774c0-project-1-concurrent-0 ..."
time="2015-10-23T01:05:49-07:00" level=error msg="5ca774c0 16 Build failed with: API error (500): invalid --net:
"
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 Build took 789.3315ms"
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 Waiting for build log updater to finish"
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 Build log updater finished."
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 Build log:  \x1b[32;1mgitlab-ci-multi-runner 0.6.2 (3227f0a)
\x1b[0;mUsing Docker executor with image windowsservercore ...
Pulling docker image windowsservercore:latest ...
\x1b[33;1mWARNING: Cannot pull the latest version of image windowsservercore:latest : API error (500): manifest unknown: manifest unknown

\x1b[0;m\x1b[33;1mWARNING: Locally found image will be used instead.
\x1b[0;m
\x1b[31;1mERROR: Build failed with: API error (500): invalid --net:

\x1b[0;m"
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 updateBuildLog Received finish."
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 PushTrace finished"
time="2015-10-23T01:05:49-07:00" level=info msg="5ca774c0 16 Submitting build to coordinator... ok"
time="2015-10-23T01:05:49-07:00" level=info msg="5ca774c0 16 Build finished."
time="2015-10-23T01:05:49-07:00" level=debug msg="0 Build removed id: 16
projectid: 1
commands: |2-

  hostname
repourl: http://gitlab-ci-token:98afacf3da0ed3fb290f8518fbf6c5@192.168.0.142/root/test.git
sha: aca6c610ba4e28610f9363f0b8c7b2a0cf315d79
refname: master
beforesha: 18fc70ca91a9991839fadcdf9598ae73f980a31f
allowgitfetch: true
timeout: 3600
variables: []
options: {}
buildstate: failed
buildstarted: {}
buildfinished: {}
buildduration: 789.3315ms
runner:
  runnercredentials:
    url: http://192.168.0.142/ci
    token: 5ca774c09e6a4a5a9d5193d2d2fcee
  name: WIN-KPNG84Q4JJ9
  limit: null
  executor: docker
  buildsdir: null
  environment: []
  shell: null
  disableverbose: null
  outputlimit: null
  ssh: null
  docker:
    dockercredentials:
      host: tcp://127.0.0.1:2375
      certpath: null
      tlsverify: null
    hostname: null
    image: windowsservercore
    privileged: false
    disablecache: null
    volumes: []
    cachedir: null
    extrahosts: []
    links: []
    services: []
    waitforservicestimeout: null
    allowedimages: []
    allowedservices: []
  parallels: null
globalid: 0
runnerid: 0
projectrunnerid: 0
"
time="2015-10-23T01:05:49-07:00" level=debug msg="5ca774c0 16 ReadTrace finished"
time="2015-10-23T01:05:51-07:00" level=debug msg="0 Feeding runners to channel"
time="2015-10-23T01:05:51-07:00" level=debug msg="0 Checking runner WIN-KPNG84Q4JJ9 url=http://192.168.0.142/ci token=5ca774c09e6a4a5a9d5193d2d2fcee executor=docker on 0"
time="2015-10-23T01:05:51-07:00" level=debug msg="5ca774c0 Checking for builds... nothing"

docker daemon log:

time="2015-10-23T01:05:48.412559100-07:00" level=debug msg="Calling GET /version"
time="2015-10-23T01:05:48.412559100-07:00" level=info msg="GET /v1.18/version"
time="2015-10-23T01:05:48.413571000-07:00" level=debug msg="Calling DELETE /containers/{name:.*}"
time="2015-10-23T01:05:48.413571000-07:00" level=info msg="DELETE /v1.18/containers/runner-5ca774c0-project-1-concurrent-0?force=1&v=1"
time="2015-10-23T01:05:48.413571000-07:00" level=error msg="Handler for DELETE /containers/{name:.*} returned error: no such id: runner-5ca774c0-project-1-concurrent-0"
time="2015-10-23T01:05:48.413571000-07:00" level=error msg="HTTP Error" err="no such id: runner-5ca774c0-project-1-concurrent-0" statusCode=404
time="2015-10-23T01:05:48.414593600-07:00" level=debug msg="Calling GET /images/{name:.*}/json"
time="2015-10-23T01:05:48.414593600-07:00" level=info msg="GET /v1.18/images/windowsservercore:latest/json"
time="2015-10-23T01:05:48.417722100-07:00" level=debug msg="Calling POST /images/create"
time="2015-10-23T01:05:48.417722100-07:00" level=info msg="POST /v1.18/images/create?fromImage=windowsservercore%3Alatest"
time="2015-10-23T01:05:48.417722100-07:00" level=debug msg="Trying to pull windowsservercore from https://registry-win-tp3.docker.io v2"
time="2015-10-23T01:05:48.504875000-07:00" level=debug msg="Fetched 1 base graphs at 2015-10-23 01:05:48.504875 -0700 PDT"
time="2015-10-23T01:05:48.506334200-07:00" level=debug msg="Reloaded graph with 3 grants expiring at 2017-03-22 19:04:46.713978458 +0000 UTC"
time="2015-10-23T01:05:48.868033800-07:00" level=debug msg="Pulling tag from V2 registry: \"latest\""
time="2015-10-23T01:05:49.195098700-07:00" level=debug msg="v2 error: errcode.Error manifest unknown: manifest unknown"
time="2015-10-23T01:05:49.195098700-07:00" level=debug msg="Error trying v2 registry: manifest unknown: manifest unknown"
time="2015-10-23T01:05:49.195098700-07:00" level=error msg="Handler for POST /images/create returned error: manifest unknown: manifest unknown"
time="2015-10-23T01:05:49.195098700-07:00" level=error msg="HTTP Error" err="manifest unknown: manifest unknown" statusCode=500
time="2015-10-23T01:05:49.197124700-07:00" level=debug msg="Calling POST /containers/create"
time="2015-10-23T01:05:49.197124700-07:00" level=info msg="POST /v1.18/containers/create?name=runner-5ca774c0-project-1-concurrent-0"
time="2015-10-23T01:05:49.197124700-07:00" level=error msg="Handler for POST /containers/create returned error: invalid --net: "
time="2015-10-23T01:05:49.197124700-07:00" level=error msg="HTTP Error" err="invalid --net: " statusCode=500