サーバーにファイルをアップロードするときにWinSCPエラー「そのようなファイルはありません」

アンドリューファーガソン

現在、WinSCPAPIを使用してプログラムでファイルをサーバーにアップロードしようとしています。

ただし、これを実行しようとするたびにログファイルを確認すると、リモートファイルまたはそのディレクトリが存在しないというエラーが表示されます。

コード:

Dim objftp As New WinSCP.SessionOptions
objftp.HostName = Server
objftp.PortNumber = Port
objftp.Protocol = Protocol.Sftp
objftp.UserName = User
objftp.Password = Password
objftp.PrivateKeyPassphrase = "passPhrase"
objftp.SshPrivateKeyPath = "\\PathToPrivatekey.ppk"
objftp.GiveUpSecurityAndAcceptAnySshHostKey = True

Dim session As New Session

session.Timeout = System.TimeSpan.FromSeconds(30)
session.SessionLogPath = "C:\Temp\ftpLog\winscp.log"
session.Open(objFTP)

Dim transferOptions As New TransferOptions

transferOptions.TransferMode = TransferMode.Binary
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off
Dim transferResult As TransferOperationResult

strLocalFile = FilePath & FileName
strRemoteFile = FileName
transferResult = session.PutFiles(strLocalFile, "/In/", False, transferOptions)

transferResult.Check()

session.Close()

これで、サーバーに接続されたWinSCPを手動で使用し、/In/ディレクトリが存在することを確認できます私はこれを行うためにWindowsOSを使用しています。接続先のサーバーはサードパーティであるため、詳細がわかりません。

コードに欠けているものはありますか?

編集:要求に応じて、これは私のログです:

プログラムで試してからログに記録します。

. 2016-12-23 10:52:07.089 --------------------------------------------------------------------------
. 2016-12-23 10:52:07.089 WinSCP Version 5.9.3 (Build 7136) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
. 2016-12-23 10:52:07.089 Configuration: nul
. 2016-12-23 10:52:07.089 Log level: Normal
. 2016-12-23 10:52:07.089 Local account: user\Andrew
. 2016-12-23 10:52:07.089 Working directory: \\WorkingDIr\
. 2016-12-23 10:52:07.089 Process ID: 12648
. 2016-12-23 10:52:07.090 Command-line: "\\WorkingDir\winscp.exe" /xmllog="C:\Users\andrew\AppData\Local\Temp\wscp46E9.02B7AFA0.tmp" /xmlgroups /xmllogrequired /nointeractiveinput /dotnet=593  /ini=nul /log="C:\Temp\ftpLog\winscp.log"  /console /consoleinstance=_10192_57352375_875
. 2016-12-23 10:52:07.090 Time zone: Current: GMT+0, Standard: GMT+0 (GMT Standard Time), DST: GMT+1 (GMT Daylight Time), DST Start: 27/03/2016, DST End: 30/10/2016
. 2016-12-23 10:52:07.090 Login time: 23 December 2016 10:52:07
. 2016-12-23 10:52:07.090 --------------------------------------------------------------------------
. 2016-12-23 10:52:07.094 Script: Retrospectively logging previous script records:
> 2016-12-23 10:52:07.094 Script: option batch on
< 2016-12-23 10:52:07.094 Script: batch           on        
< 2016-12-23 10:52:07.094 Script: reconnecttime   120       
> 2016-12-23 10:52:07.094 Script: option confirm off
< 2016-12-23 10:52:07.094 Script: confirm         off       
> 2016-12-23 10:52:07.094 Script: option reconnecttime 120
< 2016-12-23 10:52:07.094 Script: reconnecttime   120       
> 2016-12-23 10:52:07.094 Script: open sftp://user:***@server.com:22 -hostkey="*" -privatekey="\\containingDir\PrivateKey.ppk" -passphrase=*** -timeout=15
. 2016-12-23 10:52:07.094 --------------------------------------------------------------------------
. 2016-12-23 10:52:07.094 Session name: [email protected] (Ad-Hoc site)
. 2016-12-23 10:52:07.094 Host name: server.com (Port: 22)
. 2016-12-23 10:52:07.095 User name: user(Password: Yes, Key file: Yes, Passphrase: Yes)
. 2016-12-23 10:52:07.095 Tunnel: No
. 2016-12-23 10:52:07.095 Transfer Protocol: SFTP
. 2016-12-23 10:52:07.095 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2016-12-23 10:52:07.095 Disable Nagle: No
. 2016-12-23 10:52:07.095 Proxy: None
. 2016-12-23 10:52:07.095 Send buffer: 262144
. 2016-12-23 10:52:07.095 SSH protocol version: 2; Compression: No
. 2016-12-23 10:52:07.095 Bypass authentication: No
. 2016-12-23 10:52:07.095 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2016-12-23 10:52:07.095 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2016-12-23 10:52:07.095 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2016-12-23 10:52:07.095 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2016-12-23 10:52:07.095 Simple channel: Yes
. 2016-12-23 10:52:07.095 Return code variable: Autodetect; Lookup user groups: Auto
. 2016-12-23 10:52:07.095 Shell: default
. 2016-12-23 10:52:07.095 EOL: LF, UTF: Auto
. 2016-12-23 10:52:07.095 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2016-12-23 10:52:07.095 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2016-12-23 10:52:07.095 SFTP Bugs: Auto,Auto
. 2016-12-23 10:52:07.095 SFTP Server: default
. 2016-12-23 10:52:07.095 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-12-23 10:52:07.095 Cache directory changes: Yes, Permanent: Yes
. 2016-12-23 10:52:07.095 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2016-12-23 10:52:07.095 DST mode: Unix
. 2016-12-23 10:52:07.095 --------------------------------------------------------------------------
. 2016-12-23 10:52:07.106 Looking up host "server.com" for SSH connection
. 2016-12-23 10:52:07.126 Connecting to 11.11.11.11 port 22
. 2016-12-23 10:52:07.307 We claim version: SSH-2.0-WinSCP_release_5.9.3
. 2016-12-23 10:52:07.496 Server version: SSH-2.0-9.99 sshlib: 8.1.0.0
. 2016-12-23 10:52:07.496 We believe remote version has SSH-2 channel request bug
. 2016-12-23 10:52:07.496 Using SSH protocol version 2
. 2016-12-23 10:52:07.504 Doing Diffie-Hellman group exchange
. 2016-12-23 10:52:07.928 Doing Diffie-Hellman key exchange with hash SHA-1
. 2016-12-23 10:52:08.307 Host key fingerprint is:
. 2016-12-23 10:52:08.307 ssh-rsa fingerprint
. 2016-12-23 10:52:08.308 Verifying host key host key
* 2016-12-23 10:52:08.308 WARNING! Giving up security and accepting any host key as configured!
. 2016-12-23 10:52:08.310 Initialised AES-256 SDCTR client->server encryption
. 2016-12-23 10:52:08.310 Initialised HMAC-SHA1 client->server MAC algorithm
. 2016-12-23 10:52:08.310 Initialised AES-256 SDCTR server->client encryption
. 2016-12-23 10:52:08.310 Initialised HMAC-SHA1 server->client MAC algorithm
. 2016-12-23 10:52:08.741 Reading key file "\\PrivateKseyDir\PrivateKey.ppk"
. 2016-12-23 10:52:08.764 Pageant is running. Requesting keys.
. 2016-12-23 10:52:08.766 Pageant has 0 SSH-2 keys
. 2016-12-23 10:52:08.766 Configured key file not in Pageant
! 2016-12-23 10:52:08.766 Using username "user".
. 2016-12-23 10:52:08.958 Server offered these authentication methods: publickey,password
. 2016-12-23 10:52:08.958 Offered public key
. 2016-12-23 10:52:09.193 Offer of public key accepted
! 2016-12-23 10:52:09.193 Authenticating with public key "rsa-key-20161222"
. 2016-12-23 10:52:09.194 Prompt (passphrase, "SSH key passphrase", <no instructions>, "Passphrase for key "rsa-key-20161222": ")
. 2016-12-23 10:52:09.194 Using configured passphrase.
. 2016-12-23 10:52:09.316 Sent public key signature
! 2016-12-23 10:52:09.504 Server refused public-key signature despite accepting key!
. 2016-12-23 10:52:09.504 Server refused public-key signature despite accepting key!
. 2016-12-23 10:52:09.504 Server offered these authentication methods: password
. 2016-12-23 10:52:09.504 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2016-12-23 10:52:09.504 Using stored password.
. 2016-12-23 10:52:09.505 Sent password
. 2016-12-23 10:52:09.831 Access granted
. 2016-12-23 10:52:09.831 Opening session as main channel
. 2016-12-23 10:52:10.017 Opened main channel
. 2016-12-23 10:52:10.426 Started a shell/command
. 2016-12-23 10:52:10.426 --------------------------------------------------------------------------
. 2016-12-23 10:52:10.432 Using SFTP protocol.
. 2016-12-23 10:52:10.432 Doing startup conversation with host.
> 2016-12-23 10:52:10.441 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2016-12-23 10:52:10.631 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2016-12-23 10:52:10.631 SFTP version 3 negotiated.
. 2016-12-23 10:52:10.631 We believe the server has signed timestamps bug
. 2016-12-23 10:52:10.631 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2016-12-23 10:52:10.635 Getting current directory name.
. 2016-12-23 10:52:10.639 Getting real path for '.'
> 2016-12-23 10:52:10.639 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2016-12-23 10:52:10.825 Type: SSH_FXP_NAME, Size: 43, Number: 16
. 2016-12-23 10:52:10.825 Real path is '/Home/user'
. 2016-12-23 10:52:10.825 Startup conversation with host finished.
< 2016-12-23 10:52:10.826 Script: Active session: [1] server.com
> 2016-12-23 10:52:11.141 Script: pwd
< 2016-12-23 10:52:11.141 Script: /Home/user
> 2016-12-23 10:52:26.491 Script: put  -nopermissions -preservetime -transfer="binary" -resumesupport="off" -- "\\fileDir\testFile.dat" "/In/testFile.dat"
. 2016-12-23 10:52:26.497 Copying 1 files/directories to remote directory "/In/"
. 2016-12-23 10:52:26.497   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: N (102400); CalcS: No; Mask: testFile.dat
. 2016-12-23 10:52:26.497   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2016-12-23 10:52:26.497   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2016-12-23 10:52:26.502 File: '\\fileDir\testFile.dat' [2016-12-23T06:31:02.639Z] [212952]
. 2016-12-23 10:52:26.504 Copying "\\fileDir\testFile.dat" to remote directory started.
. 2016-12-23 10:52:26.504 Binary transfer mode selected.
. 2016-12-23 10:52:26.505 Opening remote file.
> 2016-12-23 10:52:26.509 Type: SSH_FXP_OPEN, Size: 50, Number: 259
< 2016-12-23 10:52:26.681 Type: SSH_FXP_STATUS, Size: 31, Number: 259
< 2016-12-23 10:52:26.681 Status code: 2, Message: 259, Server: No such file, Language: en 
> 2016-12-23 10:52:26.681 Type: SSH_FXP_LSTAT, Size: 34, Number: 519
< 2016-12-23 10:52:26.849 Type: SSH_FXP_STATUS, Size: 31, Number: 519
< 2016-12-23 10:52:26.849 Status code: 2, Message: 519, Server: No such file, Language: en 
* 2016-12-23 10:52:26.849 (ETerminal) No such file or directory.
* 2016-12-23 10:52:26.849 Error code: 2
* 2016-12-23 10:52:26.849 Error message from server (en): No such file
. 2016-12-23 10:52:26.850 Asking user:
. 2016-12-23 10:52:26.850 Cannot create remote file '/In/testFile.dat'. ("No such file or directory.
. 2016-12-23 10:52:26.850 Error code: 2
. 2016-12-23 10:52:26.850 Error message from server (en): No such file")
< 2016-12-23 10:52:26.850 Script: Cannot create remote file '/In/testFile.dat'.
< 2016-12-23 10:52:26.850 Script: No such file or directory.
< 2016-12-23 10:52:26.850 Error code: 2
< 2016-12-23 10:52:26.850 Error message from server (en): No such file
* 2016-12-23 10:52:26.862 (EScpSkipFile) Cannot create remote file '/In/testFile.dat'.
* 2016-12-23 10:52:26.862 No such file or directory.
* 2016-12-23 10:52:26.862 Error code: 2
* 2016-12-23 10:52:26.862 Error message from server (en): No such file
. 2016-12-23 10:52:26.862 Script: Failed

そして、これはGUIで正常に実行した私からのログです。

> 2016-12-23 10:59:12.037 Type: SSH_FXP_SETSTAT, Size: 54, Number: 2057
< 2016-12-23 10:59:12.221 Type: SSH_FXP_STATUS, Size: 40, Number: 2057
< 2016-12-23 10:59:12.221 Status code: 8, Message: 2057, Server: Operation unsupported, Language: en 
* 2016-12-23 10:59:12.222 (ETerminal) The server does not support the operation.
* 2016-12-23 10:59:12.222 Error code: 8
* 2016-12-23 10:59:12.222 Error message from server (en): Operation unsupported
. 2016-12-23 10:59:12.226 Asking user:
. 2016-12-23 10:59:12.226 **Upload of file 'sftpTest.dat' was successful, but error occurred while setting the permissions and/or timestamp.**
. 2016-12-23 10:59:12.226 
. 2016-12-23 10:59:12.226 If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on 'Ignore permission errors' option. ("The server does not support the operation.
. 2016-12-23 10:59:12.226 Error code: 8
. 2016-12-23 10:59:12.226 Error message from server (en): Operation unsupported")
* 2016-12-23 10:59:14.385 (EScpSkipFile) **Upload of file 'sftpTest.dat' was successful, but error occurred while setting the permissions and/or timestamp.**
* 2016-12-23 10:59:14.385 
* 2016-12-23 10:59:14.385 If the problem persists, turn off setting permissions or preserving timestamp. Alternatively you can turn on 'Ignore permission errors' option.
* 2016-12-23 10:59:14.385 The server does not support the operation.
* 2016-12-23 10:59:14.385 Error code: 8
* 2016-12-23 10:59:14.385 Error message from server (en): Operation unsupported
. 2016-12-23 10:59:14.386 Listing directory "/Home/user".
> 2016-12-23 10:59:14.386 Type: SSH_FXP_OPENDIR, Size: 20, Number: 4875
< 2016-12-23 10:59:14.602 Type: SSH_FXP_HANDLE, Size: 13, Number: 4875
> 2016-12-23 10:59:14.603 Type: SSH_FXP_READDIR, Size: 13, Number: 5132
< 2016-12-23 10:59:14.817 Type: SSH_FXP_NAME, Size: 245, Number: 5132
> 2016-12-23 10:59:14.817 Type: SSH_FXP_READDIR, Size: 13, Number: 5388
< 2016-12-23 10:59:15.022 Type: SSH_FXP_STATUS, Size: 30, Number: 5388
< 2016-12-23 10:59:15.022 Status code: 1
> 2016-12-23 10:59:15.022 Type: SSH_FXP_CLOSE, Size: 13, Number: 5636
. 2016-12-23 10:59:15.022 In;d;0;2016-12-20T15:48:00.000Z;"0" [0];"0" [0];rwxrwxrwx;1
. 2016-12-23 10:59:15.022 sftpTest.dat;-;212952;2016-12-23T10:59:00.000Z;"0" [0];"0" [0];rw-rw-rw-;1
マルティン・プリクリル

確かなことはわかりませんが、十分な情報が提供されていないため、実際のターゲットパスは/Home/user/In/、だけでなく、のようになっているはずです/In/

GUIログから、ホームディレクトリは/Home/user/はなく、であるため、アカウントはchrootされていないよう/です。

. 2016-12-23 10:59:14.386 Listing directory "/Home/user".

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Express-fileupload-Node.jsを使用してファイルをアップロードするときに、そのようなファイルまたはディレクトリエラーはありません

Rails Errno :: ENOENT:アップロードを保存するときにそのようなファイルやディレクトリはありません

「Hello、world!」をコンパイルするときにそのようなファイルエラーはありません。wx-macOSのwidgetsアプリ

「そのようなファイルはありません」というエラーとアップグレードコードを回避する方法

アップロードされたファイルをGOLANGおよびPOLYMER httpを使用してサーバーに保存できません:そのようなファイルはありません

レトロフィットでファイルをアップロード中にエラーが発生する(そのようなファイルまたはディレクトリはありません)

サーバーエラーでインターネットなしでノードパッケージをグローバルにインストールする:そのようなファイルまたはディレクトリはありません

SSHウィンドウで「gcloudcomputescp」コマンドを使用してファイルをvmインスタンスにアップロードすると、「そのようなファイルまたはディレクトリはありません」エラーが発生します

RailsアプリをHerokuにデプロイするときに「そのようなファイルを読み込めません」エラー

Swift3.0 fileAttributesは、既存のファイルに「そのようなファイルはありません」エラーをスローします

アップロードされたファイルコードの文字列置換で「FileNotFoundError:[Errno 2]そのようなファイルまたはディレクトリはありません」エラーを修正する方法は?

Python pysftp.putは、ファイルがアップロードされているにもかかわらず、「そのようなファイルはありません」という例外を発生させます

ヘッダーファイルをインクルードしようとすると、「そのようなファイルまたはディレクトリはありません」というエラーが表示されるのはなぜですか?

Dockerアルパインイメージ:エラー2002(HY000):ソケット '/run/mysqld/mysqld.sock'を介してローカルMySQLサーバーに接続できません(2 "そのようなファイルまたはディレクトリはありません")

共有ライブラリにステップインするGDBは、デバッグシンボルがロードされていても、「そのようなファイルはありません」と表示します

エラーが発生するmysqli :: real_connect():( HY000 / 2002):ライブサーバー上のプロジェクトにアクセスしようとすると、そのようなファイルまたはディレクトリはありません

ロードするそのようなファイルはありません-ラッシュ(MissingSourceFile)

Composerをグローバルにインストールすると、「そのようなファイルまたはディレクトリはありません」というエラーが表示されます

プログラムエラー:./ program:共有ライブラリのロード中にエラーが発生しました:lib <xxx> .so:共有オブジェクトファイルを開くことができません:そのようなファイルまたはディレクトリはありません

Herokuにデプロイしようとしたときに「致命的なエラー:Carbon / Carbon.h:そのようなファイルまたはディレクトリがありません」を修正する方法-(Django)

Windowsアプリ:致命的なエラーC1083:インクルードファイルを開くことができません: 'gdiplus.h':そのようなファイルまたはディレクトリはありません

OSX Yosemiteにアップグレードした後、gfortranでコンパイルできないのはなぜですか?gfortranエラー:libgfortran.spec:そのようなファイルまたはディレクトリはありません

ユーザーsystemdサービスをセットアップしようとしています:ロード済み:見つかりません(理由:そのようなファイルまたはディレクトリがありません)

アプリをherokuにプッシュしようとすると、このエラーが発生しますFileNotFoundError:[Errno 2]そのようなファイルまたはディレクトリはありません: '/ app / gettingstarted / media'

DockerシークレットをAzureWebアプリに渡すときにエラーが発生しました 'そのようなファイルまたはディレクトリはありません:' / run / secrets / '

PowerShellのWinSCPを使用してドライブ全体をサーバーにアップロードし、読み取ることができないすべてのファイルとフォルダーをスキップします

プラットフォームツールセットをv140_xpに変更すると、「Windows.h:そのようなファイルまたはディレクトリはありません」エラーが発生します

symfonyでファイルをアップロードするときにファイルが見つかりませんエラー

Heroku は、このアプリケーションに使用するビルドパックを自動的に検出できません。ファイルを heroku にデプロイ/プッシュしようとするとエラーが発生する - 修正はありますか?

TOP 一覧

  1. 1

    STSでループプロセス「クラスパス通知の送信」のループを停止する方法

  2. 2

    Spring Boot Filter is not getting invoked if remove @component in fitler class

  3. 3

    Python / SciPyのピーク検出アルゴリズム

  4. 4

    セレンのモデルダイアログからテキストを抽出するにはどうすればよいですか?

  5. 5

    tkinterウィンドウを閉じてもPythonプログラムが終了しない

  6. 6

    androidsoongビルドシステムによるネイティブコードカバレッジ

  7. 7

    ZScalerと証明書の問題により、Dockerを使用できません

  8. 8

    VisualStudioコードの特異点/ドッカー画像でPythonインタープリターを使用するにはどうすればよいですか?

  9. 9

    ビュー用にサイズ変更した後の画像の高さと幅を取得する方法

  10. 10

    二次導関数を数値計算するときの大きな誤差

  11. 11

    Ansibleで複数行のシェルスクリプトを実行する方法

  12. 12

    画像変更コードを実行してもボタンの画像が変更されない

  13. 13

    Reactでclsxを使用する方法

  14. 14

    Three.js indexed BufferGeometry vs. InstancedBufferGeometry

  15. 15

    __init__。pyファイルの整理中に循環インポートエラーが発生しました

  16. 16

    PyTesseractを使用した背景色のため、スクリーンショットからテキストを読み取ることができません

  17. 17

    値間の一致を見つける最も簡単な方法は何ですか

  18. 18

    reCAPTCHA-エラーコード:ユーザーの応答を検証するときの「missing-input-response」、「missing-input-secret」(POSTの詳細がない)

  19. 19

    三項演算子良い練習の代わりとしてOptional.ofNullableを使用していますか?

  20. 20

    好き/愛の関係のためのデータベース設計

  21. 21

    エンティティIDを含む@RequestBody属性をSpringの対応するエンティティに変換します

ホットタグ

アーカイブ