Error in plugin 'gulp-octo.push' Nuget package Internal Server Error (500)

Hi I get an error when trying to push a nuget package with @octopusdeploy/gulp-octo running Octopus 3.3.0-beta0001.

This is the code:
gulp.task(‘package’, function () {
return gulp.src([’/*’, '!bin{,/}’, ‘!src{,/**}’, ‘!gulpfile.babel.js’])
.pipe(octo.pack(‘nupkg’))
.pipe(octo.push({
host: ‘http://my-octopus-server’, apiKey: ‘API-XXX’}));
});

This is the error on fiddler:
HTTP/1.1 500 Internal Server Error
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Date: Wed, 10 Feb 2016 03:35:02 GMT
Transfer-Encoding: chunked
Connection: close

400
{
“ErrorMessage”: “Default tag is not valid per the schema. Verify that attributes are correct. Line 16, position 6.”,
“FullException”: “System.Xml.XmlException: Default tag is not valid per the schema. Verify that attributes are correct. Line 16, position 6.\r\n at System.IO.Packaging.ZipPackage.ContentTypeHelper.ProcessDefaultTagAttributes(XmlTextReader reader)\r\n at System.IO.Packaging.ZipPackage.ContentTypeHelper.ParseContentTypesFile(ZipFileInfoCollection zipFiles)\r\n at System.IO.Packaging.ZipPackage.ContentTypeHelper…ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper)\r\n at System.IO.Packaging.ZipPackage…ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming)\r\n at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming)\r\n at Octopus.Core.BuiltInFeed.FastZipPackage.Open(String fileLocation, Stream stream, Byte[] hash) in Y:\work\refs\tags\3.3.0-beta.1\source\Octopus.Core\BuiltInFeed\Fast
400
ZipPackage.cs:line 97\r\n at Octopus.Core.BuiltInFeed.FastZipPackage.Open(String fileLocation, IHashProvider hashProvider) in Y:\work\refs\tags\3.3.0-beta.1\source\Octopus.Core\BuiltInFeed\FastZipPackage.cs:line 131\r\n at Octopus.Core.Packages.Extraction.NupkgPackageExtractor.GetIndexPackageData(String packageFile) in Y:\work\refs\tags\3.3.0-beta.1\source\Octopus.Core\Packages\Extraction\NupkgPackageExtractor.cs:line 50\r\n at Octopus.Server.Web.Api.NuGet.NuGetPackagePushActionBase1.Execute() in Y:\\work\\refs\\tags\\3.3.0-beta.1\\source\\Octopus.Server\\Web\\Api\\NuGet\\NuGetPackagePushActionBase.cs:line 59\r\n at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context) in Y:\work\refs\tags\3.3.0-beta.1\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162\r\n at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)\r\n at CallSite.Target(Closure , CallSite , O
195
bject , Object , NancyContext )\r\n at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Y:\work\refs\tags\3.3.0-beta.1\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46\r\n at CallSite.Target(Closure , CallSite , Func`2 , Object )\r\n at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)”
}
0

This is the error on the console:
[16:43:50] Error in plugin 'gulp-octo.push’
Message:
Internal Server Error (500)

Hi Sophie,
Its great to see that you are using the gulp-octo library. We hope you will find it to be a useful and easy way of pushing packages from node. The issue that you are getting is, I believe, probably due to a bug in the node-nuget packaging library. Since it is not using an “official” NuGet library it may be formatting some of the metadata incorrectly. This is something I will be investigating into immediately and will let you know what result I find.

In the meantime you can continue to package your project up using the .zip format, or leaving the format parameter empty, as a tar.gz. Since these packages are just intended to be a mechanism for passing the project files around, the format itself is not hugely important to Octopus Deploy. Let me know also if this work around is a problem for you so that we can see if there is another possible solution in the interim.

Thanks again,
Rob

Hi Rob,
We’re also trying to use gulp-octo and can see that the nupkg option was recently removed. When trying to use .tar.gz output option and then pushing, Octopus Server is responding with:

The uploaded file isn’t a valid NuGet package. (400)

Can you advise if there is a trick to allowing these packages to be pushed to our server?

Thanks, Kent.

Hi Kent,

Rob is taking a well-deserved long-weekend, so I’ll answer in his stead!

We’ve disabled creating .nupkg in the NodeJS world because of some incompatibilities we’ve discovered with NuGet packages created that way. We see the most typical, and robust scenario to be .tar.gz for most NodeJS apps that will be hosted on Linux.

OctoPackJS does the actual work of pushing, and it looks like the correct URI, and it should accept .tar.gz or .zip happily, as long as you’re using Octopus 3.3 (which is currently in pre-release).

Are you targeting an older version of Octopus?

Hope that helps!
Mike

Aha, I’m on 3.2.22

I might wait for the stable version of 3.3 and have another crack.

Thanks for getting back to me.

Cheers,
Kent Muller

Hi Kent,

Thanks for getting back to me, and I’m glad we were able to sort it out! In case you do feel a bit adventurous, Octopus 3.3.0-beta.2 is due out in the next couple of days, and we’re hoping to ship the final 3.3.0 in the next couple of weeks. Hopefully that helps with your planning.

Happy Deployments!
Mike