Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3177

MongoDB.Driver.Core packaging issue with Nuget.Server

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.11.0
    • Component/s: Packaging
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            dmitry.lukyanov@mongodb.com Dmitry Lukyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: