Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker task does not run under Network Service account #4449

Closed
artisticcheese opened this issue Jun 2, 2017 · 10 comments
Closed

Docker task does not run under Network Service account #4449

artisticcheese opened this issue Jun 2, 2017 · 10 comments
Assignees

Comments

@artisticcheese
Copy link

artisticcheese commented Jun 2, 2017

Agent version and platform

Version of your agent? 2.112.o


Windows 2016

VSTS type and version

On-prem TFS 2017 RTM


## **What's not working?**

Running docker client does not work if it runs under Network Service account as service

error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.27/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=iis&ulimits=null: open //./pipe/docker_engine: Access is denied. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

C:\Program Files\Docker\docker.exe failed with return code: 1

Build logs

2017-06-02T00:49:30.4362152Z ##[section]Starting: Build an image
2017-06-02T00:49:30.4591971Z ==============================================================================
2017-06-02T00:49:30.4591971Z Task         : Docker
2017-06-02T00:49:30.4591971Z Description  : Build, push or run Docker images, or run a Docker command
2017-06-02T00:49:30.4591971Z Version      : 0.3.1
2017-06-02T00:49:30.4591971Z Author       : Microsoft Corporation
2017-06-02T00:49:30.4591971Z Help         : [More Information](http://aka.ms/dockertoolsforvsts)
2017-06-02T00:49:30.4591971Z ==============================================================================
2017-06-02T00:49:30.8292042Z [command]C:\agent\externals\git\cmd\git.exe tag --points-at 42ee50122b6d8fe85b06a44fa9d44e93cc4a4a70
2017-06-02T00:49:30.8602107Z 
2017-06-02T00:49:30.8612091Z [command]C:\Program Files\Docker\docker.exe build -f C:/agent/_work/1/s/Dockerfile -t iis C:/agent/_work/1/s
2017-06-02T00:49:30.8912059Z error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.27/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=iis&ulimits=null: open //./pipe/docker_engine: Access is denied. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
2017-06-02T00:49:30.9012072Z ##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
2017-06-02T00:49:30.9032055Z ##[section]Finishing: Build an image

Diag logs

[2017-06-02 00:49:27Z INFO Program] Version: 2.112.0
[2017-06-02 00:49:27Z INFO Program] Commit: 7f51dc44f64f29b26d5f0f00c26f99352201418e
[2017-06-02 00:49:27Z INFO Program] Culture: en-US
[2017-06-02 00:49:27Z INFO Program] UI Culture: en-US
[2017-06-02 00:49:27Z INFO ProxyConfiguration] No proxy setting found.
[2017-06-02 00:49:27Z INFO Worker] Waiting to receive the job message from the channel.
[2017-06-02 00:49:27Z INFO Worker] Message received.
[2017-06-02 00:49:27Z INFO Worker] Job message:
 {
  "tasks": [
    {
      "instanceId": "c854d12d-06d3-433b-9c05-6c46b7ce1752",
      "displayName": "Build an image",
      "enabled": true,
      "continueOnError": false,
      "alwaysRun": false,
      "timeoutInMinutes": 0,
      "id": "b93c4522-5bea-4118-97ae-2b560628a157",
      "name": "Docker",
      "version": "0.3.1",
      "inputs": {
        "dockerRegistryEndpoint": "",
        "action": "Build an image",
        "dockerFile": "**/Dockerfile",
        "buildArguments": "",
        "defaultContext": "true",
        "context": "",
        "imageName": "iis",
        "qualifyImageName": "true",
        "additionalImageTags": "",
        "includeSourceTags": "true",
        "includeLatestTag": "true",
        "imageDigestFile": "",
        "containerName": "",
        "ports": "",
        "volumes": "",
        "envVars": "",
        "workDir": "",
        "entrypoint": "",
        "containerCommand": "",
        "detached": "true",
        "restartPolicy": "no",
        "restartMaxRetries": "",
        "customCommand": "",
        "dockerHostEndpoint": "",
        "cwd": "$(System.DefaultWorkingDirectory)"
      }
    }
  ],
  "requestId": 24,
  "lockToken": "00000000-0000-0000-0000-000000000000",
  "lockedUntil": "0001-01-01T00:00:00",
  "messageType": "JobRequest",
  "plan": {
    "scopeIdentifier": "4fc59037-0c1e-4bc8-ac7d-9217dfe09257",
    "planType": "Build",
    "version": 8,
    "planId": "2a4cf82e-5564-4aca-85eb-61f8ab47816c",
    "artifactUri": "vstfs:///Build/Build/24",
    "artifactLocation": null
  },
  "timeline": {
    "id": "11125a5e-1c56-4a5a-8d97-83eab8a2e0e6",
    "changeId": 1,
    "location": null
  },
  "jobId": "cc6b0513-6ec9-439d-98b0-515650045dd1",
  "jobName": "Build",
  "environment": {
    "endpoints": [
      {
        "data": {
          "repositoryId": "6eb0caf9-3587-407f-9960-e5140d06985c",
          "rootFolder": null,
          "clean": "false",
          "checkoutSubmodules": "False",
          "onpremtfsgit": "True",
          "fetchDepth": "0",
          "gitLfsSupport": "false",
          "skipSyncSource": "false",
          "cleanOptions": "0"
        },
        "name": "IIS",
        "type": "TfsGit",
        "url": "https://vsts/tfs/DefaultCollection/_git/IIS",
        "authorization": {
          "parameters": {
            "AccessToken": ********
          },
          "scheme": "OAuth"
        },
        "isReady": false
      }
    ],
    "mask": [
      {
        "type": "regex",
        "value": ********
      },
      {
        "type": "regex",
        "value": ********
      },
      {
        "type": "regex",
        "value": ********
      },
      {
        "type": "regex",
        "value": ********
      }
    ],
    "variables": {
      "system": "build",
      "system.collectionId": "d9b71250-ec52-4a51-8aa0-c9ca1acc4d7d",
      "system.teamProject": "IIS",
      "system.teamProjectId": "4fc59037-0c1e-4bc8-ac7d-9217dfe09257",
      "system.definitionId": "1",
      "build.definitionName": "Build Docker",
      "build.definitionVersion": "4",
      "build.queuedBy": "Administrator",
      "build.queuedById": "651176f4-d42b-4be8-ba0f-5a60f8d65eee",
      "build.requestedFor": "Administrator",
      "build.requestedForId": "651176f4-d42b-4be8-ba0f-5a60f8d65eee",
      "build.requestedForEmail": "",
      "build.sourceVersion": "42ee50122b6d8fe85b06a44fa9d44e93cc4a4a70",
      "build.sourceBranch": "refs/heads/master",
      "build.sourceBranchName": "master",
      "system.debug": "false",
      "BuildConfiguration": "Release",
      "BuildPlatform": "x64",
      "build.buildId": "24",
      "build.buildUri": "vstfs:///Build/Build/24",
      "build.buildNumber": "20170601.16",
      "build.containerId": "28",
      "system.isScheduled": "False",
      "system.hosttype": "build",
      "system.culture": "en-US",
      "system.teamFoundationCollectionUri": "https://vsts/tfs/DefaultCollection/",
      "system.taskDefinitionsUri": "https://vsts/tfs/DefaultCollection/",
      "AZURE_HTTP_USER_AGENT": "TFS_d9b71250-ec52-4a51-8aa0-c9ca1acc4d7d_build_1_24",
      "MSDEPLOY_HTTP_USER_AGENT": "TFS_d9b71250-ec52-4a51-8aa0-c9ca1acc4d7d_build_1_24",
      "system.planId": "2a4cf82e-5564-4aca-85eb-61f8ab47816c",
      "system.jobId": "cc6b0513-6ec9-439d-98b0-515650045dd1",
      "system.timelineId": "11125a5e-1c56-4a5a-8d97-83eab8a2e0e6",
      "build.repository.uri": "https://vsts/tfs/DefaultCollection/_git/IIS",
      "build.sourceVersionAuthor": "Administrator",
      "build.sourceVersionMessage": "Updated dockerfile"
    },
    "systemConnection": {
      "data": {
        "ServerId": "d9b71250-ec52-4a51-8aa0-c9ca1acc4d7d",
        "ServerName": "DefaultCollection"
      },
      "name": "SystemVssConnection",
      "url": "https://vsts/tfs/DefaultCollection/",
      "authorization": {
        "parameters": {
          "AccessToken": ********
        },
        "scheme": "OAuth"
      },
      "isReady": false
    }
  }
}
[2017-06-02 00:49:27Z INFO JobRunner] Job ID cc6b0513-6ec9-439d-98b0-515650045dd1
[2017-06-02 00:49:27Z INFO ConfigurationStore] currentAssemblyLocation: C:\agent\bin\Agent.Worker.dll
[2017-06-02 00:49:27Z INFO ConfigurationStore] binPath: C:\agent\bin
[2017-06-02 00:49:27Z INFO ConfigurationStore] RootFolder: C:\agent
[2017-06-02 00:49:27Z INFO ConfigurationStore] ConfigFilePath: C:\agent\.agent
[2017-06-02 00:49:27Z INFO ConfigurationStore] CredFilePath: C:\agent\.credentials
[2017-06-02 00:49:27Z INFO ConfigurationStore] ServiceConfigFilePath: C:\agent\.service
[2017-06-02 00:49:28Z INFO JobRunner] Ensure endpoint url match config url base. https://vsts/tfs/DefaultCollection/_git/IIS
[2017-06-02 00:49:28Z INFO JobRunner] Ensure System.TaskDefinitionsUrl match config url base. https://vsts/tfs/DefaultCollection/
[2017-06-02 00:49:28Z INFO JobRunner] Ensure System.TFCollectionUrl match config url base. https://vsts/tfs/DefaultCollection/
[2017-06-02 00:49:28Z INFO JobRunner] Ensure SystemConnection url match config url base. https://vsts/tfs/DefaultCollection/
[2017-06-02 00:49:28Z INFO JobRunner] Ensure System.TFServerUrl match config url base. https://vsts/tfs/DefaultCollection/
[2017-06-02 00:49:28Z INFO JobRunner] Creating job server with URL: https://vsts/tfs/DefaultCollection/
[2017-06-02 00:49:28Z INFO Worker] Listening for cancel message from the channel.
[2017-06-02 00:49:28Z INFO Worker] Waiting for the job to complete or for a cancel message from the channel.
[2017-06-02 00:49:28Z INFO JobServerQueue] Start process web console line queue.
[2017-06-02 00:49:28Z INFO JobServerQueue] Start process file upload queue.
[2017-06-02 00:49:28Z INFO JobServerQueue] Start process timeline update queue.
[2017-06-02 00:49:29Z INFO JobRunner] Starting the job execution context.
[2017-06-02 00:49:29Z INFO HostContext] Well known directory 'Bin': 'C:\agent\bin'
[2017-06-02 00:49:29Z INFO HostContext] Well known directory 'Root': 'C:\agent'
[2017-06-02 00:49:29Z INFO HostContext] Well known directory 'Work': 'C:\agent\_work'
[2017-06-02 00:49:29Z INFO JobRunner] Validating directory permissions for: 'C:\agent\_work'
[2017-06-02 00:49:29Z INFO JobRunner] Creating task server with https://vsts/tfs/DefaultCollection/
[2017-06-02 00:49:29Z INFO JobRunner] Getting job extensions.
[2017-06-02 00:49:29Z INFO ExtensionManager] Getting extensions for interface: 'Microsoft.VisualStudio.Services.Agent.Worker.IJobExtension'
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildJobExtension, Agent.Worker
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Release.ReleaseJobExtension, Agent.Worker
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Release.DeploymentJobExtension, Agent.Worker
[2017-06-02 00:49:29Z INFO JobRunner] Adding job prepare extensions.
[2017-06-02 00:49:29Z INFO JobRunner] Adding tasks.
[2017-06-02 00:49:29Z INFO JobRunner] Adding job finally extensions.
[2017-06-02 00:49:29Z INFO JobRunner] Downloading task definitions.
[2017-06-02 00:49:29Z INFO TaskManager] Ensuring task exists: ID 'b93c4522-5bea-4118-97ae-2b560628a157', version '0.3.1', name 'Docker', directory 'C:\agent\_work\_tasks\Docker_b93c4522-5bea-4118-97ae-2b560628a157\0.3.1'.
[2017-06-02 00:49:29Z INFO TaskManager] Task already downloaded.
[2017-06-02 00:49:29Z INFO StepsRunner] Processing step: DisplayName='Get Sources', AlwaysRun=False, ContinueOnError=False, Critical=True, Enabled=True, Finally=False
[2017-06-02 00:49:29Z INFO StepsRunner] Starting the step.
[2017-06-02 00:49:29Z INFO ExtensionManager] Getting extensions for interface: 'Microsoft.VisualStudio.Services.Agent.Worker.Build.ISourceProvider'
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.ExternalGitSourceProvider, Agent.Worker
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.GitHubSourceProvider, Agent.Worker
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.SvnSourceProvider, Agent.Worker
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsGitSourceProvider, Agent.Worker
[2017-06-02 00:49:29Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsVCSourceProvider, Agent.Worker
[2017-06-02 00:49:29Z INFO BuildDirectoryManager] Checking if artifacts directory exists: 'C:\agent\_work\1\a'
[2017-06-02 00:49:29Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2017-06-02 00:49:29Z INFO BuildDirectoryManager] Creating artifacts directory.
[2017-06-02 00:49:29Z INFO BuildDirectoryManager] Checking if test results directory exists: 'C:\agent\_work\1\TestResults'
[2017-06-02 00:49:29Z INFO BuildDirectoryManager] Creating test results directory.
[2017-06-02 00:49:29Z INFO SourceProvider] Get 'SourcesDirectory': 'C:\agent\_work\1\s'
[2017-06-02 00:49:29Z INFO SourceProvider] Get 'SourceBranch': 'refs/heads/master'
[2017-06-02 00:49:29Z INFO SourceProvider] Get 'SourceVersion': '42ee50122b6d8fe85b06a44fa9d44e93cc4a4a70'
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] Repository url=https://vsts/tfs/DefaultCollection/_git/IIS
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] targetPath=C:\agent\_work\1\s
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] sourceBranch=refs/heads/master
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] sourceVersion=42ee50122b6d8fe85b06a44fa9d44e93cc4a4a70
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] clean=False
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] checkoutSubmodules=False
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] exposeCred=False
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] fetchDepth=0
[2017-06-02 00:49:29Z INFO TfsGitSourceProvider] gitLfsSupport=False
[2017-06-02 00:49:29Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:29Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Arguments: 'version'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:29Z INFO ProcessInvoker] Process started with process id 4652, waiting for process exit.
[2017-06-02 00:49:29Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.0539277.
[2017-06-02 00:49:29Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:29Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Arguments: 'config --get remote.origin.url'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:29Z INFO ProcessInvoker] Process started with process id 4188, waiting for process exit.
[2017-06-02 00:49:29Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.0436125.
[2017-06-02 00:49:29Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:29Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Arguments: 'config gc.auto 0'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:29Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:29Z INFO ProcessInvoker] Process started with process id 4944, waiting for process exit.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.0491218.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:30Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Arguments: 'config --get-all http.https://vsts/tfs/DefaultCollection/_git/IIS.extraheader'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Process started with process id 3556, waiting for process exit.
[2017-06-02 00:49:30Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Finished process with exit code 1, and elapsed time 00:00:00.0400790.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:30Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Arguments: 'config --get-all http.proxy'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Process started with process id 3128, waiting for process exit.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Finished process with exit code 1, and elapsed time 00:00:00.0421449.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:30Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Arguments: '-c http.extraheader="AUTHORIZATION: bearer ********" fetch --tags --prune --progress origin'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Process started with process id 3404, waiting for process exit.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.2579833.
[2017-06-02 00:49:30Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:30Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Arguments: 'checkout --progress --force 42ee50122b6d8fe85b06a44fa9d44e93cc4a4a70'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Process started with process id 820, waiting for process exit.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.0428953.
[2017-06-02 00:49:30Z INFO StepsRunner] Step result: 
[2017-06-02 00:49:30Z INFO StepsRunner] Current state: job state = '', step failed = False, critical step failed = False
[2017-06-02 00:49:30Z INFO StepsRunner] Processing step: DisplayName='Build an image', AlwaysRun=False, ContinueOnError=False, Critical=False, Enabled=True, Finally=False
[2017-06-02 00:49:30Z INFO StepsRunner] Starting the step.
[2017-06-02 00:49:30Z INFO TaskManager] Loading task definition 'C:\agent\_work\_tasks\Docker_b93c4522-5bea-4118-97ae-2b560628a157\0.3.1\task.json'.
[2017-06-02 00:49:30Z INFO ExtensionManager] Getting extensions for interface: 'Microsoft.VisualStudio.Services.Agent.Worker.IJobExtension'
[2017-06-02 00:49:30Z INFO BuildJobExtension] Build JobExtension resolving path use source provide: **\Dockerfile
[2017-06-02 00:49:30Z INFO BuildJobExtension] The Default Path Root of Build JobExtension is build.sourcesDirectory: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO BuildJobExtension] After prefix Default Path Root provide by JobExtension: C:\agent\_work\1\s\**\Dockerfile
[2017-06-02 00:49:30Z ERR  BuildJobExtension] System.ArgumentException: Illegal characters in path.
Parameter name: path
   at System.IO.Path.GetFullPath(String path)
   at Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildJobExtension.GetRootedPath(IExecutionContext context, String path)
[2017-06-02 00:49:30Z INFO BuildJobExtension] After prefix Default Path Root provide by JobExtension, the Path is a rooted path, but it is not full qualified, return the path: C:\agent\_work\1\s\**\Dockerfile.
[2017-06-02 00:49:30Z INFO TaskRunner] build JobExtension resolved a rooted path:: C:\agent\_work\1\s\**\Dockerfile
[2017-06-02 00:49:30Z INFO ExtensionManager] Getting extensions for interface: 'Microsoft.VisualStudio.Services.Agent.Worker.IJobExtension'
[2017-06-02 00:49:30Z INFO BuildJobExtension] Build JobExtension resolving path use source provide: 
[2017-06-02 00:49:30Z INFO BuildJobExtension] The Default Path Root of Build JobExtension is build.sourcesDirectory: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO BuildJobExtension] After prefix Default Path Root provide by JobExtension: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO BuildJobExtension] Return absolute path after prefix DefaultPathRoot: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO TaskRunner] build JobExtension resolved a rooted path:: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO ExtensionManager] Getting extensions for interface: 'Microsoft.VisualStudio.Services.Agent.Worker.IJobExtension'
[2017-06-02 00:49:30Z INFO BuildJobExtension] Build JobExtension resolving path use source provide: 
[2017-06-02 00:49:30Z INFO BuildJobExtension] The Default Path Root of Build JobExtension is build.sourcesDirectory: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO BuildJobExtension] After prefix Default Path Root provide by JobExtension: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO BuildJobExtension] Return absolute path after prefix DefaultPathRoot: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO TaskRunner] build JobExtension resolved a rooted path:: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO TaskRunner] The original input is a rooted path, return absolute path: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO ExtensionManager] Getting extensions for interface: 'Microsoft.VisualStudio.Services.Agent.Worker.IJobExtension'
[2017-06-02 00:49:30Z INFO BuildJobExtension] Build JobExtension resolving path use source provide: 
[2017-06-02 00:49:30Z INFO BuildJobExtension] The Default Path Root of Build JobExtension is build.sourcesDirectory: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO BuildJobExtension] After prefix Default Path Root provide by JobExtension: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO BuildJobExtension] Return absolute path after prefix DefaultPathRoot: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO TaskRunner] build JobExtension resolved a rooted path:: C:\agent\_work\1\s
[2017-06-02 00:49:30Z INFO ExtensionManager] Getting extensions for interface: 'Microsoft.VisualStudio.Services.Agent.Worker.IWorkerCommandExtension'
[2017-06-02 00:49:30Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.TaskCommandExtension, Agent.Worker
[2017-06-02 00:49:30Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.ArtifactCommandExtension, Agent.Worker
[2017-06-02 00:49:30Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildCommandExtension, Agent.Worker
[2017-06-02 00:49:30Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.CodeCoverage.CodeCoverageCommandExtension, Agent.Worker
[2017-06-02 00:49:30Z INFO ExtensionManager] Creating instance: Microsoft.VisualStudio.Services.Agent.Worker.TestResults.ResultsCommandExtension, Agent.Worker
[2017-06-02 00:49:30Z INFO WorkerCommandManager] Register command extension for area task
[2017-06-02 00:49:30Z INFO WorkerCommandManager] Register command extension for area artifact
[2017-06-02 00:49:30Z INFO WorkerCommandManager] Register command extension for area build
[2017-06-02 00:49:30Z INFO WorkerCommandManager] Register command extension for area codecoverage
[2017-06-02 00:49:30Z INFO WorkerCommandManager] Register command extension for area results
[2017-06-02 00:49:30Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:30Z INFO ProcessInvoker]   File name: 'C:\agent\externals\node\bin\node.exe'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Arguments: '"C:\agent\_work\_tasks\Docker_b93c4522-5bea-4118-97ae-2b560628a157\0.3.1\docker.js"'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Require exit code zero: 'True'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Process started with process id 1260, waiting for process exit.
[2017-06-02 00:49:30Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.3545273.
[2017-06-02 00:49:30Z INFO StepsRunner] Step result: Failed
[2017-06-02 00:49:30Z INFO StepsRunner] Current state: job state = 'Failed', step failed = True, critical step failed = False
[2017-06-02 00:49:30Z INFO StepsRunner] Processing step: DisplayName='Post Job Cleanup', AlwaysRun=False, ContinueOnError=False, Critical=False, Enabled=True, Finally=True
[2017-06-02 00:49:30Z INFO StepsRunner] Starting the step.
[2017-06-02 00:49:30Z INFO SourceProvider] Get 'SourcesDirectory': 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:30Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Arguments: 'remote set-url origin https://vsts/tfs/DefaultCollection/_git/IIS'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Process started with process id 4844, waiting for process exit.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.0501485.
[2017-06-02 00:49:30Z INFO ProcessInvoker] Starting process:
[2017-06-02 00:49:30Z INFO ProcessInvoker]   File name: 'C:\agent\externals\git\cmd\git.exe'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Arguments: 'remote set-url --push origin https://vsts/tfs/DefaultCollection/_git/IIS'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Working directory: 'C:\agent\_work\1\s'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Require exit code zero: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Encoding web name: utf-8 ; code page: '65001'
[2017-06-02 00:49:30Z INFO ProcessInvoker]   Force kill process on cancellation: 'False'
[2017-06-02 00:49:30Z INFO ProcessInvoker] Process started with process id 808, waiting for process exit.
[2017-06-02 00:49:31Z INFO ProcessInvoker] Finished process with exit code 0, and elapsed time 00:00:00.0452231.
[2017-06-02 00:49:31Z INFO StepsRunner] Step result: 
[2017-06-02 00:49:31Z INFO StepsRunner] Current state: job state = 'Failed', step failed = True, critical step failed = False
[2017-06-02 00:49:31Z INFO JobRunner] Job result: Failed
[2017-06-02 00:49:31Z INFO JobRunner] Completing the job execution context.
[2017-06-02 00:49:31Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2017-06-02 00:49:31Z INFO JobRunner] Shutting down the job server queue.
[2017-06-02 00:49:31Z INFO JobServerQueue] Fire signal to shutdown all queues.
[2017-06-02 00:49:31Z INFO JobServerQueue] Try to upload 2 log files or attachments, success rate: 2/2.
[2017-06-02 00:49:32Z INFO JobServerQueue] All queue process task stopped.
[2017-06-02 00:49:32Z INFO JobServerQueue] Try to append 1 batches web console lines, success rate: 1/1.
[2017-06-02 00:49:32Z INFO JobServerQueue] Web console line queue drained.
[2017-06-02 00:49:32Z INFO JobServerQueue] Try to upload 2 log files or attachments, success rate: 2/2.
[2017-06-02 00:49:32Z INFO JobServerQueue] File upload queue drained.
[2017-06-02 00:49:32Z INFO JobServerQueue] Timeline update queue drained.
[2017-06-02 00:49:32Z INFO JobServerQueue] All queue process tasks have been stopped, and all queues are drained.
[2017-06-02 00:49:32Z INFO JobRunner] Raising job completed event.
[2017-06-02 00:49:32Z INFO Worker] Job completed.
@artisticcheese
Copy link
Author

Issue due to the fact that by default VSTSService runs as "network service" account instead of "System" and hence the problem. Changing it to run under "System" resolves the issue.

@bryanmacfarlane
Copy link
Contributor

I wonder if we should doc that. Reactivating for doc consideration

@artisticcheese artisticcheese changed the title Docker task does not run under System account Docker task does not run under Network Service account Jun 2, 2017
@chrispat
Copy link
Contributor

chrispat commented Jun 2, 2017

@artisticcheese you need to configure your docker daemon to allow users from other groups. See the docker documentation for doing that.

@artisticcheese
Copy link
Author

Correct, there is 2 ways to fix the problem and neither of those is documented on Docker task page and hence out of the box task will fail.

@artisticcheese
Copy link
Author

Following line needs to be added to daemon.json under Programdata\docker\config

{

"group" : "Network Service"

}

@chrispat
Copy link
Contributor

chrispat commented Jun 8, 2017

@artisticcheese Yes that is the correct change. This is not specific to the task so it is not documented as part of it. It is general docker configuration.

@chrispat chrispat closed this as completed Jun 8, 2017
@egorpavlikhin
Copy link

Following line needs to be added to daemon.json under Programdata\docker\config

{

"group" : "Network Service"

}

Don't do this. There is no group called "Network Service" and this will corrupt your daemon.json file:

docker failed to load listeners: group Network Service not found

@artisticcheese
Copy link
Author

@egorpavlikhin This is special group in Windows. If you don't have I assume you are running on unsupported version of Windows or it's some other edge case. As you can see from comments above this change works and confirmed by owners.

@egorpavlikhin
Copy link

@artisticcheese I am running current Windows 10 Pro build with Docker Desktop. The issue is likely that this doesn't work for Linux containers. I assume it tries to read the VMs groups, not Windows groups.

@egorpavlikhin
Copy link

Here is the likely answer for Linux containers in Docker Desktop: docker-archive/toolbox#636 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants