IOException while starting docker on agent
I have a build that hasn't changed, but is suddenly failing.
When this step last run on TC 2020.1.5, the logs looked like this for the step:
Step 7/14: Docker build API Container (Docker)
Starting: docker build -t xxx.amazonaws.com/abcstorageapi:1.0.358.279 --pull --no-cache --build-arg source=PublishingStage/Api -f AbcStorage.Web.Api/Dockerfile .
in directory: C:\BuildAgent\work\xxxStorage
Sending build context to Docker daemon 2.656GB
Step 1/7 : FROM microsoft/aspnet:4.7.1-windowsservercore-10.0.14393.1884
.
.
.
Today, with TC version 2020.2.1, the same step produces the below exception.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428)
at java.io.File.getCanonicalPath(File.java:618)
at java.io.File.getCanonicalFile(File.java:643)
at org.jetbrains.teamcity.docker.command.DockerBuildCommandLineCreator.makeCommandLine(DockerBuildCommandLineCreator.kt:73)
at org.jetbrains.teamcity.docker.command.DockerCommandService.makeProgramCommandLine(DockerCommandService.kt:37)
at jetbrains.buildServer.agent.runner2.SingleCommandLineBuildSessionAdapter.makeProgramCommandLine(SingleCommandLineBuildSessionAdapter.java:60)
at jetbrains.buildServer.agent.runner2.GenericCommandLineBuildProcess.executeProcess(GenericCommandLineBuildProcess.java:80)
at jetbrains.buildServer.agent.runner2.GenericCommandLineBuildProcess.waitFor(GenericCommandLineBuildProcess.java:280)
at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:61)
at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:27)
at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:18)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:76)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:35)
at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor.doStages(RunnerStagesExecutor.java:18)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:43)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.StepExecutor.processNextStep(StepExecutor.java:25)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeRunnerStep(ForEachBuildRunnerStage.java:139)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.runStep(ForEachBuildRunnerStage.java:124)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.executeBuildRunners(ForEachBuildRunnerStage.java:84)
at jetbrains.buildServer.agent.impl.buildStages.startStages.steps.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:45)
at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:33)
at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:24)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:76)
at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:35)
at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24)
at jetbrains.buildServer.agent.impl.BuildRunActionImpl.doStages(BuildRunActionImpl.java:81)
at jetbrains.buildServer.agent.impl.BuildRunActionImpl.runBuild(BuildRunActionImpl.java:57)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:333)
at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$200(BuildAgentImpl.java:58)
at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:288)
at java.lang.Thread.run(Thread.java:748)
Failed to start build runner 'DockerCommand'
Step Docker build API Container (Docker) failed with unexpected error
I have uploaded the agent log file in debug mode to Upload id: 2021_01_04_SuWBowHecWaTyBhb (file: teamcity-agent.log).
Can you please point me in the right direction as to what I need to do to fix this issue?
Thanks in advance,
Keith Henderson
Please sign in to leave a comment.
I have identified what is going on. The path to file in the build step was set to "%teamcity.build.checkoutDir%\xxxx\Dockerfile". It appears that the system is no longer resolving %teamcity.build.checkoutDir%. When I change it to just "xxxx\Dockerfile", it appears to work.