ArgumentNullException on variables binding

Hello,

I am creating a new process similar to previous ones and I receive this error when I try to deploy the release.

I can’t find what could cause this error… I have reread all variables and steps and still can’t understand why this step fail.

                    |     == Failed: Octopus Server on behalf of xxx Azure Web App ==
13:41:59   Verbose  |       Value cannot be null. (Parameter 'key')
                    |       System.ArgumentNullException
                    |       at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
                    |       at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
                    |       at Octostache.Templates.PropertyListBinder.Add(Binding result, IEnumerable`1 steps, String value)
                    |       at Octostache.Templates.PropertyListBinder.Add(Binding result, IEnumerable`1 steps, String value)
                    |       at Octostache.Templates.PropertyListBinder.Add(Binding result, IEnumerable`1 steps, String value)
                    |       at Octostache.Templates.PropertyListBinder.Add(Binding result, IEnumerable`1 steps, String value)
                    |       at Octostache.Templates.PropertyListBinder.CreateFrom(IDictionary`2 properties)
                    |       at Octostache.VariableDictionary.get_Binding()
                    |       at Octostache.VariableDictionary.Evaluate(String expressionOrVariableOrText, String& error, Boolean haltOnError)
                    |       at Octostache.VariableDictionary.Get(String variableName, String& error, String defaultValue)
                    |       at Octostache.VariableDictionary.GetStrings(String variableName, Char[] separators)
                    |       at Octopus.Core.Model.Variables.TargetManifest.AddTargetRoles(VariableDictionary variables) in TargetManifest.cs:line 59
                    |       at Octopus.Core.Model.Variables.TargetManifest.GetVariables() in TargetManifest.cs:line 31
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionTaskController`1.CheckRunConditionsAndProceed(PlannedStep step, DeploymentTarget targetContext, PlannedAction action, ActionCommand actionCommand) in ExecutionTaskController.cs:line 577
                    |       at Octopus.Server.Orchestration.ServerTasks.Deploy.ExecutionTaskController`1.ExecuteActionAndInitLoggingContext(PlannedStep step, DeploymentTarget targetContext, PlannedAction action) in ExecutionTaskController.cs:line 558
13:41:59   Fatal    |       The action Deploy an Azure Web App on xxx Azure Web App failed

I can share complete raw log if necessary.

It’s solved. I think there is a bug in the software when specific steps are used:

  • During the first steps of the configuration of the process, I miss-typed the name of one of the variables.
  • A deployment target was created with the name of the variable as one of the environment role (eg. with a role named “#{Octupus.TargetRole}”, with a typo)
  • The first deployment failed, and this target was not destroyed.
  • Then, every time this target was used, this error occured.

For me, there is a bug somewhere in the TargetRole evaluation when you can create a role with a variable pattern #{…} and its name is replaced at runtime. But if the variable does not exists, you will have an empty role name, which eventually will be converted as a null value and cause this kind of errors.

It’s only a supposition based on my observations. I was able to fix it by manually destroying the target environment.

1 Like

Hi @Thomas_B,

Thank you for contacting Octopus Support. I’m glad to hear you were able to get it figured out.

If you need anything else, don’t hesitate to reach out.

Regards,
Donny

I am sure the dev team will be interested in this stacktrace :wink:

Have a good day.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.