Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Session Log

The SessionLogPath is a path to a log file. Not a path to a directory to store a log file.
Swindellvc@cofc.edu

Re: Session Log

martin wrote:

Swindellvc@cofc.edu wrote:

Where are the session logs?

To generate the session log file with .NET assembly, set Session.SessionLogPath.



When I added this...I got a different error "Error: Error occurred during logging. It's been turned off."

This is what was added

Dim mySession As New Session

With mySession
.SessionLogPath = "C:\Development\LOGS\"
End With

Upload(mySession) <- This is the code I sent


Private Sub Upload(ByRef mySession As Session)

' Setup session options

Dim sMsg As String = vbNull
Dim mySessionOptions As New WinSCP.SessionOptions

mySession.DisableVersionCheck = True
With mySessionOptions
.Protocol = Protocol.Sftp
.PortNumber = 22
.HostName = "REMOVED"
.SshPrivateKeyPassphrase = "REMOVED"
.UserName = "cofc"
.SshHostKeyFingerprint = "REMOVED"
'.SshPrivateKeyPath = "\\aiken\ProdCognos\ITExtracts\SSHKEY\myKey.ppk"
.SshPrivateKeyPath = "M:\ITExtracts\SSHKEY\myKey.ppk"
End With

' Connect
mySession.Open(mySessionOptions)

' Upload files

Dim MyTransferOptions As New WinSCP.TransferOptions
myTransferOptions.TransferMode = TransferMode.Binary

Dim transferResult As TransferOperationResult
'transferResult = mySession.PutFiles("\\aiken\ProdCognos\ITExtracts\studentlist.csv", "/studentlists/", False, myTransferOptions)
transferResult = mySession.PutFiles("M:\ITExtracts\studentlist*", "/studentlists/*.*", False, MyTransferOptions)
' Throw on any error
transferResult.Check()

' Display results
Dim transfer As TransferEventArgs
For Each transfer In transferResult.Transfers
sMsg = "Upload of " & transfer.FileName & " succeeded"
MsgBox(sMsg, MsgBoxStyle.Information)

Next

End Sub
martin

Re: Session Log

Swindellvc@cofc.edu wrote:

Where are the session logs?

To generate the session log file with .NET assembly, set Session.SessionLogPath.
Swindellvc@cofc.edu

Re: Error trying to run vb code

martin wrote:

So show us session log files both from GUI and the code.

This is the one from GUI


' Setup session options

Dim sMsg As String = vbNull
Dim mySessionOptions As New WinSCP.SessionOptions
mySession.DisableVersionCheck = True
With mySessionOptions
.Protocol = Protocol.Sftp
.PortNumber = 22
.HostName = "cofc.erezlife.com"
.SshPrivateKeyPassphrase = "Removed"
.UserName = "cofc"
.SshHostKeyFingerprint = "Removed"
'.SshPrivateKeyPath = "\\aiken\ProdCognos\ITExtracts\SSHKEY\myKey.ppk"
.SshPrivateKeyPath = "M:\ITExtracts\SSHKEY\myKey.ppk"
End With

' Connect
mySession.Open(mySessionOptions)

' Upload files

Dim MyTransferOptions As New WinSCP.TransferOptions
myTransferOptions.TransferMode = TransferMode.Binary

Dim transferResult As TransferOperationResult
'transferResult = mySession.PutFiles("\\aiken\ProdCognos\ITExtracts\studentlist.csv", "/studentlists/", False, myTransferOptions)
transferResult = mySession.PutFiles("M:\ITExtracts\studentlist*", "/studentlists/", False, MyTransferOptions)
' Throw on any error
transferResult.Check()

' Display results
Dim transfer As TransferEventArgs
For Each transfer In transferResult.Transfers
sMsg = "Upload of " & transfer.FileName & " succeeded"
MsgBox(sMsg, MsgBoxStyle.Information)

Next

End Sub
Swindellvc@cofc.edu

Session Log

Where are the session logs?
martin

Re: Error trying to run vb code

So show us session log files both from GUI and the code.
Swindellvc@cofc.edu

Re: Error trying to run vb code

martin wrote:

Can you login in GUI?


Yes...currently I'm uploading the file manually everyday
I'm trying to create a program that I have schedule to run daily
martin

Re: Error trying to run vb code

Can you login in GUI?
Swindellvc@cofc.edu

Error trying to run vb code

I'm running the following program based on your VBA Example

Dim sMsg As String = vbNull
Dim mySessionOptions As New WinSCP.SessionOptions
mySession.DisableVersionCheck = True
With mySessionOptions
.Protocol = Protocol.Sftp
.PortNumber = 22
.HostName = "<removed>"
.SshPrivateKeyPassphrase = "<Removed>"
.UserName = "cofc"
.SshHostKeyFingerprint = "<Removed>"
.SshPrivateKeyPath = "M:\ITExtracts\SSHKEY\myKey.ppk"
End With

' Connect
mySession.Open(mySessionOptions)

' Upload files

Dim MyTransferOptions As New WinSCP.TransferOptions
myTransferOptions.TransferMode = TransferMode.Binary

Dim transferResult As TransferOperationResult
transferResult = mySession.PutFiles("M:\ITExtracts\studentlist*", "/studentlists/", False, MyTransferOptions)
' Throw on any error
transferResult.Check()

' Display results
Dim transfer As TransferEventArgs
For Each transfer In transferResult.Transfers
sMsg = "Upload of " & transfer.FileName & " succeeded"
MsgBox(sMsg, MsgBoxStyle.Information)

Next

End Sub




Error: Disconnected: No supported authentication methods available (server sent: publickey,gssapi-with mic)

How can I resolve this error
martin

Re: WinSCP 5.1.4 GSSAPI for tunnel connexion

Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
Guest

WinSCP 5.1.4 GSSAPI for tunnel connexion

Hi all,

I have a problem with GSSAPI authentication.
It does work on my server directly, but it does work on my server when I use it as a tunnel.
It tells me "No supported authentication methods available (server sent: publickey, gssapi-keyex,gssapi-with-mic)."

Regards,