BaGet
BaGet copied to clipboard
Normalize readme entry path prior to extraction
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:
- Using v0.4.0-preview2 version of Baget in docker (sha256:c66780acc1278f7727671e6523a5fc9236b883d430058c6b9a348a2011be8f09)
- Trying to push a ZetaLongPath
- 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.
+1 Have the same issue during Mirroring nuget.org. Looking forward to a fix.
Edit: The fix from @SergeyFilippov (#728) worked for me.
Is there any progress?
Due to this issue, the package cannot be restored
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.
I use BaGet as a NuGet mirror and I get the same issues when getting some packages from NuGet.
Any alternative Docker image available?
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.
Thanks for your reply @SergeyFilippov !
I switched my image to theirs and it's working fine.