Hello,
I found multiple topics about this issue but all for version 3.x. I’m actually facing this problem in version 2018.8.4.
I select the project I want to clone, go to Settings -> Clone, I fill the new project name and click Save.
I get this error in a red message : Value cannot be null. Parameter name: key
And this response in browser console :
{ "ErrorMessage": "Value cannot be null.\r\nParameter name: key", "FullException": "Value cannot be null.\r\nParameter name: key\r\nSystem.ArgumentNullException\r\n at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)\r\n at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)\r\n at System.Collections.Generic.Dictionary`2.get_Item(TKey key)\r\n at Octopus.Server.Web.Api.Rules.ConfigurationWillBeCopiedFromCloneRule.MapChannelIdOnTrigger(ProjectTrigger trigger, IDictionary`2 channelIdMap)\r\n at Octopus.Server.Web.Api.Rules.ConfigurationWillBeCopiedFromCloneRule.CloneProjectTriggers(String originalProjectId, String clonedProjectId, IDictionary`2 channelIdMap)\r\n at Octopus.Server.Web.Api.Rules.ConfigurationWillBeCopiedFromCloneRule.AfterStore(Project model, ProjectResource resource, ISpecialRuleContext context)\r\n at Octopus.Server.Web.Infrastructure.Api.Responder`1.ExecuteRegisteredRules[TRule](Action`2 ruleCallback)\r\n at Octopus.Server.Web.Infrastructure.Api.CreateResponseDescriptor`2.Responder.ExecuteRegistered()\r\n at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context)\r\n at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)\r\n at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass14_0.b__1(Object x)\r\n at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)" }
Here some details about the request :
Request URL:
https://<url>/api/projects?clone=Projects-21
Request payload:
{"Id":null,"VariableSetId":null,"DeploymentProcessId":null,"DiscreteChannelRelease":false,"IncludedLibraryVariableSetIds":null,"DefaultToSkipIfAlreadyInstalled":false,"TenantedDeploymentMode":"Untenanted","VersioningStrategy":{"Template":"#{Octopus.Version.LastMajor}.#{Octopus.Version.LastMinor}.#{Octopus.Version.NextPatch}"},"ReleaseCreationStrategy":null,"Templates":[],"AutoDeployReleaseOverrides":[],"Name":"New-project-name-containing-dashes","Slug":null,"Description":"","IsDisabled":false,"ProjectGroupId":"ProjectGroups-21","LifecycleId":"Lifecycles-1","AutoCreateRelease":false,"DefaultGuidedFailureMode":"EnvironmentDefault","ProjectConnectivityPolicy":{"SkipMachineBehavior":"None","TargetRoles":[],"AllowDeploymentsToNoTargets":false},"logo":null,"ClonedFromProjectId":null,"Links":null}
Thank you for your help.