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 tool restore results in FileNotFoundException on linux due to case sensitivity issue #41844

Closed
blueboxes opened this issue Jun 28, 2024 · 3 comments
Assignees
Labels
Area-Tools untriaged Request triage from a team member

Comments

@blueboxes
Copy link

blueboxes commented Jun 28, 2024

Describe the bug

I have a dotnet tool pre-release version pushed to Azure DevOps Artifact feed and try an use this with a linux build agent I get file not found.

To Reproduce

Create a tool that has an upper case pre-release version tag e.g. 1.1.-MyTestVersion

Run dotnet tool install -g packagename --prerelease on a linux machine.

It finds the correct version from the feed to install but fails with a FileNotFoundException path error as it is looking for a lowercase version tag in the path.

I found this on a MS-hosted azure devops build agent. The dotnet tool package was pushed using the same agent setup.

Exceptions (if any)

packagename/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/2dcf1cae-d439-4db9-9980-749bd81a32f7.ps1'
Unhandled exception: System.IO.FileNotFoundException: Could not find file '/home/vsts/.dotnet/tools/.store/.stage/rkh2gf0n.kaw/packagename/1.1.4-228774mytestversion/packagename.1.1.4-228774mytestversion.nupkg'.
File name: '/home/vsts/.dotnet/tools/.store/.stage/rkh2gf0n.kaw/packagename/1.1.4-228774mytestversion/packagename.1.1.4-228774mytestversion.nupkg'
  at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
  at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
  at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
  at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
  at NuGet.Protocol.LocalFolderUtility.<>c__DisplayClass48_0.<GenerateNupkgMetadataFile>b__0()
  at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLocked(String filePath, Action action, Func`2 acquireFileStream, Int32 numberOfRetries)
  at NuGet.Repositories.NuGetv3LocalRepository.GetPackage(String packageId, NuGetVersion version, String path)
  at NuGet.Repositories.NuGetv3LocalRepository.FindPackageImpl(String packageId, NuGetVersion version)
  at NuGet.Repositories.NuGetv3LocalRepository.FindPackage(String packageId, NuGetVersion version)
  at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.CreateAssetFile(PackageId packageId, NuGetVersion version, DirectoryPath packagesRootPath, DirectoryPath assetFileDirectory, String runtimeJsonGraph, String targetFramework)
  at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.<>c__DisplayClass8_0.<InstallPackage>b__0()
  at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func`1 action, Action commit, Action rollback)
  at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.<>c__DisplayClass20_0.<Execute>b__1()
  at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.RunWithHandlingInstallError(Action installAction)
  at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.Execute()
  at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
  at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

I found issue #11038 but it looks to be diffrent.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Jun 28, 2024
@KalleOlaviNiemitalo
Copy link

This looks similar to #39105.

@blueboxes
Copy link
Author

Happy to close as duplicate

@Forgind
Copy link
Member

Forgind commented Jul 16, 2024

Closing as a duplicate of #39105. Thanks for finding that @KalleOlaviNiemitalo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tools untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants