[CSHARP-3177] MongoDB.Driver.Core packaging issue with Nuget.Server Created: 07/Aug/20  Updated: 31/Mar/22

Status: Backlog
Project: C# Driver
Component/s: Packaging
Affects Version/s: 2.11.0
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Dmitry Lukyanov (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Received email:

we're running NuGet.Server (https://github.com/NuGet/NuGet.Server) at our enterprise and when we try to import the current package (https://www.nuget.org/packages/MongoDB.Driver.Core/2.11.0), the server logs the following error message:

Error: An exception occurred while rebuilding the package store: System.ArgumentException: Part URI cannot start with two forward slashes. at System.IO.Packaging.PackUriHelper.ValidatePartUri(Uri partUri) at System.IO.Packaging.ZipPackage.ContentTypeHelper.ProcessOverrideTagAttributes(XmlTextReader reader) at System.IO.Packaging.ZipPackage.ContentTypeHelper.ParseContentTypesFile(ZipFileInfoCollection zipFiles) at System.IO.Packaging.ZipPackage.ContentTypeHelper..ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper) at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming) at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming) at NuGet.PackageHelper.GetManifestStream(Stream packageStream) at NuGet.OptimizedZipPackage.EnsureManifest() at NuGet.Server.Core.PackageFactory.Open(String fullPackagePath) at NuGet.Server.Core.Infrastructure.ServerPackageRepository.AddPackagesFromDropFolderWithoutLocking() at NuGet.Server.Core.Infrastructure.ServerPackageRepository.<RebuildPackageStoreWithoutLockingAsync>d__48.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Server.Core.Infrastructure.ServerPackageRepository.<RebuildPackageStoreAsync>d__47.MoveNext()

Furthermore the server hangs sometimes and we need to restart it. After deleting the package the server works normally.

So I extracted the nupkg and deleted the following file: [Content_Types].xml The current file contains the following line: <Override PartName="//THIRD-PARTY-NOTICES" ContentType="application/octet" />

The server complains an error because of the second slash: Part URI cannot start with two forward slashes.

After repacking your package with nuget (nuget.exe pack MongoDB.Driver.Core.nuspec) "my" [Content_Types].xml contains the following line: <Override PartName="/THIRD-PARTY-NOTICES" ContentType="application/octet" /> and our nuget server imported the packages without any errors.


Generated at Wed Feb 07 21:44:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.