SSH Run Shell Command throwing Object reference not set an instance of object exception

Hi Everyone,
When I run a simple command using SSH Run Shell command activity, it is throwing Object reference not set an instance of object exception.

Note: I’m using this activity inside the SSH connect scope.

Am I missing anything in it…?
Regards,
K

That seems a parameter is null

check out all the value parameters you passed for that activity and see which one is NULL

that will help you to understand what is causing the problem and you can take of that

@krishnakanth.k

Check if the SSH connection scope is authenticating?

Also check the command is receiving the response when you type manually

Hope this may help you

Thanks

Hi @rahulsharma ,
I’m just running the echo command. I tried setting the Options as well in the properties (except Shell Stream, I don’t know how to get that object), but no use.

Regards,
K

Hi @Srini84 ,
it’s authenticating. I’ve executed the same command using SSH Run Command activity, it is working fine. But SSH Run Shell Command is only not working.

Regards,
K

On the SSH Connect Scope you need to provide a regex for Shell Expected Prompt, otherwise a shell isn’t created (the description says this too, see screenshot below)

shell_expected_prompt

In order to keep the session open, the activity needs to know when the command returned. To do this it will check the regex against the response received from the server. When it finds the regex, it will stop and it will return whatever it collected until that point.

There are several thing to be aware of:

  1. if the regex matches something from the command output then the result will be truncated
  2. if you have a fancy shell that changes the prompt based on context, then you either have to account for this in your regex or have a fixed prompt for that particular user
  3. the check exit check seems to be implemented only for sh or bash shells. For me on powershell, it failed.