# Variable name already exists when syncing to agent

**URL:** <https://www.finalbuilder.com/forums/t/variable-name-already-exists-when-syncing-to-agent/7183>\
**Category:** Discussion\
**Tags:** continua-ci, fixed\
**Created:** [March 11, 2022, 10:23am UTC](https://www.finalbuilder.com/forums/t/variable-name-already-exists-when-syncing-to-agent/7183 "2022-03-11T10:23:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajobath](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/ajobath/32/2106_2.png) [@ajobath](https://www.finalbuilder.com/forums/u/ajobath)\
**Post date:** [March 11, 2022, 10:23am UTC](https://www.finalbuilder.com/forums/t/variable-name-already-exists-when-syncing-to-agent/7183/1 "2022-03-11T10:23:24Z")

</div>

I got the following error when syncinc a build to a new agent (from the agent debug log):

[AgentBuildHelper] InitialiseWorkspaceOnAgent \>\> Exception: An error occurred while syncing files from the server to the agent. Details: Exception: ValidationException

Message: Variable name already exists.

Stack Trace: at Continua.Shared.Variables.VariableNamespace.Add(String name, String desc, String value, ElementType type, Boolean maskValue, Boolean availableAsEnv, Boolean constant, Boolean expandExpressions)  
at Continua.Shared.Variables.VariableUtilities.CreateEnvironmentNamespace()  
at Continua.Shared.Variables.VariableUtilities.SerialiseEnvironmentNamespace(String workspacePath)  
at Continua.Modules.Builds.Agent.AgentBuildHelper.CreateVariableNamespaces()  
at Continua.Modules.Builds.Agent.AgentBuildHelper.InitialiseWorkspaceOnAgent(IAgentCallbackProxy proxy, TransportContextDTO source, Guid callId, Boolean requeued)

Any idea what could be causing this?

---

<div class="post-metadata">

**Author:** ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)\
**Post date:** [March 15, 2022, 3:26am UTC](https://www.finalbuilder.com/forums/t/variable-name-already-exists-when-syncing-to-agent/7183/2 "2022-03-15T03:26:04Z")

</div>

Hi Anders,

It appears that you may have two environment variables on the agent which transpose to the same name after non-alphanumeric characters are replaced by an underscore. We will release a new version with a fix in the next day or two.

---

<div class="post-metadata">

**Author:** ![ajobath](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/ajobath/32/2106_2.png) [@ajobath](https://www.finalbuilder.com/forums/u/ajobath)\
**Post date:** [March 15, 2022, 11:48am UTC](https://www.finalbuilder.com/forums/t/variable-name-already-exists-when-syncing-to-agent/7183/3 "2022-03-15T11:48:50Z")

</div>

I found the variables and could start a build on the new agent. Thanks for pointing in the right direction!
