darkoperator / darkoperator/Posh-SSH
Long running Invoke-SSHCommand throwing timeout exception
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Command I ran
Invoke-SSHCommand -SSHSession $Session -Command $Command
Behavior I see that this command gets completed correctly but Posh-ssh.psm1 throws issue while parsing output.
shows wrong timeout issue.
Exception Thrown Below
ForEach-Object : Exception calling "EndExecute" with "1" argument(s): "Command 'bash run_lunux_script.sh' has timed out."
At C:\Program Files\WindowsPowerShell\Modules\Posh-SSH\2.2\Posh-SSH.psm1:253 char:17
+ ForEach-Object {
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [ForEach-Object], MethodInvocationException
+ FullyQualifiedErrorId : SshOperationTimeoutException,Microsoft.PowerShell.Commands.ForEachObjectCommand
if I run this second time it gets successful.
This is parsing issue i guess
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Posh-SSH.psm1 at line 253 and reproduce the issue using Invoke-SSHCommand with a long-running bash command. Trace how the command output is parsed and how EndExecute handles the timeout, comparing the first and second runs. Done means a successfully completed command no longer produces a misleading timeout exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100