LibraryManager icon indicating copy to clipboard operation
LibraryManager copied to clipboard

Seeminlgly random LIB003

Open leotsarev opened this issue 2 years ago • 10 comments

Describe the bug

I got seemingly random libman.json : error LIB003: XXXXX could not be written to disk. Make sure the file name is correct

XXX is different files, and sometimes it works. It could be related with https://github.com/aspnet/LibraryManager/issues/489, but I don't pass runtime option and just use dotnet build -c Release --no-restore

Additional context

https://github.com/joinrpg/joinrpg-net/runs/7111112857?check_suite_focus=true

leotsarev avatar Jun 29 '22 11:06 leotsarev

I try to read code and I don't like how FileSystemHelper and HostIteraction consuming errors without logging. May be we should expand logging here? Will you welcome contribution?

leotsarev avatar Jun 29 '22 11:06 leotsarev

We get that error sporadically as well, finding out the root cause would be helpful.

TFTomSun avatar Sep 08 '22 06:09 TFTomSun

We are experiencing this in our CI/CD pipeline as well. Sometimes it works, sometimes half the files get written before we receive the LIB003 error. This is really problematic for us as our CI/CD build/test stages sporadically fail now that we have introduced libman into our project.

n1njab0b avatar Nov 30 '22 18:11 n1njab0b

It might be helpful to know that in our environment, the sporadic failures are happening when we utilize the "Enable Restore Client-Side Libraries on Build" feature and the build server performs either a dotnet build or dotnet test. To temporarily work around this issue while we wait for a fix, we disabled the "Restore Client-Side Libraries on Build" feature and are now manually performing a libman restore in each project folder. This seems to be working for us, so that would suggest to me that the problem is somehow stemming from the Microsoft.Web.LibraryManager.Build package.

n1njab0b avatar Nov 30 '22 19:11 n1njab0b

@jimmylewis what do you think is correct path forward? Can I help?

leotsarev avatar Jun 14 '23 11:06 leotsarev

@jimmylewis ?

leotsarev avatar Dec 04 '23 17:12 leotsarev

This started happening for me when the project which was failing was updated to target multiple frameworks: <TargetFrameworks>netcoreapp3.1;net6.0;net8.0</TargetFrameworks>

As a work-around, I had to run libman restore before a build.

Another work-around could be to disable parallel builds either on the project level or the solution level.

icnocop avatar Dec 04 '23 19:12 icnocop

Same issue here, using enable package restore on build. No parallel jobs running. Get intermittent failures on local windows and on Ubuntu via the github workflow build, for various JS files. Seems to be a lingering issue going back some time according to posts on stack overflow.

I am looking to remove the source code from the repo and allow users to use LibMan to install the packages upon build to cleanup the repository.

alexhiggins732 avatar Feb 13 '24 23:02 alexhiggins732

+1 here, randomly happens during a restore in the azure devops pipeline on a self hosted VM.

DrMueller avatar Feb 14 '24 13:02 DrMueller