ftpupload failing with Errno 0 or no reason at all - with solution

33 views
Skip to first unread message

Alan Jackson

unread,
Jan 26, 2019, 2:11:44 PM1/26/19
to weewx-user
I am posting this for future reference, since I was unable to find the answer with Google, in future
hopefully, this will save someone some time and effort.

The answer is: setting secure_ftp = False in the config file.

Everything is running like clockwork now. Thanks for a wonderful product.

-----------------------------------------------------------------------------------------------
The issue

I just installed weewx on my Ubuntu 16.04 workstation.

$ sudo python
Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
[GCC 5.4.0 20160609] on linux2

Everything works great, except ftp to my website. I have triple checked the user and password, and it still fails with either
Reason: [Errno 0] Error
or
Reason:

neither of which give me much of a clue.

Here is part of the log. I am mystified. (I also tried both weewx and /weewx as the target directory)


Jan 26 12:45:15 carina weewx[11582]: restx: Wunderground-PWS: Published record 2019-01-26 12:45:00 CST (1548528300)
Jan 26 12:45:17 carina weewx[11582]: cheetahgenerator: Generated 14 files for report StandardReport in 2.22 seconds
Jan 26 12:45:26 carina weewx[11582]: imagegenerator: Generated 12 images for StandardReport in 8.49 seconds
Jan 26 12:45:26 carina weewx[11582]: copygenerator: copied 0 files to /var/www/html/weewx
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Attempt #1. Failed uploading weewx/daywind.png to ajackson.org. Reason: [Errno 0] Error
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Attempt #2. Failed uploading weewx/daywind.png to ajackson.org. Reason:
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Attempt #3. Failed uploading weewx/daywind.png to ajackson.org. Reason:
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Failed to upload file weewx/daywind.png
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Attempt #1. Failed uploading weewx/yeartempchill.png to ajackson.org. Reason:
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Attempt #2. Failed uploading weewx/yeartempchill.png to ajackson.org. Reason:
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Attempt #3. Failed uploading weewx/yeartempchill.png to ajackson.org. Reason:
Jan 26 12:45:27 carina weewx[11582]: ftpupload: Failed to upload file weewx/yeartempchill.png
......
Jan 26 12:55:29 carina weewx[11582]: ftpupload: Got error while attempting to make remote directory /weewx/smartphone
Jan 26 12:55:29 carina weewx[11582]:      ****  Error:
Jan 26 12:55:29 carina weewx[11582]: ftpupload: Got error while attempting to make remote directory /weewx/smartphone
Jan 26 12:55:29 carina weewx[11582]:      ****  Error:
Jan 26 12:55:29 carina weewx[11582]: ftpupload: Got error while attempting to make remote directory /weewx/smartphone
Jan 26 12:55:29 carina weewx[11582]:      ****  Error:
Jan 26 12:55:29 carina weewx[11582]: ftpupload: Unable to create remote directory /weewx/smartphone
Jan 26 12:55:29 carina weewx[11582]: ftpgenerator: Caught exception <type 'exceptions.IOError'>: Unable to create remote directory /weewx/smartphone
Jan 26 12:55:29 carina weewx[11582]:         ****  Traceback (most recent call last):
Jan 26 12:55:29 carina weewx[11582]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 325, in run
Jan 26 12:55:29 carina weewx[11582]:         ****      n = ftp_data.run()
Jan 26 12:55:29 carina weewx[11582]:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 137, in run
Jan 26 12:55:29 carina weewx[11582]:         ****      self._make_remote_dir(ftp_server, remote_dir_path)
Jan 26 12:55:29 carina weewx[11582]:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 240, in _make_remote_dir
Jan 26 12:55:29 carina weewx[11582]:         ****      raise IOError, "Unable to create remote directory %s" % remote_dir_path
Jan 26 12:55:29 carina weewx[11582]:         ****  IOError: Unable to create remote directory /weewx/smartphone

HoracioDos

unread,
May 15, 2019, 11:01:39 PM5/15/19
to weewx-user
Hello Alan
I had the same problem today and I found a solution here.
you have to config the following keywords in [[FTP]]
        secure_ftp = True
        secure_data = False
Reply all
Reply to author
Forward
0 new messages