OctopusDeploy / Issues

| Public | Bug reports and known issues for Octopus Deploy and all related tools
https://octopus.com
161 stars 20 forks source link

Using a maven package with a version that starts with a letter will fail with error Value cannot be null. (Parameter 'version') #7604

Open millerjn21 opened 2 years ago

millerjn21 commented 2 years ago

Team

Severity

1 reported

Version

2022.3.349-hotfix.1272

Latest Version

I could reproduce the problem in the latest build

What happened?

Using a maven package with a version that starts with a letter will fail with Value cannot be null. (Parameter 'version').

For example com.octopus:blah v2022.1.1 works com.octopus:blah vDEV-2022 does not work

Reproduction

  1. Set up an artifactory maven feed
  2. create a package with a version that starts with a letter
  3. try to deploy the package
  4. see error

Error and Stacktrace

16:23:38   Info     |       Unable to register package use.
16:23:38   Info     |       System.ArgumentNullException: Value cannot be null. (Parameter 'version')
16:23:38   Info     |       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
16:23:38   Info     |       at Calamari.Commands.RegisterPackageUseCommand.RegisterPackageUse() in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 61
16:23:38   Info     |       at Calamari.Commands.RegisterPackageUseCommand.Execute(String[] commandLineArguments) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 48
16:23:38   Error    |       Value cannot be null. (Parameter 'version')
16:23:38   Error    |       System.ArgumentNullException
16:23:38   Error    |       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
16:23:38   Error    |       at Calamari.Commands.RegisterPackageUseCommand.RegisterPackageUse() in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 61
16:23:38   Error    |       at Calamari.Commands.RegisterPackageUseCommand.Execute(String[] commandLineArguments) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari\Commands\RegisterPackageUseCommand.cs:line 48
16:23:38   Verbose  |       Process /bin/bash in /home/Octopus/Work/20220615162336-293141-25 exited with code 100
16:23:38   Verbose  |       Exit code: 100
16:23:38   Fatal    |       The remote script failed with exit code 100
16:23:38   Verbose  |       at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.SuccessArbitrator.ThrowIfNotSuccessful(IActionHandlerResult result) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionDispatch/SuccessArbitrator.cs:line 22
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.AdHocActionDispatcher.Dispatch(Machine machine, ActionHandlerInvocation actionHandler, ITaskLog taskLog, VariableCollection variables) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionDispatch/AdHocActionDispatcher.cs:line 57
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.Steps.Acquire.PackageAcquisitionExecutionHandlers.Invoke(ActionHandlerInvocation invocation, ITaskLog taskLog) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/Steps/Acquire/PackageAcquisitionExecutionHandlers.cs:line 116
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.Steps.Acquire.PackageAcquisitionExecutionHandlers.RegisterPackageUse(String packageId, IVersion version, String packagePath, String taskId, ITaskLog taskLog) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/Steps/Acquire/PackageAcquisitionExecutionHandlers.cs:line 37
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.Steps.Acquire.AcquireMachinePackageTask.RegisterPackage(ITaskContext taskContext, ITaskLog deploymentTargetTaskLog, PackageAcquisitionExecutionHandlers packageAcquisitionHandlers, StagedPackage stagedPackage) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/Steps/Acquire/AcquireMachinePackageTask.cs:line 178
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.Steps.Acquire.AcquireMachinePackageTask.Acquire(AcquiredPackageMap acquiredPackageMap, ITaskContext taskContext, ITaskLog stepTaskLog, ITaskLog deploymentTargetTaskLog) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/Steps/Acquire/AcquireMachinePackageTask.cs:line 105
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.PlannedStepControllers.AcquirePackagesStepController.<>c__DisplayClass5_3`3.<Execute>b__5() in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/PlannedStepControllers/AcquirePackagesStepController.cs:line 78
                    |       at Octopus.Server.Infrastructure.EitherAsyncOrSync.Execute(CancellationToken cancellationToken) in ./source/Octopus.Server/Infrastructure/EitherAsyncOrSync.cs:line 38
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.Guidance.ExecuteWithoutGuidance(EitherAsyncOrSync callback, String actionName, Boolean actionIsRequiredToRun, ITaskLog taskLog, CancellationToken cancellationToken) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/Guidance.cs:line 148
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.Guidance.Execute(EitherAsyncOrSync callback, String actionName, Boolean actionIsRequiredToRun, ITaskLog taskLog, Maybe`1 callbackOnExclude, CancellationToken cancellationToken) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/Guidance.cs:line 78
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.PlannedStepControllers.AcquirePackagesStepController.<>c__DisplayClass5_3`3.<<Execute>b__4>d.MoveNext() in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/PlannedStepControllers/AcquirePackagesStepController.cs:line 77
                    |       --- End of stack trace from previous location ---
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.TransientErrorDetectionExecutor.Execute(Func`2 action, ExecutionPlan plan, ITaskLog taskLog, CancellationToken cancellationToken, DeploymentTarget deploymentTarget) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/TransientErrorDetectionExecutor.cs:line 49
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.PlannedStepControllers.AcquirePackagesStepController.<>c__DisplayClass5_2`3.<<Execute>b__3>d.MoveNext() in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/PlannedStepControllers/AcquirePackagesStepController.cs:line 74
                    |       --- End of stack trace from previous location ---
                    |       at Octopus.Server.Infrastructure.Orchestration.UnitsOfWork.UnitOfWorkExecutor.<>c__DisplayClass5_0`3.<<Execute>b__0>d.MoveNext() in ./source/Octopus.Server/Infrastructure/Orchestration/UnitsOfWork/UnitOfWorkExecutor.cs:line 125
                    |       --- End of stack trace from previous location ---
                    |       at Octopus.Core.Infrastructure.UnitsOfWork.UnitOfWorkExtensionMethods.Do(IUnitOfWork unitOfWork, Func`1 action, CancellationToken cancellationToken, String name) in ./source/Octopus.Core/Infrastructure/UnitsOfWork/UnitOfWorkExtensionMethods.cs:line 75
                    |       at Octopus.Core.Infrastructure.UnitsOfWork.UnitOfWorkExtensionMethods.Do(IUnitOfWork unitOfWork, Func`1 action, CancellationToken cancellationToken, String name) in ./source/Octopus.Core/Infrastructure/UnitsOfWork/UnitOfWorkExtensionMethods.cs:line 75
                    |       at Octopus.Server.Infrastructure.Orchestration.UnitsOfWork.UnitOfWorkExecutor.Execute[T1,T2,T3](Func`5 action, CancellationToken cancellationToken, String name) in ./source/Octopus.Server/Infrastructure/Orchestration/UnitsOfWork/UnitOfWorkExecutor.cs:line 119
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.PlannedStepControllers.AcquirePackagesStepController.<>c__DisplayClass5_1`3.<<Execute>b__2>d.MoveNext() in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/PlannedStepControllers/AcquirePackagesStepController.cs:line 68
                    |       --- End of stack trace from previous location ---
                    |       at Octopus.Server.Orchestration.ServerTasks.ParallelWorkOrderAsync`1.<>c__DisplayClass8_1.<<Execute>b__4>d.MoveNext() in ./source/Octopus.Server/Orchestration/ServerTasks/ParallelWorkOrderAsync.cs:line 62
                    |       --- End of stack trace from previous location ---
                    |       at Octopus.Server.Infrastructure.EitherAsyncOrSync.Execute(CancellationToken cancellationToken) in ./source/Octopus.Server/Infrastructure/EitherAsyncOrSync.cs:line 38
                    |       at Octopus.Server.Orchestration.ServerTasks.OctoThreadClosureAsync`1.Execute(CancellationToken cancellationToken) in ./source/Octopus.Server/Orchestration/ServerTasks/OctoThreadClosureAsync.cs:line 63
                    |

More Information

Source ticket (INTERNAL): https://octopus.zendesk.com/agent/tickets/91115 Cloud reproduction (INTERNAL): https://octopus-operations.octopus.app/app#/Spaces-83/projects/maven-version-starts-with-letter/deployments

This worked locally on 2021.1.2584 and the user who reported it had last succesfully deployed to it in May, when I believe they were on a 2022.2 version.

Workaround

Use a package version that starts with a number.

ghost commented 2 years ago

This error happens because the version isn't a valid Maven version. See Octopus documentation and Maven documentation .

However, the error message is too abstract to guide the customer to understand the issue properly. In addressing this issue, we need to work on providing more relevant error message to help the customer use the correct Maven format.

octoreleasebot commented 2 years ago

Release Note: In addition to SemVer, package retention now also supports other version formats.

tothegills commented 1 year ago

This issue is still occurring.

Octobob commented 1 year ago

:tada: The fix for this issue has been released in:

Release stream Release
2022.2 2022.2.8476
2022.3 2022.3.10655
2022.4 2022.4.5165