SFTP -> Status code: 2, Message: 259, Server: No such file..

Advertisement

cjw
Joined:
Posts:
3
Location:
Rotterdam, The Netherlands

SFTP -> Status code: 2, Message: 259, Server: No such file..

I can connect using ftp an sftp. I can upload with ftp, but uploading using sftp gives error. First I'll give you ftp upload log and afterwards sftp upload log containing error. What do I need to change to be able to upload using sftp?

This is my upload script
echo on
option batch on
option confirm off
open ftp://username:password@hostname
cd /files/sql
option transfer binary
put -delete c:\backup\files\sql\*.*
close
exit

ftp upload log:
. 2010-04-27 14:58:16.153 --------------------------------------------------------------------------
. 2010-04-27 14:58:16.153 WinSCP Version 4.2.7 (Build 758) (OS 5.2.3790 Service Pack 2)
. 2010-04-27 14:58:16.153 Login time: dinsdag 27 april 2010 14:58:16
. 2010-04-27 14:58:16.153 --------------------------------------------------------------------------
. 2010-04-27 14:58:16.153 Session name: username@hostname
. 2010-04-27 14:58:16.153 Host name: hostname (Port: 21)
. 2010-04-27 14:58:16.153 User name: username (Password: Yes, Key file: No)
. 2010-04-27 14:58:16.153 Tunnel: No
. 2010-04-27 14:58:16.153 Transfer Protocol: FTP
. 2010-04-27 14:58:16.153 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2010-04-27 14:58:16.153 Proxy: none
. 2010-04-27 14:58:16.153 FTP: FTPS: None; Passive: No [Force IP: No]
. 2010-04-27 14:58:16.153 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-04-27 14:58:16.153 Cache directory changes: Yes, Permanent: Yes
. 2010-04-27 14:58:16.153 DST mode: 1
. 2010-04-27 14:58:16.153 --------------------------------------------------------------------------
. 2010-04-27 14:58:16.153 Connecting to hostname ...
. 2010-04-27 14:58:16.169 Connected with hostname. Waiting for welcome message...
< 2010-04-27 14:58:16.169 220 (vsFTPd 2.0.5)
> 2010-04-27 14:58:16.169 USER username
< 2010-04-27 14:58:16.185 331 Please specify the password.
> 2010-04-27 14:58:16.185 PASS ****************
< 2010-04-27 14:58:16.185 230 Login successful.
> 2010-04-27 14:58:16.185 SYST
< 2010-04-27 14:58:16.200 215 UNIX Type: L8
> 2010-04-27 14:58:16.200 FEAT
< 2010-04-27 14:58:16.200 211-Features:
< 2010-04-27 14:58:16.200  EPRT
< 2010-04-27 14:58:16.200  EPSV
< 2010-04-27 14:58:16.200  MDTM
< 2010-04-27 14:58:16.200  PASV
< 2010-04-27 14:58:16.200  REST STREAM
< 2010-04-27 14:58:16.200  SIZE
< 2010-04-27 14:58:16.200  TVFS
< 2010-04-27 14:58:16.200 211 End
. 2010-04-27 14:58:16.200 Connected
. 2010-04-27 14:58:16.200 --------------------------------------------------------------------------
. 2010-04-27 14:58:16.200 Using FTP protocol.
. 2010-04-27 14:58:16.200 Doing startup conversation with host.
> 2010-04-27 14:58:16.200 PWD
< 2010-04-27 14:58:16.216 257 "/"
. 2010-04-27 14:58:16.216 Getting current directory name.
. 2010-04-27 14:58:16.216 Startup conversation with host finished.
. 2010-04-27 14:58:16.216 Cached directory change via "/files/sql" to "/files/sql".
. 2010-04-27 14:58:16.216 Getting current directory name.
. 2010-04-27 14:58:16.216 Copying 2 files/directories to remote directory "/files/sql"
. 2010-04-27 14:58:16.216   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask: 
. 2010-04-27 14:58:16.216   TM: B; ClAr: No; CPS: 0; ExclM(No): 
. 2010-04-27 14:58:16.216   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2010-04-27 14:58:16.216 File: "c:\backup\files\sql\q1.txt"
. 2010-04-27 14:58:16.216 Copying "c:\backup\files\sql\q1.txt" to remote directory started.
. 2010-04-27 14:58:16.216 Binary transfer mode selected.
. 2010-04-27 14:58:16.216 Starting upload of c:\backup\files\sql\q1.txt
> 2010-04-27 14:58:16.216 CWD /files/sql/
< 2010-04-27 14:58:16.216 250 Directory successfully changed.
> 2010-04-27 14:58:16.216 PWD
< 2010-04-27 14:58:16.216 257 "/files/sql"
> 2010-04-27 14:58:16.216 TYPE A
< 2010-04-27 14:58:16.232 200 Switching to ASCII mode.
> 2010-04-27 14:58:16.232 PORT 193,219,116,196,6,194
< 2010-04-27 14:58:16.232 200 PORT command successful. Consider using PASV.
> 2010-04-27 14:58:16.232 LIST
< 2010-04-27 14:58:16.247 150 Here comes the directory listing.
< 2010-04-27 14:58:16.247 226 Directory send OK.
> 2010-04-27 14:58:16.247 TYPE I
< 2010-04-27 14:58:16.247 200 Switching to Binary mode.
> 2010-04-27 14:58:16.247 PORT 193,219,116,196,6,195
< 2010-04-27 14:58:16.263 200 PORT command successful. Consider using PASV.
> 2010-04-27 14:58:16.263 STOR q1.txt
< 2010-04-27 14:58:16.263 150 Ok to send data.
< 2010-04-27 14:58:16.278 226 File receive OK.
. 2010-04-27 14:58:16.278 Upload successful
. 2010-04-27 14:58:16.278 File: "c:\backup\files\sql\q2.txt"
. 2010-04-27 14:58:16.278 Copying "c:\backup\files\sql\q2.txt" to remote directory started.
. 2010-04-27 14:58:16.278 Binary transfer mode selected.
. 2010-04-27 14:58:16.278 Starting upload of c:\backup\files\sql\q2.txt
> 2010-04-27 14:58:16.278 TYPE I
< 2010-04-27 14:58:16.278 200 Switching to Binary mode.
> 2010-04-27 14:58:16.278 PORT 193,219,116,196,6,196
< 2010-04-27 14:58:16.294 200 PORT command successful. Consider using PASV.
> 2010-04-27 14:58:16.294 STOR q2.txt
< 2010-04-27 14:58:16.310 150 Ok to send data.
< 2010-04-27 14:58:16.310 226 File receive OK.
. 2010-04-27 14:58:16.310 Upload successful
. 2010-04-27 14:58:16.310 Disconnected from server

This is my upload script using sftp. Only the open line is different
open sftp://username:password@hostname -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

sftp upload log containing error:
. 2010-04-27 14:48:26.783 --------------------------------------------------------------------------
. 2010-04-27 14:48:26.783 WinSCP Version 4.2.7 (Build 758) (OS 5.2.3790 Service Pack 2)
. 2010-04-27 14:48:26.783 Login time: dinsdag 27 april 2010 14:48:26
. 2010-04-27 14:48:26.783 --------------------------------------------------------------------------
. 2010-04-27 14:48:26.783 Session name: username@hostname
. 2010-04-27 14:48:26.783 Host name: hostname (Port: 22)
. 2010-04-27 14:48:26.783 User name: username (Password: Yes, Key file: No)
. 2010-04-27 14:48:26.783 Tunnel: No
. 2010-04-27 14:48:26.783 Transfer Protocol: SFTP
. 2010-04-27 14:48:26.783 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2010-04-27 14:48:26.783 Proxy: none
. 2010-04-27 14:48:26.783 SSH protocol version: 2; Compression: No
. 2010-04-27 14:48:26.783 Bypass authentication: No
. 2010-04-27 14:48:26.783 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2010-04-27 14:48:26.783 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2010-04-27 14:48:26.783 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2010-04-27 14:48:26.783 SFTP Bugs: -,-
. 2010-04-27 14:48:26.783 Return code variable: Autodetect; Lookup user groups: Yes
. 2010-04-27 14:48:26.783 Shell: default, EOL: 0
. 2010-04-27 14:48:26.783 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2010-04-27 14:48:26.783 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2010-04-27 14:48:26.783 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-04-27 14:48:26.783 Cache directory changes: Yes, Permanent: Yes
. 2010-04-27 14:48:26.783 DST mode: 1
. 2010-04-27 14:48:26.783 --------------------------------------------------------------------------
. 2010-04-27 14:48:26.783 Looking up host "hostname"
. 2010-04-27 14:48:26.783 Connecting to hostname port 22
. 2010-04-27 14:48:26.814 Server version: SSH-2.0-OpenSSH_4.3p2 Debian-9etch3
. 2010-04-27 14:48:26.814 Using SSH protocol version 2
. 2010-04-27 14:48:26.814 We claim version: SSH-2.0-WinSCP_release_4.2.7
. 2010-04-27 14:48:26.814 Doing Diffie-Hellman group exchange
. 2010-04-27 14:48:26.861 Doing Diffie-Hellman key exchange with hash SHA-1
. 2010-04-27 14:48:27.033 Host key fingerprint is:
. 2010-04-27 14:48:27.033 ssh-rsa 1024 f8:3b:f3:cc:66:87:ec:03:f3:1d:f3:96:cd:45:74:82
. 2010-04-27 14:48:27.033 Initialised AES-256 SDCTR client->server encryption
. 2010-04-27 14:48:27.033 Initialised HMAC-SHA1 client->server MAC algorithm
. 2010-04-27 14:48:27.033 Initialised AES-256 SDCTR server->client encryption
. 2010-04-27 14:48:27.033 Initialised HMAC-SHA1 server->client MAC algorithm
! 2010-04-27 14:48:27.080 Using username "username".
. 2010-04-27 14:48:27.095 Prompt (5, SSH server authentication, Using keyboard-interactive authentication., Password: )
. 2010-04-27 14:48:27.095 Using stored password.
. 2010-04-27 14:48:27.095 Prompt (5, SSH server authentication, , <no prompt>)
. 2010-04-27 14:48:27.095 Ignoring empty SSH server authentication request
. 2010-04-27 14:48:27.111 Access granted
. 2010-04-27 14:48:27.111 Opened channel for session
. 2010-04-27 14:48:27.173 Started a shell/command
. 2010-04-27 14:48:27.173 --------------------------------------------------------------------------
. 2010-04-27 14:48:27.173 Using SFTP protocol.
. 2010-04-27 14:48:27.173 Doing startup conversation with host.
> 2010-04-27 14:48:27.173 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2010-04-27 14:48:27.173 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2010-04-27 14:48:27.173 SFTP version 3 negotiated.
. 2010-04-27 14:48:27.173 We believe the server has signed timestamps bug
. 2010-04-27 14:48:27.173 We will use UTF-8 strings for status messages only
. 2010-04-27 14:48:27.173 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2010-04-27 14:48:27.173 Getting current directory name.
. 2010-04-27 14:48:27.173 Getting real path for '.'
> 2010-04-27 14:48:27.173 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2010-04-27 14:48:27.189 Type: SSH_FXP_NAME, Size: 51, Number: 16
. 2010-04-27 14:48:27.189 Real path is '/home/username'
. 2010-04-27 14:48:27.189 Startup conversation with host finished.
. 2010-04-27 14:48:27.189 Cached directory change via "/files/sql" to "/files/sql".
. 2010-04-27 14:48:27.189 Getting current directory name.
. 2010-04-27 14:48:27.189 Copying 2 files/directories to remote directory "/files/sql"
. 2010-04-27 14:48:27.189   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask: 
. 2010-04-27 14:48:27.189   TM: B; ClAr: No; CPS: 0; ExclM(No): 
. 2010-04-27 14:48:27.189   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2010-04-27 14:48:27.189 File: "c:\backup\files\sql\q1.txt"
. 2010-04-27 14:48:27.189 Copying "c:\backup\files\sql\q1.txt" to remote directory started.
. 2010-04-27 14:48:27.189 Binary transfer mode selected.
. 2010-04-27 14:48:27.189 Opening remote file.
> 2010-04-27 14:48:27.189 Type: SSH_FXP_OPEN, Size: 42, Number: 259
< 2010-04-27 14:48:27.189 Type: SSH_FXP_STATUS, Size: 29, Number: 259
< 2010-04-27 14:48:27.189 Status code: 2, Message: 259, Server: No such file, Language:  
> 2010-04-27 14:48:27.189 Type: SSH_FXP_LSTAT, Size: 26, Number: 519
< 2010-04-27 14:48:27.189 Type: SSH_FXP_STATUS, Size: 29, Number: 519
< 2010-04-27 14:48:27.189 Status code: 2, Message: 519, Server: No such file, Language:  
* 2010-04-27 14:48:27.189 (ETerminal) No such file or directory.
* 2010-04-27 14:48:27.189 Error code: 2
* 2010-04-27 14:48:27.189 Error message from server: No such file
* 2010-04-27 14:48:27.189 Request code: 3
. 2010-04-27 14:48:27.189 Asking user:
. 2010-04-27 14:48:27.189 Cannot create remote file '/files/sql/q1.txt'. ("No such file or directory.
. 2010-04-27 14:48:27.189 Error code: 2
. 2010-04-27 14:48:27.189 Error message from server: No such file
. 2010-04-27 14:48:27.189 Request code: 3")
* 2010-04-27 14:48:27.189 (EScpSkipFile) Cannot create remote file '/files/sql/q1.txt'.
* 2010-04-27 14:48:27.189 No such file or directory.
* 2010-04-27 14:48:27.189 Error code: 2
* 2010-04-27 14:48:27.189 Error message from server: No such file
* 2010-04-27 14:48:27.189 Request code: 3
. 2010-04-27 14:48:27.189 Closing connection.
. 2010-04-27 14:48:27.189 Sending special code: 12
. 2010-04-27 14:48:27.189 Sent EOF message

The error that I mean is and then it repeats some times
> 2010-04-27 14:48:27.189 Type: SSH_FXP_OPEN, Size: 42, Number: 259
< 2010-04-27 14:48:27.189 Type: SSH_FXP_STATUS, Size: 29, Number: 259
< 2010-04-27 14:48:27.189 Status code: 2, Message: 259, Server: No such file, Language:  
> 2010-04-27 14:48:27.189 Type: SSH_FXP_LSTAT, Size: 26, Number: 519
< 2010-04-27 14:48:27.189 Type: SSH_FXP_STATUS, Size: 29, Number: 519
< 2010-04-27 14:48:27.189 Status code: 2, Message: 519, Server: No such file, Language:  
* 2010-04-27 14:48:27.189 (ETerminal) No such file or directory.

Reply with quote

Advertisement

cjw

Re: SFTP -> Status code: 2, Message: 259, Server: No such file..

Wait, this is probably nothing. I'm fixing problem now.... I will remove post probably in 5 minutes or so

Reply with quote

cjw
Joined:
Posts:
3
Location:
Rotterdam, The Netherlands

It was because cd / in ftp leads to different folder than cd / in sftp.

after doing cd / in sftp it couldn't find files.

Cause maybe helpful for other people experiencing same error uploading with sftp instead of ftp... I'll leave the post.

Reply with quote

Advertisement

You can post new topics in this forum