JetBrains / teamcity-dotnet-plugin

TeamCity plugin for .NET projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nuget push - "error: File does not exist" on windows agent

samfozz opened this issue · comments

When using the "nuget push" command on a Windows agent, I get a "file not found" error relating to one of the input .nupkg files :

image

Here's my configuration - note how the .nupkg files are found by teamcity. This configuration works fine on my Ubuntu agent.

image

It looks in the logging as though the the back slashes in the file path have been escaped? - You can see in the screenshot the call is logged as "..dotnet.exe nuget push C:\\Users\\sam.foster\\..." - I wonder if this might be the issue?

Thanks,
Sam

I'm experiencing the same issue.

same issue here

[00:34:51] :	 [Step 5/5] dotnet.exe nuget push C:\TeamCity\buildAgent\work\fd58df9994323355\Bredas.SharedKernel\Bredas.SharedKernel.ApiCore\bin\Release\Bredas.SharedKernel.ApiCore.1.0.0.nupkg --api-key ******* --source http://localhost:8080/guestAuth/app/nuget/v1/FeedService.svc/ @C:\TeamCity\buildAgent\temp\agentTmp\69df325d3447444d926fae2d01a36a08.rsp

[00:34:51]W:	 [Step 5/5] nuget push

[00:34:51] :		 [nuget push] Starting: "C:\Program Files\dotnet\dotnet.exe" nuget push C:\\TeamCity\\buildAgent\\work\\fd58df9994323355\\Bredas.SharedKernel\\Bredas.SharedKernel.ApiCore\\bin\\Release\\Bredas.SharedKernel.ApiCore.1.0.0.nupkg --api-key ******* --source http://localhost:8080/guestAuth/app/nuget/v1/FeedService.svc/ @C:\\TeamCity\\buildAgent\\temp\\agentTmp\\69df325d3447444d926fae2d01a36a08.rsp

[00:34:51] :		 [nuget push] in directory: C:\TeamCity\buildAgent\work\fd58df9994323355


[00:34:52] :		 [nuget push] error: File does not exist (C:\\TeamCity\\buildAgent\\work\\fd58df9994323355\\Bredas.SharedKernel\\Bredas.SharedKernel.ApiCore\\bin\\Release\\Bredas.SharedKernel.ApiCore.1.0.0.nupkg).

[00:34:52]W:		 [nuget push] Process exited with code 1

[00:34:52]E:	 [Step 5/5] Step publish nuget (.NET CLI (dotnet)) failed

@dtretyakov please, speed up on this, i think this is a breaking change on the code...its affecting on production for some reason... i will try to downgrade the plugin on the teamcity, but i dont know if this is the best solution right know, nor this will work.

@dtretyakov problem is not the wildcard, manual file specification show the same error. Master and Indore-2017.1.x affected.

@danilobreda We've reverted back to using the Nuget Publish runner to publish the nuget packages for the time being. Not sure if that's a possible work around for you.

@NikolayPianikov, do we need to append @C:\\... .rsp parameter at the end in nuget push command?

I'm experiencing the same issue.

[Step 4/4] nuget push
[11:28:00][nuget push] Starting: "C:\Program Files\dotnet\dotnet.exe" nuget push ***.Common\bin\Release\push ***.Common.1.0.0.nupkg --api-key ******* --source https://octopus.push ***.com/nuget/packages @d:\TeamCity\buildAgent\temp\agentTmp\8529f370d85146239dae886556c0f5e7.rsp
[11:28:00][nuget push] in directory: D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:28:00][nuget push] error: File does not exist (push ***.Common\bin\Release\push ***.Common.1.0.0.nupkg).
[11:28:00][nuget push] Process exited with code 1

@Idanby the latest version has no rsp file at all. Could you share build log and plugin version?

@NikolayPianikov Build 'Octopus :: coreServices :: BuildCoreServices' #30
Started 2017-11-16 11:27:47 on 'WIN-N1UKR2AO5EV' by 'Idan ()'
Finished 2017-11-16 11:28:00 with status FAILURE 'Failure'
VCS revisions: 'https://
@bitbucket.org/***/coreservices.git#refs/heads/master' (Git): 7032990f24effd4b5d43d402bbf0f7dba7452b5e (branch 'refs/heads/master')
TeamCity URL https://build.***application.com/viewLog.html?buildId=24207&buildTypeId=Octopus_CoreServices_BuildCoreServices
TeamCity server version is 2017.1.4 (build 47070), server timezone: UTC

[11:22:04]E: bt61 (5m:56s)
[11:22:04]i: TeamCity server version is 2017.1.4 (build 47070)
[11:27:41] : The build is removed from the queue to be prepared for the start
[11:27:41] : Collecting changes in 1 VCS root (1s)
[11:27:41] : [Collecting changes in 1 VCS root] VCS Root details
[11:27:41] : [VCS Root details] "https://@bitbucket.org//coreservices.git#refs/heads/master" {instance id=82, parent internal id=25, parent id=Octopus_CoreServices_HttpsBitbucketOrgCoreservicesGitRefsHeads, description: "https://@bitbucket.org//coreservices.git#refs/heads/master"}
[11:27:42]i: [Collecting changes in 1 VCS root] Detecting changes in VCS root 'https://@bitbucket.org//coreservices.git#refs/heads/master' (used in 'BuildCoreServices')
[11:27:42]i: [Collecting changes in 1 VCS root] Will collect changes for 'https://@bitbucket.org//coreservices.git#refs/heads/master' starting from revision 7032990f24effd4b5d43d402bbf0f7dba7452b5e
[11:27:42] : [Collecting changes in 1 VCS root] Compute revision for 'https://@bitbucket.org//coreservices.git#refs/heads/master'
[11:27:42] : [Compute revision for 'https://@bitbucket.org//coreservices.git#refs/heads/master'] Upper limit revision: 7032990f24effd4b5d43d402bbf0f7dba7452b5e
[11:27:42]i: [Compute revision for 'https://@bitbucket.org//coreservices.git#refs/heads/master'] MaxModId = 45404
[11:27:42] : [Compute revision for 'https://@bitbucket.org//coreservices.git#refs/heads/master'] Latest commit attached to build configuration: 7032990f24effd4b5d43d402bbf0f7dba7452b5e
[11:27:42] : [Compute revision for 'https://@bitbucket.org//coreservices.git#refs/heads/master'] Computed revision: 7032990f24effd4b5d43d402bbf0f7dba7452b5e
[11:27:42] : Starting the build on the agent WIN-N1UKR2AO5EV
[11:27:47]i: Agent time zone: UTC
[11:27:47]i: Agent is running under JRE: 1.8.0_121-b13
[11:27:47] : Clearing temporary directory: D:\TeamCity\buildAgent\temp\buildTmp
[11:27:47]W: Failed to delete file: D:\TeamCity\buildAgent\temp\buildTmp\VBCSCompiler\AnalyzerAssemblyLoader\a5abf5d7d5a44e70928a112bc81d9ba5\0\AWSSDK.Lambda.CodeAnalysis.dll
[11:27:47]W: Failed to delete file: D:\TeamCity\buildAgent\temp\buildTmp\hsperfdata_Administrator\1220
[11:27:47]W: Failed to delete file: D:\TeamCity\buildAgent\temp\buildTmp\hsperfdata_Administrator\6028
[11:27:47]W: Unable to cleanup build temporary directory: D:\TeamCity\buildAgent\temp\buildTmp
[11:27:47] : Publishing internal artifacts
[11:27:47] : [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[11:27:47] : [Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[11:27:47] : Clean build enabled: removing old files from D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:27:47] : Transferring cached clean patch for VCS root: https://@bitbucket.org//coreservices.git#refs/heads/master
[11:27:47] : Checkout directory: D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:27:47] : Updating sources: server side checkout
[11:27:47] : [Updating sources] Repository sources transferred (1.07 MB)
[11:27:47] : [Updating sources] Removing D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:27:47] : [Updating sources] Updating D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:27:47] : Build preparation done
[11:27:47] : Step 1/4: Restore (.NET CLI (dotnet)) (3s)
[11:27:48] : [Step 1/4] dotnet.exe restore GEServices.sln @d:\TeamCity\buildAgent\temp\agentTmp\bfeb421c5bf243f594ec2797f3ab5649.rsp
[11:27:48] : [Step 1/4] restore (2s)
[11:27:48] : [restore] Starting: "C:\Program Files\dotnet\dotnet.exe" restore GEServices.sln @d:\TeamCity\buildAgent\temp\agentTmp\bfeb421c5bf243f594ec2797f3ab5649.rsp
[11:27:48] : [restore] in directory: D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:27:50] : [restore] Restoring packages for D:\TeamCity\buildAgent\work\a8df9bc36931db18*.Common*.Common.csproj...
[11:27:50] : [restore] Generating MSBuild file D:\TeamCity\buildAgent\work\a8df9bc36931db18*.Common\obj*.Common.csproj.nuget.g.props.
[11:27:50] : [restore] Restore completed in 197.59 ms for D:\TeamCity\buildAgent\work\a8df9bc36931db18*.Common*.Common.csproj.
[11:27:50] : [restore] [32;1m
[11:27:50] : [restore] [32;1mBuild succeeded.
[11:27:50] : [restore] 0 Warning(s)
[11:27:50] : [restore] 0 Error(s)
[11:27:50] : [restore]
[11:27:50] : [restore] Time Elapsed 00:00:01.36
[11:27:50] : [restore]
[11:27:50] : [restore]
[11:27:50] : [restore] Process exited with code 0
[11:27:50] : Step 2/4: build (.NET CLI (dotnet)) (5s)
[11:27:51] : [Step 2/4] dotnet.exe build GEServices.sln --framework netstandard2.0 --configuration Release @d:\TeamCity\buildAgent\temp\agentTmp\5d2a22f3bf204ae7b06ef22a6fa257b8.rsp
[11:27:51] : [Step 2/4] build (5s)
[11:27:51] : [build] Starting: "C:\Program Files\dotnet\dotnet.exe" build GEServices.sln --framework netstandard2.0 --configuration Release @d:\TeamCity\buildAgent\temp\agentTmp\5d2a22f3bf204ae7b06ef22a6fa257b8.rsp
[11:27:51] : [build] in directory: D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:27:52] : [build] [32;1m
[11:27:52] : [build] [32;1mBuild succeeded.
[11:27:52] : [build] 0 Warning(s)
[11:27:52] : [build] 0 Error(s)
[11:27:52] : [build]
[11:27:52] : [build] Time Elapsed 00:00:00.75
[11:27:52] : [build]
[11:27:52] : [build] Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
[11:27:52] : [build] Copyright (C) Microsoft Corporation. All rights reserved.
[11:27:52] : [build]
[11:27:56] : [build] .Common -> D:\TeamCity\buildAgent\work\a8df9bc36931db18*.Common\bin\Release\netstandard2.0*.Common.dll
[11:27:56] : [build] [32;1m
[11:27:56] : [build] [32;1mBuild succeeded.
[11:27:56] : [build] 0 Warning(s)
[11:27:56] : [build] 0 Error(s)
[11:27:56] : [build]
[11:27:56] : [build] Time Elapsed 00:00:03.29
[11:27:56] : [build]
[11:27:56] : [build]
[11:27:56] : [build] Process exited with code 0
[11:27:56] : Step 3/4: packCommon (.NET CLI (dotnet)) (3s)
[11:27:56] : [Step 3/4] dotnet.exe pack .Common*.Common.csproj --configuration Release @d:\TeamCity\buildAgent\temp\agentTmp\0e0f8024f81d43c093e1e6d3922523ec.rsp
[11:27:56] : [Step 3/4] pack (3s)
[11:27:56] : [pack] Starting: "C:\Program Files\dotnet\dotnet.exe" pack .Common\.Common.csproj --configuration Release @d:\TeamCity\buildAgent\temp\agentTmp\0e0f8024f81d43c093e1e6d3922523ec.rsp
[11:27:56] : [pack] in directory: D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:27:57] : [pack] [32;1m
[11:27:57] : [pack] [32;1mBuild succeeded.
[11:27:57] : [pack] 0 Warning(s)
[11:27:57] : [pack] 0 Error(s)
[11:27:57] : [pack]
[11:27:57] : [pack] Time Elapsed 00:00:00.78
[11:27:57] : [pack]
[11:27:57] : [pack] Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
[11:27:57] : [pack] Copyright (C) Microsoft Corporation. All rights reserved.
[11:27:57] : [pack]
[11:27:59] : [pack] .Common -> D:\TeamCity\buildAgent\work\a8df9bc36931db18*.Common\bin\Release\netstandard2.0*
.Common.dll
[11:27:59] : [pack] Successfully created package 'D:\TeamCity\buildAgent\work\a8df9bc36931db18*
.Common\bin\Release**.Common.1.0.0.nupkg'.
[11:27:59] : [pack] [32;1m
[11:27:59] : [pack] [32;1mBuild succeeded.
[11:27:59] : [pack] 0 Warning(s)
[11:27:59] : [pack] 0 Error(s)
[11:27:59] : [pack]
[11:27:59] : [pack] Time Elapsed 00:00:01.68
[11:27:59] : [pack]
[11:27:59] : [pack]
[11:27:59] : [pack] Process exited with code 0
[11:27:59]E: Step 4/4: Push common (.NET CLI (dotnet))
[11:28:00] : [Step 4/4] dotnet.exe nuget push *.Common\bin\Release*.Common.1.0.0.nupkg --api-key ******* --source https://octopus.application.com/nuget/packages @d:\TeamCity\buildAgent\temp\agentTmp\8529f370d85146239dae886556c0f5e7.rsp
[11:28:00]W: [Step 4/4] nuget push
[11:28:00] : [nuget push] Starting: "C:\Program Files\dotnet\dotnet.exe" nuget push .Common\bin\Release\.Common.1.0.0.nupkg --api-key ******* --source https://octopus.application.com/nuget/packages @d:\TeamCity\buildAgent\temp\agentTmp\8529f370d85146239dae886556c0f5e7.rsp
[11:28:00] : [nuget push] in directory: D:\TeamCity\buildAgent\work\a8df9bc36931db18
[11:28:00] : [nuget push] error: File does not exist (
.Common\bin\Release\
.Common.1.0.0.nupkg).
[11:28:00]W: [nuget push] Process exited with code 1
[11:28:00]E: [Step 4/4] Step Push common (.NET CLI (dotnet)) failed
[11:28:00] : Publishing internal artifacts
[11:28:00] : [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[11:28:00] : [Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[11:28:00]E: Unknown build problem reported on agent
[11:28:00] : Build finished

Make sure ***.Common\bin\Release\***.Common.1.0.0.nupkg exists before publishing

@NikolayPianikov It's exist. I see the file in the server.

Ok. Try running this command from the command line "C:\Program Files\dotnet\dotnet.exe" nuget push ... on the TeamCity agent

@NikolayPianikov I just executed this line: C:\Program Files\dotnet\dotnet.exe nuget push D:\TeamCity\buildAgent\work\a8df9bc36931db18*.Common\bin\Release*.Common.1.0.0.nupkg --api-key MyApiKey --source https://octopus.***.com/nuget/packages

And it's working... :\

But what if you run with .rps? As I say the latest version does not contain it I just want to be sure that .rsp is a cause of issue

@NikolayPianikov Run to compilation with .rsp
C:\Program Files\dotnet> dotnet.exe nuget push D:\TeamCity\buildAgent\work\a8df9bc36931db18*.Common\bin\Release*.Common.1.0.0.nupkg --api-key MyApiKey --source https://octopus.***.com/nuget/packages @d:\TeamCity\buildAgent\temp\agentTmp\84673605af5748a6bed2c46509c05ebb.rsp

info : Pushing ***.Common.1.0.0.nupkg to 'https://octopus.***.com/nuget/packages'...
info : PUT https://octopus.***.com/nuget/packages/
info : Created https://octopus.***.com/nuget/packages/ 174ms
info : Your package was pushed.

I was downloaded the latest version a far as I know.
Can you please provide a link to the latest?

@Idanby I've updated references. Try downloading again.
Sorry, which page to download are you using?

@Idanby according to your experiment, it seems to be the issue is not in the .rps file. Another one assumption is - Windows account and its environment somehow impact on push results. Is it possible to run this command under the TeamCity agent's Windows account?

@NikolayPianikov I will try and keep you updated.

@NikolayPianikov while I'm checking I would like to let you know that I changed the build step (Runner type) to "NuGet Publish" and it's works fine so it's seems that isn't permission issue.

Sorry but after discussion with my manager it will be a problem to run the agent under different account because the server is prod server.
I will try install the latest plugin on sandbox env and keep you updated.

@Idanby any updates?