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

dotnet publish fails with MSB3030 #10598

Open
rpatrick00 opened this issue Jan 27, 2020 · 10 comments
Open

dotnet publish fails with MSB3030 #10598

rpatrick00 opened this issue Jan 27, 2020 · 10 comments

Comments

@rpatrick00
Copy link

dotnet publish fails with MSB3030

We have been using the dotnet core sdk on Amazon Linux 2 for our Jenkins builds for 6 months now. We upgraded from dotnet core 2.2 to dotnet core 3.1 recently and everything has been working fine. For some unknown reason, all of our builds that use dotnet publish started failing today with an error that looks like the one shown here:

/usr/share/dotnet/sdk/3.1.101/Microsoft.Common.CurrentVersion.targets(4570,5): error MSB3030: Could not copy the file "/home/ec2-user/jenkins/workspace/data-sync-service/data-sync-service/obj/Release/netcoreapp3.1/data-sync-service" because it was not found. [/home/ec2-user/jenkins/workspace/data-sync-service/data-sync-service/data-sync-service.csproj]

As you will notice, the publish command is internally trying to copy the file "data-sync-service", which doesn't exist. The "data-sync-service" name is the name of the project, so the source directory is full of files that start with "data-sync-service":

$ ls -al /home/ec2-user/jenkins/workspace/data-sync-service/data-sync-service/obj/Release/netcoreapp3.1/
total 748
drwxrwxr-x 3 ec2-user ec2-user   4096 Jan 27 19:00 .
drwxrwxr-x 3 ec2-user ec2-user     27 Jan 27 18:59 ..
-rw-rw-r-- 1 ec2-user ec2-user   1105 Jan 27 18:59 data-sync-service.AssemblyInfo.cs
-rw-rw-r-- 1 ec2-user ec2-user     41 Jan 27 18:59 data-sync-service.AssemblyInfoInputs.cache
-rw-rw-r-- 1 ec2-user ec2-user 149775 Jan 27 18:59 data-sync-service.assets.cache
-rw-rw-r-- 1 ec2-user ec2-user 209999 Jan 27 18:59 data-sync-service.csprojAssemblyReference.cache
-rw-rw-r-- 1 ec2-user ec2-user      0 Jan 27 19:08 data-sync-service.csproj.CopyComplete
-rw-rw-r-- 1 ec2-user ec2-user  20008 Jan 27 19:08 data-sync-service.csproj.FileListAbsolute.txt
-rw-rw-r-- 1 ec2-user ec2-user 292352 Jan 27 19:08 data-sync-service.dll
-rw-rw-r-- 1 ec2-user ec2-user      0 Jan 27 18:59 data-sync-service.MvcApplicationPartsAssemblyInfo.cache
-rw-rw-r-- 1 ec2-user ec2-user    662 Jan 27 18:59 data-sync-service.MvcApplicationPartsAssemblyInfo.cs
-rw-rw-r-- 1 ec2-user ec2-user  64284 Jan 27 19:08 data-sync-service.pdb
-rw-rw-r-- 1 ec2-user ec2-user     41 Jan 27 19:00 data-sync-service.RazorTargetAssemblyInfo.cache
drwxrwxr-x 2 ec2-user ec2-user    107 Jan 27 18:59 staticwebassets

We are using the following command being executed by Jenkins:

dotnet publish /home/ec2-user/jenkins/workspace/data-sync-service/data-sync-service/data-sync-service.csproj --no-restore -c Release -o /home/ec2-user/jenkins/workspace/data-sync-service/data-sync-service/out

I compared the CurrentVersions.target file with those on other machines and they are identical. The same builds work fine on other machines but are failing on our Jenkins slave.

General

dotnet core sdk version: 3.1.101
OS: Amazon Linux 2 (4.14.133-113.112.amzn2.x86_64 dotnet/core#1 SMP Tue Jul 30 18:29:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux)

@scalablecory
Copy link

@nguerrera can you help here

@nguerrera nguerrera transferred this issue from dotnet/core Feb 4, 2020
@nguerrera
Copy link
Contributor

nguerrera commented Feb 4, 2020

If possible, can you provide a binary log. Make note that this shares environment variables and project file contents before sharing.

@rpatrick00
Copy link
Author

Here you go.
msbuild.zip

@rpatrick00
Copy link
Author

rpatrick00 commented Feb 27, 2020

I applied the 3.1.102 update yesterday to my Jenkins slave. Now I am hitting this issue again:

/usr/share/dotnet/sdk/3.1.102/Microsoft.Common.CurrentVersion.targets(4570,5): error MSB3030: Could not copy the file "/home/ec2-user/jenkins/workspace/citation-webapp/citation-webapp/obj/Release/netcoreapp3.1/citation-webapp" because it was not found. [/home/ec2-user/jenkins/workspace/citation-webapp/citation-webapp/citation-webapp.csproj]

By rebuilding the slave EC2 instance from scratch (with the current dotnet version), everything works fine. I hope we can identify the source of the problem and correct it before the next dotnet sdk update...

@nguerrera, did the binary log give you any insight into the cause of the problem?

@baruchiro
Copy link

I have the same issue.

Just note, the csc.dll command contains an out part with the .dll file extension, and our error message says the executable without the .dll extension not found.

(Sorry, I'm from my phone now)

@j0nimost
Copy link

I'm here cause I'm experiencing a similar error on my CI/CD pipelines

@cosminiv
Copy link

I have the same problem.

@tgiphil
Copy link

tgiphil commented Aug 28, 2020

Same issue here too.

@Falco20019
Copy link

This seems to be related to long path names... It occurred for me too on a path with 262 character. If I shorten it to stay below 260, the error is gone...

@faldeland
Copy link

Same problem here. I upgraded project from .netcore 2.2 to .netcore 3.1 and this occurs regularly.

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

No branches or pull requests

9 participants