# SSH Execute/Close doesn't use FB variables

**URL:** https://www.finalbuilder.com/forums/t/ssh-execute-close-doesnt-use-fb-variables/3427
**Category:** Bugs
**Created:** [March 7, 2012, 11:45am UTC](https://www.finalbuilder.com/forums/t/ssh-execute-close-doesnt-use-fb-variables/3427 "2012-03-07T11:45:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gonyoda](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/gonyoda/32/119_2.png) [@gonyoda](https://www.finalbuilder.com/forums/u/gonyoda)
#### Post date: [March 7, 2012, 11:45am UTC](https://www.finalbuilder.com/forums/t/ssh-execute-close-doesnt-use-fb-variables/3427/1 "2012-03-07T11:45:30Z")

</div>

I open a SSH connection with a name like:

SSHLinux\_%ServerName%

Then, I perform a SSH Execute, and it fails with:

SSH Connection not found: SSHLinux\_%ServerName%

Or:

&nbsp;

An unexpected error occured : System.NullReferenceException: Object reference not set to an instance of an object.

&nbsp; &nbsp;at VSoft.FinalBuilder.SSH.InteractiveClient.Send(String command)

&nbsp; &nbsp;at VSoft.FinalBuilder.SSH.ActionExecuteCommand.OnExecute()

&nbsp; &nbsp;at VSoft.FinalBuilder.SSH.ActionBase.Execute()

&nbsp; &nbsp;at VSoft.CustomActionApi.BaseAction.ExecuteWrapper(ICustomActionExecuteContext Context, ExecuteDelegate Target)

&nbsp;

SSH Close fails with:

"The connection is not open"

&nbsp;

I suspect, but can't confirm, that either SSH Open or SSH Execute/Close aren't "unwinding" the variable values. &nbsp;I would expect SSH Open to create a connection with a name like "SSHLinux\_daphne\_qa" and the later SSH connections use this connection. &nbsp;We're using asynchronous action groups to perform SSH against multiple machines simultaneously from within the same action list. &nbsp;So, each action list has it's own "ServerName" variable. &nbsp;

BTW, this connection naming pattern seems to work fine for the SFTP actions.

See example project, you'll need to set username/password/server1/2 to some appropriate values for your environment. &nbsp;Thanks for any help!

John

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [March 8, 2012, 12:27pm UTC](https://www.finalbuilder.com/forums/t/ssh-execute-close-doesnt-use-fb-variables/3427/2 "2012-03-08T12:27:49Z")

</div>

Hi John   
  
 This is a bug, the ssh execute action was not expanding variables. I’m running a build with the fix included right now, I’ll post here when it’s uploaded.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [March 8, 2012, 2:17am UTC](https://www.finalbuilder.com/forums/t/ssh-execute-close-doesnt-use-fb-variables/3427/3 "2012-03-08T02:17:47Z")

</div>

Hi John   
  
 This build has the fix :   
  
 [https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700\_1791.exe](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1791.exe)

---

<div class="post-metadata">

### Author: ![gonyoda](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/gonyoda/32/119_2.png) [@gonyoda](https://www.finalbuilder.com/forums/u/gonyoda)
#### Post date: [March 8, 2012, 2:35am UTC](https://www.finalbuilder.com/forums/t/ssh-execute-close-doesnt-use-fb-variables/3427/4 "2012-03-08T02:35:48Z")

</div>

The fix is working great! Thanks a ton for such a quick turn-around. You guys rock!
