Jump to content


Photo

Using SFTP, timestamps not honored


This topic has been archived. This means that you cannot reply to this topic.
14 replies to this topic

#1 tsimmons

tsimmons
  • Members
  • 12 posts

Posted 29 March 2009 - 09:56 PM

When connecting using SFTP, the timestamps are not being set properly when uploading. I am connecting with SFTP (Server is running OpenSSH on Windows) and I have the favorite properties set thusly:

Transfer->Files->Keep Modify Time
Upload = Enable
Download = Enable
Server to Server = Enable

Transfer->Files->Keep Create Time
Upload = Enable
Download = Enable
Server to Server = Enable

Downloads appear to work fine. Uploads always get stamped with the current time, not the timestamp of the uploaded file. Both machines are in the same timezone and the favorite's timezone is set in the favorite properties as well.

Here is a log of a transfer ...

[16:40:07] SmartFTP v3.0.1026.8
[16:40:07] Resolving host name "..."
[16:40:07] Connecting to .... Port: 22
[16:40:07] SSH-2.0-OpenSSH_5.2
[16:40:07] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_5.2"
[16:40:07] SSH protocol version reply. Client Id: "SSH-2.0-SmartFTP"
[16:40:09] Computing session key.
[16:40:09] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[16:40:10] Key exchange completed.
[16:40:10] Host Key Algorithm: ssh-rsa
[16:40:10] Client to Server Encryption: aes256-ctr
[16:40:10] Server to Client Encryption: aes256-ctr
[16:40:10] Session MAC: hmac-sha1
[16:40:10] Client to Server Compression: none
[16:40:10] Server to Client Compression: none
[16:40:10] Authentication request. Method: "none"
[16:40:10] Server supported authentications: publickey,password,keyboard-interactive
[16:40:10] Authentication request. Method: "password"
[16:40:10] User authentication successful.
[16:40:11] SSH session established.
[16:40:11] Connected to ...
[16:40:11] RTT: 273.003 ms
[16:40:11] SFTP protocol version 3
[16:40:11] Detected Server Software: OpenSSH
[16:40:27] Resolving path "XXXXXXXXX".
[16:40:27] Path successfully resolved.
[16:40:27] Reading directory "XXXXXXXXX".
[16:40:28] 6797 bytes transferred. (10.8 KB/s) (609 ms)
[16:40:28] Directory listing complete.
[16:40:51] Getting attributes of "XXXXXXXX/testfile.txt".
[16:40:51] Attributes successfully obtained.
[16:40:58] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
[16:41:02] Getting attributes of "XXXXXXXXX/testfile.txt".
[16:41:02] Attributes successfully obtained.

The problem is the localfile testfile.txt has one timestamp, the server file is stamped with the time it was uploaded.

#2 mb

mb

    Developer

  • Administrators
  • 11526 posts

Posted 29 March 2009 - 10:05 PM

Please install the latest version:
http://www.smartftp.com/download

And if the problem persists please post the transfer log from the transfer queue. To get it double click the file in the transfer queue before it's processed.

Regards,
Mat

#3 tsimmons

tsimmons
  • Members
  • 12 posts

Posted 31 March 2009 - 03:27 AM

Thanks, Mat. Downloading the latest version 3.0.1026.24 doesn't fix it. Here's the log:

[22:21:40] Resolving host name "xxxxxx"
[22:21:40] Connecting to xxxxxx Port: 22
[22:21:40] SSH-2.0-OpenSSH_5.2
[22:21:40] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_5.2"
[22:21:40] SSH protocol version reply. Client Id: "SSH-2.0-SmartFTP"
[22:21:41] Computing session key.
[22:21:41] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[22:21:41] Key exchange completed.
[22:21:41] Host Key Algorithm: ssh-rsa
[22:21:41] Client to Server Encryption: aes256-ctr
[22:21:41] Server to Client Encryption: aes256-ctr
[22:21:41] Session MAC: hmac-sha1
[22:21:41] Client to Server Compression: none
[22:21:41] Server to Client Compression: none
[22:21:41] Authentication request. Method: "none"
[22:21:41] Server supported authentications: publickey,password,keyboard-interactive
[22:21:41] Authentication request. Method: "password"
[22:21:41] User authentication successful.
[22:21:42] SSH session established.
[22:21:42] Connected to xxxxxxx.
[22:21:42] RTT: 302.142 ms
[22:21:42] SFTP protocol version 3
[22:21:42] Detected Server Software: OpenSSH
[22:21:42] Resolving path "/xxxxxxxx".
[22:21:42] Path successfully resolved.
[22:21:42] Uploading file to "/xxxxxxxx/test.txt".
[22:21:42] Restarting at 0.
[22:21:43] 2006 bytes transferred. (15.6 KB/s) (125 ms)
[22:21:43] File successfully transferred.
[22:21:43] Setting attributes of "/xxxxxxxx/test.txt".
[22:21:43] Attributes successfully set.
[22:21:43] Setting attributes of "/xxxxxxxx/test.txt".
[22:21:43] Attributes successfully set.
[22:21:43] Getting attributes of "/xxxxxxxx/test.txt".
[22:21:44] Attributes successfully obtained.
[22:21:44] Source File Size=2006, Destination File Size=2006



Please install the latest version:
http://www.smartftp.com/download

And if the problem persists please post the transfer log from the transfer queue. To get it double click the file in the transfer queue before it's processed.

Regards,
Mat



#4 mb

mb

    Developer

  • Administrators
  • 11526 posts

Posted 31 March 2009 - 10:36 AM

Bug confirmed. Thank you for reporting. A newer version of SmartFTP will include the bug fix.

#5 mb

mb

    Developer

  • Administrators
  • 11526 posts

Posted 31 March 2009 - 09:46 PM

The version with the bug fix is now available:
http://www.smartftp.com/download

Regards,
Mat

#6 tsimmons

tsimmons
  • Members
  • 12 posts

Posted 02 April 2009 - 09:05 PM

The version with the bug fix is now available:
http://www.smartftp.com/download

Regards,
Mat

Works! Thanks! :D

#7 unicomplex

unicomplex
  • Members
  • 5 posts

Posted 12 September 2011 - 10:39 PM

I'm having the same problem with SmartFTP 4.0.1215.0 when using SFTP (I just upgraded to be able to use SFTP, so there may be something that I missed but when I read this entry I found that my trouble is exactly the same, although my version is newer).

Settings:

Transfer->Files->Keep Modify Time
Upload = Enable
Download = Enable
Server to Server = Enable

Transfer->Files->Keep Create Time
Upload = Enable
Download = Enable
Server to Server = Enable

Downloads keep their modify dates, uploads are forced to the current date.

Also, when I want to overwrite files on the server, but my local copy has an earlier date, nothing is transferred at all. No warning window, no error message or anything. Is this part of the problem, or just a setting that I forgot?

The log:

[00:14:07] Resolving host name "XXXX"
[00:14:07] Connecting to XXX.XXX.XXX.XXX Port: 22
[00:14:08] SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3
[00:14:08] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3"
[00:14:08] SSH protocol version reply. Client Id: SSH-2.0-SmartFTP
[00:14:08] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[00:14:08] Server "ssh-rsa" host key fingerprint: XXXXXXXXXX
[00:14:08] Key exchange completed.
[00:14:08] Host Key Algorithm: ssh-rsa
[00:14:08] Client to Server Encryption: aes256-ctr
[00:14:08] Server to Client Encryption: aes256-ctr
[00:14:08] Session MAC: hmac-sha1
[00:14:08] Client to Server Compression: zlib@openssh.com
[00:14:08] Server to Client Compression: zlib@openssh.com
[00:14:08] Requesting service "ssh-userauth".
[00:14:09] RTT: 240.598 ms
[00:14:09] Authentication request. Method: none
[00:14:09] Server supported authentications: publickey,password
[00:14:09] Authentication request. Method: password
[00:14:09] User authentication successful.
[00:14:09] SSH session established.
[00:14:09] Connected to XXXX.
[00:14:09] Detected Server Software: OpenSSH
[00:14:09] Opening channel 0.
[00:14:09] Channel successfully opened (Local=0, Remote=0).
[00:14:09] Requesting subystem "sftp" (Local=0, Remote=0).
[00:14:09] Sending FXP initialization. Protocol version=6.
[00:14:09] SFTP protocol version 3

Now I try to overwrite a file on the server with a local one, but with an older date --> nothing happens
[00:14:55] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.

So in order to be able to transfer it I delete the remote file and upload my local version --> remote version gets its timestamp modified to the current time
[00:15:06] Deleting file "/XXXX/public_html/index.htm".
[00:15:07] File successfully deleted.
[00:15:10] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
[00:15:11] Getting attributes of "/XXXX/public_html/index.htm".
[00:15:11] Attributes successfully obtained.

#8 mb

mb

    Developer

  • Administrators
  • 11526 posts

Posted 12 September 2011 - 10:55 PM

>Upload keep date
Take a look at the transfer log and post it here. You can get the transfer log by double clicking the file in the transfer queue before the transfer has completed.

>overwrite
When you drag&drop a file to the server and there is already file with the same name, you will see a "file exist/conflict" dialog where you are prompted for the action. Select overwrite and the file will be overwritten.

#9 unicomplex

unicomplex
  • Members
  • 5 posts

Posted 12 September 2011 - 11:24 PM

Transfer log single (new) file:

[01:00:51] Operation Begin
[01:00:51] Resolving path "/srv/www/XXXX/public_html".
[01:00:51] Path successfully resolved to "/srv/www/XXXX/public_html".
[01:00:51] Remote file exist check: "news-05.htm".
[01:00:51] Getting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:51] 2 No such file
[01:00:51] Uploading file to "/srv/www/XXXX/public_html/news-05.htm".
[01:00:51] StartPosition=0, EndPosition=0.
[01:00:51] 35130 bytes transferred. (Unknown/s) (0 ms)
[01:00:51] Closing file handle.
[01:00:52] File successfully transferred.
[01:00:52] Setting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:52] Attributes successfully set.
[01:00:52] Getting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:52] Attributes successfully obtained.
[01:00:52] Source File Size=35130, Destination File Size=35130
[01:00:52] Operation End

Overwrite:

I checked my settings for "File Exists". It is "Remote Browser --> Use Default Settings". With this setting I won't have to confirm. But as I said, a newer file on the server is never overwritten, and nothing at all happens.

When I switch to "Ask" I can overwrite the file and (WOW!) it even keeps the date on the server. But confirming everything is not what I want. I always want to overwrite any file on the remote server, without the need to confirm. I could put up with a prompt window in case I try to overwrite a newer file but most definitely not for every file.

And now something very odd:

Actually, after switching "Remote Browser --> Use Default Settings" to "Ask" and even back, I tried again to upload a new file, and it kept the file date.

I then closed SmartFTP, I launched it and logged on again, and the problem was there again. Keep modify date doesn't work.

This problem is anything but reproducible for me.

#10 mb

mb

    Developer

  • Administrators
  • 11526 posts

Posted 13 September 2011 - 02:26 AM

>overwrite
What you are seeing is the expected behavior.

>date
From the log I can see that SmartFTP sets the file time:
[01:00:52] Setting attributes of "/srv/www/XXXX/public_html/news-05.htm".
So I believe the problem must be somewhere else.

#11 unicomplex

unicomplex
  • Members
  • 5 posts

Posted 13 September 2011 - 05:30 PM

Ok. Thanks for checking. I will check back with the server admin if there's anything we haven't taken into account yet.

However, I tried to transfer files with Firefox FireFTP plug-in, setting "keep timestamps in sync", and it worked just fine.

And one basic question about "File Exists" setting: So far (with conventional FTP) I always had it set to overwrite existing files, without asking. Provided that the server works correctly and is configured accordingly, what would be the setting in SmartFTP? What I need is a setting that always overwrites any file on the server with my local master record, irrespective of the date (and that keeps the date of the local file). The way it works now (either with manual confirmation or with the possibility that files are not transferred) is not an option by any means.

Is there a difference in the protocol or the configuration between FTP and SFTP that I'm not aware of?

#12 mb

mb

    Developer

  • Administrators
  • 11526 posts

Posted 13 September 2011 - 06:36 PM

>keep filetime
As far as I know FireFTP only supports the FTP protocol but in SmartFTP you are using SFTP. Try to switch to FTP/FTPS.

>file exist behavior
It's protocol independent. The file exist rules are configurable. You can setup SmartFTP to always overwrite the file (not recommended).

#13 unicomplex

unicomplex
  • Members
  • 5 posts

Posted 14 September 2011 - 03:49 PM

>keep filetime
As far as I know FireFTP only supports the FTP protocol but in SmartFTP you are using SFTP. Try to switch to FTP/FTPS.

The latest version of FireFTP supports SFTP, and since the server doesn't provide FTP, FireFTP is my current fallback solution. Which makes me suspicious that there may be a problem with SFTP in SmartFTP (or that for some reason the server doesn't like the client).

>file exist behavior
It's protocol independent. The file exist rules are configurable. You can setup SmartFTP to always overwrite the file (not recommended).

Okay. That's how I handled it with SmartFTP on the old server with conventional FTP. And if I get my server to like SmartFTP (or the other way round) it should work again, and not abort a transfer of an already existing file (well, unless the permissions don't allow the transfer).

#14 mb

mb

    Developer

  • Administrators
  • 11526 posts

Posted 14 September 2011 - 04:38 PM

>sftp
Send a test user/password to our support email address and we will try to reproduce the problem.

#15 unicomplex

unicomplex
  • Members
  • 5 posts

Posted 14 September 2011 - 04:40 PM

>sftp
Send a test user/password to our support email address and we will try to reproduce the problem.


I'll forward that to the server admin. Thanks.