sshnet / sshnet/SSH.NET

An error occurred, but no specific error code exists to describe the failure

Aperta
#1,735 12 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
4.4k
Fork
993
Merge medio
9g 21h
PR unite (30g)
1

Descrizione

Hi,

I'm getting the below error on various version ( including 2025.1.0 )

Unhandled exception occurred Renci.SshNet.Common.SshException: Failed to upload /2880389.xml to ./2880389.xml
---> Renci.SshNet.Common.SftpException: An error occurred, but no specific error code exists to describe the failure.
at Renci.SshNet.Sftp.SftpSession.RequestClose(Byte[] handle)
at Renci.SshNet.SftpClient.InternalUploadFile(Stream input, String path, Flags flags, SftpUploadAsyncResult asyncResult, Action`1 uploadCallback, Boolean isAsync, CancellationToken cancellationToken)
at Renci.SshNet.SftpClient.InternalSynchronizeDirectories(String sourcePath, String destinationPath, String searchPattern, SftpSynchronizeDirectoriesAsyncResult asyncResult)
--- End of inner exception stack trace ---

I'm properly connected to the SFTP server:

Files in remote directory ./username: ["processing"]
Current working directory: /

And I'm able to successfully upload a file using lftp:

lftp -u username sftp://some_server.com -e "put /tmp/test.xml -o /test5.xml; bye"

I don't have problems downloading files from this server.

Telnet to the server reoprts:

SSH-2.0-DataPowerSSH_1.1

I've been trying both:

SftpClient.Upload and SftpClient.SynchronizeDirectories(sourcePath, ".", "*.xml")

Any idea what might be causing the problem?
Tried to specify the remote path as / , ./ and ./username

Thanks

edi1
Maybe debug logs will be useful and also the fact, the server only supports: ssh-rsa

info: Renci.SshNet.Connection.DirectConnector[0]
Initiating connection to 'Unspecified/some_server.com:22'.
info: Renci.SshNet.Session[0]
Server version 'SSH-2.0-DataPowerSSH_1.1'.
dbug: Renci.SshNet.Session[0]
[(null)] Performing curve25519-sha256 key exchange.
dbug: Renci.SshNet.Security.KeyExchangeECCurve25519[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Creating aes128-ctr server cipher.
dbug: Renci.SshNet.Security.KeyExchangeECCurve25519[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Creating aes128-ctr client cipher.
dbug: Renci.SshNet.Security.KeyExchangeECCurve25519[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Creating hmac-sha2-256 server hmac algorithm.
dbug: Renci.SshNet.Security.KeyExchangeECCurve25519[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Creating hmac-sha2-256 client hmac algorithm.
dbug: Renci.SshNet.SftpClient[0]
Disposing client.
info: Renci.SshNet.SftpClient[0]
Disconnecting client.
dbug: Renci.SshNet.Session[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Disposing session.
info: Renci.SshNet.Session[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Disconnecting session.
dbug: Renci.SshNet.Session[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Shutting down socket.
dbug: Renci.SshNet.Session[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Disposing socket.
dbug: Renci.SshNet.Session[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Disposed socket.
info: Renci.SshNet.Session[0]
[5ACDE0EBBF5E5D1ACBF0B8452F18745B0D6126EFB878BD01C445FCD9FD937224] Raised exception
Renci.SshNet.Common.SshConnectionException: Software caused connection abort
---> System.Net.Sockets.SocketException (53): Software caused connection abort
at Renci.SshNet.Abstractions.SocketAbstraction.Read(Socket socket, Byte[] buffer, Int32 offset, Int32 size, TimeSpan readTimeout)
at Renci.SshNet.Session.TrySocketRead(Socket socket, Byte[] buffer, Int32 offset, Int32 length)
at Renci.SshNet.Session.ReceiveMessage(Socket socket)
at Renci.SshNet.Session.MessageListener()
--- End of inner exception stack trace ---

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da Renci.SshNet.Sftp.SftpSession.RequestClose e traccia il percorso dell’upload attraverso SftpClient.InternalUploadFile e InternalSynchronizeDirectories. Riproduci il fallimento con il server DataPowerSSH segnalato usando i log forniti e confrontalo con un upload riuscito tramite lftp. L’attività è completata quando la causa è isolata e l’upload funziona oppure segnala un errore specifico e risolvibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
networking
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.