FTP Error 145: Can't open LocalFile for reading

My fathers weather station and coincidentally the PC he had WD on packed up at the end of last year.
Since then he has been relying on a WeatherFlow station which I got him.

However, he misses the website and data history.

Aha, I thought, why not set up WD with WeatherFlow via the API here for him.
I suppose I could have setup a second instance of WD on my Weather PC but instead, i’ve chucked it on another one to test with.
Setting up WD with WeatherFlow was simple.

However, I cannot for the life of me get WD to FTP files to my web hosting.

I constantly get the below error.
Sometimes files do get uploaded but they are all zero bytes.

Any ideas?

I’ve tried resetting the webfiles location, changing permissions on the folders etc.
I’ve also installed FileZilla to doublecheck all is well with the FTP account/details and that works fine.
I’ve made sure all FTP settings (aside from account) are identical to my Weather PC which is working fine.

PASSWORD=****
230 OK. Current restricted directory is /
PBSZ 0
200 PBSZ=0
PROT P
200 Data protection level set to “private”
TYPE I
200 TYPE is now 8-bit binary
CWD Ilfracombe
250 OK. Current directory is /Ilfracombe
ERROR: 145: Can’t open LocalFile for reading. at time/date 21:20:13 22/06/2020
agenda item: doupload
Doing abort procedure/program close…

try reselecting/resetting the webfiles folder in the webfiles/web page setup

Thanks for the reply Brian.
Yes that is one of the first things I tried after reading previous threads here.
It makes no difference.

I’ll keep playing around.

OK so I fired up SysInternals ProcMon (awesome troubleshooting tool) and I noticed PATH NOT FOUND events for ftpupd

It is looking for the files in c:\wdisplayprogram\webfiles ???

I can’t find anywhere where this is set?

The path is certainly right in the webfile/webpage setup in WD.
No mention of c:\wdisplayprogram in the ini or in the registry.

Very odd.

Could you post a screenshot of your Web Files Setup #1 window?
Also, make sure the web files location and the location for clientraw files are correct.

Screenshot attached.

I uninstalled because previously imported the old reg key from the other PC.
Deleted Reg keys and wdisplay folder and then reinstalled and set everything up from scratch.

Same thing happening.
I’m at a loss.

Most files uploaded with 0 bytes, though clientraw doesn’t make it up.

Procmon is not reporting anything odd now, it shows ftpupd reading the files ok.

The ‘other’ FTP log even reports a number of MB uploaded.

I think i’ll give up.
Dad can make do with the Meteotemplate website, at least that update doesn’t require FTP!


Some old threads which have some similarities to your problem…

https://www.weather-watch.com/smf/index.php?topic=15987.0
https://www.weather-watch.com/smf/index.php?topic=27796.0
https://www.weather-watch.com/smf/index.php?topic=68061.0
https://www.weather-watch.com/smf/index.php?topic=24553.0
https://www.weather-watch.com/smf/index.php?topic=19066.0

I don’t know if they contain the fix for your specific issue, but it might be worth reading through and trying some of the things that fixed these problems.

have you tried clicking on set web files folder and then select the correct needed directory?
(c:\wdisplay\webfiles)
and same for the clientraw folder

Thanks Chris and Brian.

Yes I have reviewed the previous threads, the majority of which were solved by setting the webfiles location correctly.
This I have set (multiple times!) as shown in the screenshot. Paths are all correct in INI file. Files are being created OK.

I enabled realtime FTP and watched it connect, do a STOR clientraw and immediately disconnect (though strangely it noted a Timeout error immediately)
clientraw file was not uploaded.

I’ll have another play tomorrow.

try setting to use passive mode if you have not already

Yes passive mode is enabled (fails to authenticate if not)

Not had much chance to look at this today but in summary:

I have two PCs with WD running, ‘A’ for my Weather Station and ‘B’ for my fathers WeatherFlow

‘A’ is working fine
‘B’ experiences the issue where it will upload zero-byte files and then won’t update after that. Get the Can’t open LocalFile error.
Have installed FileZilla on ‘B’ and used the same connection details… can transfer files fine this way.

As a test can you try creating the non-existent directory with a copy of the files in it to check that FTP is working correctly when it finds the files it wants?

The only other thought I had was whether WD is running under a different account than you’re investigating from? One thing that might affect is the HKCU registry hive, e.g. you looked in one hive but WD is seeing a different one?

any chance I can get remote access to the pc with the problem to check on some things etc?

Sure, can set something up.
Do you have anything you like to use like TeamViewer etc. ?

team viewer is good

it looks like the problem is to do with the ftps server (SSL)
one solution is I can set WD to use curl as an option
as that works
(just make sure you have curl for windows downloaded and installed)

FTP is an insecure protocol so it would be good to give everyone the option to use FTPS if their server supports it. Using curl in consolewd on the Pi and the Linux versions would therefore be good. I’m pretty sure the Pi has curl installed by default but even if not it an easy thing to install.

To save you testing Brian, I gave curl a go.
Depending on the syntax I used to force FTPS I get different errors (see attachment).
Strange that FileZilla works with the same credentials.

I’ll contact the hosting company and see if they can shed any light.

Could also try using wireshark to try and sniff out what Filezilla is doing differently.


curl worked here in testing with your ftp settings you sent me
i.e in this format
curl -T ftplogfull.txt–ssl dakota.footholds.net --user **:
I will add option to use curl
ps, what is the url to the web site?

Strange, doesn’t work for me.
Get an Error 405: Method not allowed.
Which I would kind of expect if web servers are adequately locked down.

You were successful on my site?

The website is: Ilfracombe Weather Website - Home

EDIT

If I added the ftp:// then I get a little further
It shows some transfer stats and seems to upload
but then get:
curl: (56) Failure when receiving data from the peer

If I check with FileZilla I don’t see the file there

EDIT 2

If I remove the existing file with FileZilla and then try curl

I get the same curl (56) message and a zero byte file gets created.

SO basically the same as what happens via WD FTP.

Must be an issue my end if it works for you?? (though I can’t see any files that you might have uploaded)