Exception calling "Open" with "1" argument(s):

Advertisement

rsford31
Joined:
Posts:
32

Exception calling "Open" with "1" argument(s):

Hi,
I'm getting the error Exception calling "Open" with "1" argument(s): "Network error: Connection to "siteurlhere" timed out."I'm using the .NET assembly version 5.7.5. I've used this with other sites with no issues using WinSCP.Session and WinSCP.SessionOptions.
I have the same site set up in the GUI and it connects immediately so I'm not sure what the issue is.
Add-Type -Path "E:\Program Files\WinSCP 5.7.5\WinSCPnet.dll"
   $session = New-Object WinSCP.Session
    $sessionOptions = New-Object WinSCP.SessionOptions -Property @{
        Protocol = [WinSCP.Protocol]::$Protocol
        HostName = "$($HostName)"
        UserName = "$($UserName)"
      PortNumber = $Port
        Password = "$($Password)"
      SshHostKeyFingerprint = $FingerPrint  
    }
$session.Open($sessionOptions)
Protocol is Sftp. Here is the log:
. 2019-04-16 12:57:59.837 --------------------------------------------------------------------------
. 2019-04-16 12:57:59.837 WinSCP Version 5.7.5 (Build 5665) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Standard)
. 2019-04-16 12:57:59.837 Configuration: nul
. 2019-04-16 12:57:59.837 Log level: Normal
. 2019-04-16 12:57:59.837 Local account: ACTIVEDOMAIN\sngfiletran
. 2019-04-16 12:57:59.837 Working directory: E:\Program Files\WinSCP 5.7.5
. 2019-04-16 12:57:59.837 Process ID: 5876
. 2019-04-16 12:57:59.837 Command-line: "E:\Program Files\WinSCP 5.7.5\winscp.exe" /xmllog="C:\Users\sngfiletran\AppData\Local\Temp\wscp1728.020D2748.tmp" /xmlgroups /nointeractiveinput /dotnet=575  /ini=nul /log="F:\WinscpLogs\logfile.txt"  /console /consoleinstance=_5928_48208847_70
. 2019-04-16 12:57:59.837 Time zone: Current: GMT-5, Standard: GMT-6 (Central Standard Time), DST: GMT-5 (Central Daylight Time), DST Start: 3/10/2019, DST End: 11/3/2019
. 2019-04-16 12:57:59.837 Login time: Tuesday, April 16, 2019 12:57:59 PM
. 2019-04-16 12:57:59.837 --------------------------------------------------------------------------
. 2019-04-16 12:57:59.837 Script: Retrospectively logging previous script records:
> 2019-04-16 12:57:59.837 Script: option batch on
< 2019-04-16 12:57:59.837 Script: batch           on        
< 2019-04-16 12:57:59.837 Script: reconnecttime   120       
> 2019-04-16 12:57:59.837 Script: option confirm off
< 2019-04-16 12:57:59.837 Script: confirm         off       
> 2019-04-16 12:57:59.837 Script: option reconnecttime 120
< 2019-04-16 12:57:59.837 Script: reconnecttime   120       
> 2019-04-16 12:57:59.837 Script: open sftp://userid:***@sitenamehere:22 -hostkey="ssh-rsa 2048 a6:2b:45:15:c0:fa:20:dc:d7:02:7f:a7:49:9d:d9:ea" -timeout=15
. 2019-04-16 12:57:59.837 --------------------------------------------------------------------------
. 2019-04-16 12:57:59.837 Session name: userid@sitenamehere (Ad-Hoc site)
. 2019-04-16 12:57:59.837 Host name: sitenamehere (Port: 22)
. 2019-04-16 12:57:59.837 User name: userid (Password: Yes, Key file: No)
. 2019-04-16 12:57:59.837 Tunnel: No
. 2019-04-16 12:57:59.837 Transfer Protocol: SFTP
. 2019-04-16 12:57:59.837 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2019-04-16 12:57:59.837 Disable Nagle: No
. 2019-04-16 12:57:59.837 Proxy: none
. 2019-04-16 12:57:59.837 Send buffer: 262144
. 2019-04-16 12:57:59.837 SSH protocol version: 2; Compression: No
. 2019-04-16 12:57:59.837 Bypass authentication: No
. 2019-04-16 12:57:59.837 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2019-04-16 12:57:59.837 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-04-16 12:57:59.837 KEX: dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN
. 2019-04-16 12:57:59.837 SSH Bugs: A,A,A,A,A,A,A,A,A,A,A,A
. 2019-04-16 12:57:59.837 Simple channel: Yes
. 2019-04-16 12:57:59.837 Return code variable: Autodetect; Lookup user groups: A
. 2019-04-16 12:57:59.837 Shell: default
. 2019-04-16 12:57:59.837 EOL: 0, UTF: 2
. 2019-04-16 12:57:59.837 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2019-04-16 12:57:59.837 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2019-04-16 12:57:59.837 SFTP Bugs: A,A
. 2019-04-16 12:57:59.837 SFTP Server: default
. 2019-04-16 12:57:59.837 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-04-16 12:57:59.837 Cache directory changes: Yes, Permanent: Yes
. 2019-04-16 12:57:59.837 DST mode: 1
. 2019-04-16 12:57:59.837 --------------------------------------------------------------------------
. 2019-04-16 12:57:59.837 Looking up host "sitenamehere"
. 2019-04-16 12:57:59.852 Connecting to IPAddress port 22
. 2019-04-16 12:58:20.866 Failed to connect to IPAddress: Network error: Connection timed out
. 2019-04-16 12:58:20.866 Knocking FTP port.
. 2019-04-16 12:58:22.878 FTP port did not open.
Thanks!

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum