[ Calamari ] Value cannot be null. (Parameter ‘version’)

Hello Octopus team,

After updating Octopus server from 2022.1.2495 to 2022.3.10405 and subsequent Tentacles and Calamaris updates, I have those kind of errors :

Unable to register package use. 
System.ArgumentNullException: Value cannot be null. (Parameter 'version') 
   at Calamari.Common.Plumbing.Deployment.PackageRetention.PackageIdentity..ctor(PackageId packageId, IVersion version, PackagePath path) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Plumbing\Deployment\PackageRetention\PackageIdentity.cs:line 21 
   at Calamari.Commands.RegisterPackageUseCommand.RegisterPackageUse() in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 61 
   at Calamari.Commands.RegisterPackageUseCommand.Execute(String[] commandLineArguments) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 48 
Value cannot be null. (Parameter 'version') 
System.ArgumentNullException 
   at Calamari.Common.Plumbing.Deployment.PackageRetention.PackageIdentity..ctor(PackageId packageId, IVersion version, PackagePath path) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Plumbing\Deployment\PackageRetention\PackageIdentity.cs:line 21 
   at Calamari.Commands.RegisterPackageUseCommand.RegisterPackageUse() in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 61 
   at Calamari.Commands.RegisterPackageUseCommand.Execute(String[] commandLineArguments) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 48 
The remote script failed with exit code 100

The Tentacle agent is on a Linux server at latest version :

Tentacle version: 6.2.50 
Tentacle communication uses a 'sha256RSA' certificate 
Bash version: 4.2.46(2)-release 
OS: Linux 3.10.0-1160.25.1.el7.x86_64 x86_64 
Distro: Red Hat Enterprise Linux Workstation release 7.9 (Maipo) 
Architecture: x86_64 
Time Zone: CEST +0200 
Calamari version: 24.0.8 

It seems to be somehow the same problem as the one described in a previous Topic (without resolution) :

Do you have an idea?

Best regards

Good afternoon @gregory.blanc,

Thankyou for contacting Octopus Support and sorry to hear you are getting errors in your Octopus Instance.

We have a GitHub issue in for Maven packages with a version that starts with a letter that has exactly the same stack trace error you are getting.

When does this error occur for you, is it when you are selecting to upgrade a tentacle or is it when you are pushing packages to a tentacle?

Here is the GitHub Issue, are you able to have a look at it and see if it is the same issue you are seeing? If not we can dig a bit more into this.

Kind Regards,

Clare

Hello @clare.martin,

I have those messages when I’m pushing a package to the tentacle.

For this project the version is like 000.0-xxx_xxx and it was perfectly working prior the upgrade.
But, effectively I’ve simplified the version to 000.0-xxx and it’s deploying without errors now.

Thank you,

Kind Regards,

Gregory.

Hey @gregory.blanc,

Thank you for letting us know you managed to solve this, its a bit odd that works though considering it worked before the upgrade and now doesnt.

The only thing I can think is it it either doesnt like the underscore in 000.0-xxx_xxx or there are too many characters for the version number? As a point of note - Semver version 2.0 doesnt mention the allowance of underscores in the version number, only letters, numbers and hyphens seem to be allowed.

I just tested this using the Octopus CLI (version 9.1.7 - which uses SemVer V2.0) to build a simple .zip file package. As you can see its fine with 1.0.0.0 but not with the same format you have (000.0-xxx_xxx).

If I take out the underscore and replace it with a hyphen it works:

.

I can only guess here but I imagine Octopus 2022.1 used an older CLI version which may have been SemVer V1.0. Once you upgraded to 2022.3 you are now on a later CLI version with Semver V2.0 and this is why it no longer will allow you to have underscores in your package names.

I hope that helps, so as long as you change your package names to only have alphanumberic letters and numbers with a hyphen if required you should be good to go.

Kind Regards,

Clare

1 Like

@clare.martin, many thanks for testing and feed back.

I can’t find anything related to this SemVer enforcement in the Octopus release change log.
Could you point me something?

Kind regards,

Gregory

Hey @gregory.blanc,

We have just discussed this internally as about an hour ago another user had exactly the same issue and they have underscores in their project name which, after changing to hyphens, this now works as expected.

I am putting this in front of our engineers it seems that we changed the library for this a few months ago and it may be we are now being more strict with the SemVer versioning. There wont be any logs on this as its the first we have heard of it and it seems like we have not captured this in order to error it out in a way that would indicate SemVer versioning being incorrect.

The System.ArgumentNullException: Value cannot be null. (Parameter 'version') is the error in your logs which kind of alludes to semver being not correct but that error message could be better.

I will let you know the outcomes of that discussion but I am fairly confident it is the underscores that is the issue here.

Kind Regards,

Clare

Hello @clare.martin,

I’m sure you’re right with the diagnotic and we fixed what had to be according to it.

But I need know what version of Octopus introduced those stricter checks, for my internal reports.
If you can have this information it might be great.

Kind Regards,

Gregory

Hey @gregory.blanc,

Its something I have asked the engineers, we think it is in all the 2022.3 versions but I will check.

Kind Regards,

Clare

Hey @gregory.blanc,

Sorry to double post but I was just told this was the GitHub Issue where we updated our package retention code, which is what we think is causing this issue, or at least has made enforcing SemVer package names more strict.

So it looks like the update happened in the versions below:

2022.2.6709
2022.3.2387
And all releases of 2022.4 which only our early cloud adoptors are on at the moment.

I hope that helps, I will reach out once I have more information from our engineers.

Kind Regards,

Clare

1 Like

Hello @clare.martin,

Thanks, you’re super reactive! :woman_superhero:t3:

Best Regards,

Gregory

2 Likes

Good morning @gregory.blanc

I have some good news for you this morning. Our engineers updated a GitHub Issue we were already working on. Originally the issue was for having letters at the start of Maven packages but due to a few customers having issues such as the one you were facing below the engineers have extended that GitHub issue out to other packages. Also, in addition to SemVer, package retention now supports other version formats. This means that underscores and forward slashes should now be accepted.

The fix for this is out in the builds on the GitHub issue but for convenience, I have included them below:

2022.2.8350

2022.3.10530

2022.4.2549

You can either upgrade when you are ready if you are running Octopus Server or if you are on our Octopus Cloud offering we can force an upgrade (if required) when it’s convenient for you, or you can wait until we upgrade you automatically in your maintenance window.

If you need further information on this please let me know.

Kind Regards,

Clare

1 Like

Hello @clare.martin,

Thanks for update, I will upgrade our Octopus Server soon to get the fix.

Kind regards,

Gregory

1 Like