log reports file does not exist when it does exist.

Advertisement

Seth
Donor
Joined:
Posts:
11
Location:
New Mexico

log reports file does not exist when it does exist.

I am using WinSCP version 5.17.8 (Build 10803) on a Windows 10 Home machine. I have a nightly routine that runs with scripting and automation and backs up files from my web server. This problem started before my most recent upgrade to the latest version of WINSCP. The problem is that the script stops on a file that it says does not exist, yet the file exists and can be downloaded. Of course this prevents the rest of the script from running. Here is the routine with the password and IP address replaced by XXXXXX:
option batch on
option confirm off
open sftp://root:XXXXXXXXXXXXXXX@XXXXXXXXXX/ -hostkey="ssh-rsa 2048 MH8TG28sDI1uflPERU+d2kiNTy%2B0b/IXHdYa9EkGfww=" 
option transfer binary
#get /home/vltchdmy/www/* c:\Users\Seth\Documents\ServerBackups\Backups\www\*
synchronize local -filemask=|*.cache;*.latest;*index.log.2;*supercache/;IpDweGdIqRq490EE.php c:\Users\Seth\Documents\ServerBackups\Backups /home/vltchdmy
exit
Here is the batch file that runs it:
@echo off
del log.xml
"C:\Program Files (x86)\WinSCP\WinSCP.com" /console /script=ServerBackup.txt /xmllog=log.xml
if %ERRORLEVEL% neq 0 goto error
echo Success
C:\Users\Seth\Downloads\SwithMail\SwithMail.exe /s /Param1 "BackupServer" /Param2 "Succeeded" /x C:\Users\Seth\Documents\ServerBackups\SwithmailLog\SwithMailSettings.xml"
exit /b 0
:error
echo Error!
C:\Users\Seth\Downloads\SwithMail\SwithMail.exe /s /Param1 "BackupServer" /Param2 "FAILED" /x "C:\Users\Seth\Documents\ServerBackups\SwithmailLog\SwithMailSettings.xml"
exit /b 1
Log File attached. Please note that the file that causes the failure is not always the same file.
Seth
  • log.xml (40.77 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: log reports file does not exist when it does exist.

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

Though if the server says that the file does not exist, I'm not sure, if we can do anything about it. Consider contacting the server administrator.

By the "yet the file exists and can be downloaded", do you mean that if you re-run the script, it downloads the file on which it failed previously?

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. 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 can mark the attachment as private.

Reply with quote

Seth
Donor
Joined:
Posts:
11
Location:
New Mexico

Topic Reply Notification - log reports file does not exist when it does exist.

thanks for your thoughts. I really thought I had attached a log file to the original message. I have attached one here again.

To clarify on the subject of the file being found and downloaded, if I use WINSCP GUI version, I can located the file and download it despite the fact that the command line version says it can't be found.
  • logD.xml (224.98 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar

Re: Topic Reply Notification - log reports file does not exist when it does exist.

You did (now and before) attach an XML log (/xmllog). I'm asking for a session log (/log).

So if the script fails, you can locate the file in GUI afterwards. And what, if you rerun the script, can it locate the file then? Please post session log file for all these attempts.

Reply with quote

Seth
Donor
Joined:
Posts:
11
Location:
New Mexico

Re: Topic Reply Notification - log reports file does not exist when it does exist.

Sorry for the delay and for misunderstanding your instructions. I have successfully created a winscp.log file. I have attached it here. It appears that the issue is a failed internet connection. I guess this would make it an internet problem not a winscp problem. Any thoughts?

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Topic Reply Notification - log reports file does not exist when it does exist.

I'm not sure that's related. I do not see any "No such file or directory" error here.

Reply with quote

Guest

Re: Topic Reply Notification - log reports file does not exist when it does exist.

Thanks for your reply. I have the next session's winscp.log which does show the wording "No Such File or Directory." Unfortunately, even when I zip the file it comes out to 16 gig. I have attached a file with just the end of the log showing the failures.

Reply with quote

martin
Site Admin
martin avatar

Re: Topic Reply Notification - log reports file does not exist when it does exist.

We need full log. And I cannot believe a zipped log file has 16 gigabytes. Also, did you contact the server administrator? This is hardly WinSCP issue.

Reply with quote

Seth
Donor
Joined:
Posts:
11
Location:
New Mexico

Re: Topic Reply Notification - log reports file does not exist when it does exist.

Your help is much appreciated. Sorry, you are correct. I meant to say 16 meg. However the forum guidelines say no bigger than 10 meg. Todays log file when compressed is 42 meg. Not sure what to do about that.

I have understood from the beginning that this may not be a problem with how I am using Winscp. I suspect that it is more likely an internet connection problem. I am the server administrator. I should be able to see server logs and find out if there is something there that gives me a clue. I will do that. I was just posting here in case there was something I could do at the Winscp command line that would help resolve the problem. Maybe I shouldn't be asking for help in this forum for this problem. I was just hoping that someone more experienced than I could give me a clue what is really happening.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Topic Reply Notification - log reports file does not exist when it does exist.

You can email the log to my address, which you find in my forum profile.

Reply with quote

Seth
Donor

Re: Topic Reply Notification - log reports file does not exist when it does exist.

Thanks so much. The log file will be coming to your email shortly.

Seth

Reply with quote

Seth
Donor

Re: Topic Reply Notification - log reports file does not exist when it does exist.

I appreciate your help. Did you receive the log file I sent to your email address?
Seth

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: Topic Reply Notification - log reports file does not exist when it does exist.

First the server reports that the file exists:
. 2020-11-08 04:51:31.257 1604787017.M350619P14553.server.vlt.chd.mybluehost.me,S=9726,W=9956:2,;-;9726;2020-11-07T22:10:17.000Z;3;"vltchdmy" [500];"vltchdmy" [502];rw-r-----;0
But then it says that it does not, when WinSCP tries to download the file:
. 2020-11-08 09:19:43.960 File: '/home/vltchdmy/mail/parellifoundation.org/summer/cur/1604787017.M350619P14553.server.vlt.chd.mybluehost.me,S=9726,W=9956:2,' [2020-11-07T22:10:17.000Z] [9726]
. 2020-11-08 09:19:43.960 Copying "/home/vltchdmy/mail/parellifoundation.org/summer/cur/1604787017.M350619P14553.server.vlt.chd.mybluehost.me,S=9726,W=9956:2," to local directory started.
. 2020-11-08 09:19:43.960 Binary transfer mode selected.
. 2020-11-08 09:19:43.961 Opening remote file.
> 2020-11-08 09:19:43.961 Type: SSH_FXP_OPEN, Size: 140, Number: 8132611
< 2020-11-08 09:19:45.546 Type: SSH_FXP_STATUS, Size: 24, Number: 8132356
. 2020-11-08 09:19:45.546 Discarding reserved response
< 2020-11-08 09:19:45.546 Type: SSH_FXP_STATUS, Size: 29, Number: 8132611
< 2020-11-08 09:19:45.546 Status code: 2, Message: 8132611, Server: No such file, Language:
That's all I can tell from WinSCP perspective.
Also, you didn't answer my earlier question: "if you rerun the script, can it locate the file then?", nor you have posted a log file of the re-run. Though it won't probably change anything about the fact, that it's a server-side issue. It just may bring some insight about the server's problem.

Reply with quote

Advertisement

Seth
Donor
Joined:
Posts:
11
Location:
New Mexico

Re: Topic Reply Notification - log reports file does not exist when it does exist.

Thank you for your helpful response. I apologize for my lack of due diligence. I have been slammed recently. I have checked a subsequent day's log for the file name in your text quoted above. This same file showed a similar error in a subsequent log. I have attached a portion of the log. I can send you the complete log to your email address, but believe it or not, uncompressed this log is 1,174,726 KB. The early part of the log does show that the file was found and is new. I appreciate your thoughts on what is probably not a Winscp issue.

Reply with quote

martin
Site Admin
martin avatar

Re: Topic Reply Notification - log reports file does not exist when it does exist.

So you can never download that file? Not even if you try to manually download it from WinSCP GUI? Did you try any other SFTP client?

Reply with quote

Seth
Donor
Joined:
Posts:
11
Location:
New Mexico

Re: Topic Reply Notification - log reports file does not exist when it does exist.

Thanks for the continued help sleuthing out this problem. In my first message in this tread, I indicated that I tried and was successful in downloading a file in WinScp GUI version when the log reported that it did not exist. However, in the case of the file we are now talking about, the file no longer exists when searched for in WinScp GUI version and Filezilla. This may be true because the files in question are email messages. And for reasons I don't fully understand, the server moves some email message files from time to time. If this theory is true (and it may not be) would it be possible that between the time the WinScp script locates the file and flags it for download and the time the script actually attempts to download the file, the file has been moved by the server? The time lag between the two functions in the script could be significant in my case where there are a large number of files to download and my internet connection is slow. So, if this theory is correct, it seems like the WinScp script should simply skip a file it cannot find and move on rather than stopping the script. (then report a list of skipped files to a log.) The problem seems to be that when the script can't find a file, it terminates with a failure, rather than skipping the file and moving on. Please give me your thoughts on this theory.

Reply with quote

Seth
Donor

Re: Topic Reply Notification - log reports file does not exist when it does exist.

I just checked last night's log for a file that the WinScp script log said did not exist. Using WinScp GUI, I found it and was able to download it. I could have more than one problem going on here. In any case, my thought still remains. When the WinScp command line script can't find a file, why does it quit instead of skipping the file and moving on?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: Topic Reply Notification - log reports file does not exist when it does exist.

Seth wrote:

If this theory is true (and it may not be) would it be possible that between the time the WinScp script locates the file and flags it for download and the time the script actually attempts to download the file, the file has been moved by the server? The time lag between the two functions in the script could be significant in my case where there are a large number of files to download and my internet connection is slow. So, if this theory is correct, it seems like the WinScp script should simply skip a file it cannot find and move on rather than stopping the script. (then report a list of skipped files to a log.) The problem seems to be that when the script can't find a file, it terminates with a failure, rather than skipping the file and moving on. Please give me your thoughts on this theory.
Yes, it's possible. If you want WinSCP to skip the errors use:
option batch continue
See https://winscp.net/eng/docs/scriptcommand_option#batch

Reply with quote

Advertisement

You can post new topics in this forum