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

Normalize readme entry path prior to extraction #727

Open
SergeyFilippov opened this issue Mar 23, 2022 · 6 comments
Open

Normalize readme entry path prior to extraction #727

SergeyFilippov opened this issue Mar 23, 2022 · 6 comments

Comments

@SergeyFilippov
Copy link

SergeyFilippov commented Mar 23, 2022

The packages with "\" character in readme node cannot be pushed to BaGet on Linux.

Similar to the issue #517 it is impossible to push a package with "\" character inside of "readme" node of nuspec file.

To Reproduce

Steps to reproduce the behavior:

  1. Using v0.4.0-preview2 version of Baget in docker (sha256:c66780acc1278f7727671e6523a5fc9236b883d430058c6b9a348a2011be8f09)
  2. Trying to push a ZetaLongPath
  3. Error occures:
BaGet.Core.PackageIndexingService[0]
      Uploaded package is invalid
System.IO.FileNotFoundException: docs\readme.md
   at NuGet.Packaging.ZipArchiveExtensions.LookupEntry(ZipArchive zipArchive, String path)
   at NuGet.Packaging.ZipArchiveExtensions.OpenFile(ZipArchive zipArchive, String path)
   at NuGet.Packaging.PackageArchiveReader.GetStream(String path)
   at NuGet.Packaging.PackageReaderBase.GetStreamAsync(String path, CancellationToken cancellationToken)
   at BaGet.Core.PackageArchiveReaderExtensions.GetReadmeAsync(PackageArchiveReader package, CancellationToken cancellationToken) in /src/BaGet.Core/Extensions/PackageArchiveReaderExtensions.cs:line 32
   at BaGet.Core.PackageIndexingService.IndexAsync(Stream packageStream, CancellationToken cancellationToken) in /src/BaGet.Core/Indexing/PackageIndexingService.cs:line 56

Expected behavior

It is possible to upload or download this kind of packages.

@Nobody84
Copy link

Nobody84 commented Sep 28, 2022

+1
Have the same issue during Mirroring nuget.org.
Looking forward to a fix.

Edit:
The fix from @SergeyFilippov (#728) worked for me.

TheBinaryLoop added a commit to TheBinaryLoop/BaGet that referenced this issue Jun 27, 2023
loic-sharma#727: Normalize readme entry path prior to extraction
@VAllens
Copy link

VAllens commented Aug 31, 2023

Is there any progress?

Due to this issue, the package cannot be restored

@PeterHagen
Copy link

I currently run into this issue. I found out that, for example, packages mimekit.4.2.0 and mailkit.4.2.0 run into this issues. Therefor I cannot restore my projects in a docker container for deployment anymore.

@R4cOOn
Copy link

R4cOOn commented Nov 27, 2023

I use BaGet as a NuGet mirror and I get the same issues when getting some packages from NuGet.
Any alternative Docker image available?

@SergeyFilippov
Copy link
Author

I use BaGet as a NuGet mirror and I get the same issues when getting some packages from NuGet. Any alternative Docker image available?

There is a fork, that is fairly maintained and seems to be active with merging pull requests: BaGetter. Last commit is pretty recent and adds dotnet 8 support.
There is a docker image for that repo too: Docker image tags

I haven't migrated to it yet, having a locally built image with required fixes, so can't say from experience about it's stability, but the issue with the "readme" paths is solved there.

@R4cOOn
Copy link

R4cOOn commented Nov 28, 2023

Thanks for your reply @SergeyFilippov !
I switched my image to theirs and it's working fine.

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

5 participants