Calamari Azure Cloud Service Packaging issue

I have similar issue as mentioned in this article

Unfortunately unpacking/packing is a critical part of my deployment process and can’t skip it.

Could you update me on the status of how/when this issue may be fixed?

Error:

Extracting package to: C:\Octopus\Work\20151218192611-1
19:27:29Verbose
Extracted 152 files
19:27:29Verbose
Ensuring cloud-service-package is V20120315 format.
19:27:29Verbose
Package is Legacy format. Converting to V20120315 format.
19:28:42Error
System.ArgumentException: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
19:28:42Error
   at System.IO.Packaging.PackUriHelper.ValidatePartUri(Uri partUri)
19:28:42Error
   at System.IO.Packaging.Package.GetPart(Uri partUri)
19:28:42Error
   at Microsoft.ServiceHosting.Tools.Packaging.ServicePackageBase.GetPart(Uri partUri)
19:28:42Error
   at Microsoft.WindowsAzure.Packaging.PackageConverter.AddSoftwarePackageToLayout(PackageBuilder builder, String layoutPath, ServiceSoftwarePackage softwarePacakge)
19:28:42Error
   at Microsoft.WindowsAzure.Packaging.PackageConverter.ConvertFromLegacy(Stream srcPackage, PackageStore dstPackage, X509Certificate2 decrypt, PackageRestrictions restrictions)
19:28:42Error
   at Calamari.Azure.Deployment.Conventions.EnsureCloudServicePackageIsCtpFormatConvention.ConvertPackage(String packagePath) in Y:\work\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\EnsureCloudServicePackageIsCtpFormatConvention.cs:line 48
19:28:42Error
   at Calamari.Azure.Deployment.Conventions.EnsureCloudServicePackageIsCtpFormatConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari.Azure\Deployment\Conventions\EnsureCloudServicePackageIsCtpFormatConvention.cs:line 38
19:28:42Error
   at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
19:28:42Error
   at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
19:28:42Error
Running rollback conventions...
19:28:42Error
System.ArgumentException: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
19:28:42Error
   at System.IO.Packaging.PackUriHelper.ValidatePartUri(Uri partUri)

Observation:

As a workaround I tried to convert the package to CTP format in my own scripts, and suprisingly it worked!

I expected it to hit the same issue as your code does, but it actually was fine. which will make me think, why doesn’t octopus try to do the same thing?

my script:

Hi Mo,

Thanks for getting in touch and following up with your workaround. Octopus doesn’t use the cspack.exe file directly as we use the Azure .NET SDK library to help do the work for us. We would have assumed they would be doing virtually the same thing but obviously it doesn’t appear that way.

I think there are two options for you.

  • As per the linked previous help discussion, update the file names that contain characters that aren’t valid in a URI.
  • Covert the package using the workaround you found and include that in your cloud service nuget package. That is, instead of packaging a file in the old format, package the successfully converted one and then everything should work fine.

Hope this helps!

Rob