FTP not working since last system update

83 views
Skip to first unread message

James Muirhead

unread,
Nov 8, 2019, 6:41:25 PM11/8/19
to weewx-user
WeeWX FTP upload has suddenly stopped working since the latest system update (I have it setup to run apt-get update; apt-get upgrade at 4am every Sunday). Everything else works fine, just no FTP upload. I hadn't changed the settings, everything was working fine before Sunday morning.
  • Orange Pi PC
  • 1GB RAM
  • 1.3GHz Quad Core
  • Armbian
  • FTP
  • Lighttpd
  • MQTT
  • WoW
  • Wunderground
Nov  8 18:50:23 localhost weewx[807]: reportengine: Caught unrecoverable exception in generator 'weewx.reportengine.FtpGenerator'
Nov  8 18:50:23 localhost weewx[807]:         ****  insecure string pickle
Nov  8 18:50:23 localhost weewx[807]:         ****  Traceback (most recent call last):
Nov  8 18:50:23 localhost weewx[807]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 204, in run
Nov  8 18:50:23 localhost weewx[807]:         ****      obj.start()
Nov  8 18:50:23 localhost weewx[807]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 300, in start
Nov  8 18:50:23 localhost weewx[807]:         ****      self.run()
Nov  8 18:50:23 localhost weewx[807]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 347, in run
Nov  8 18:50:23 localhost weewx[807]:         ****      n = ftp_data.run()
Nov  8 18:50:23 localhost weewx[807]:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 89, in run
Nov  8 18:50:23 localhost weewx[807]:         ****      (timestamp, fileset) = self.getLastUpload()
Nov  8 18:50:23 localhost weewx[807]:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 198, in getLastUpload
Nov  8 18:50:23 localhost weewx[807]:         ****      fileset   = cPickle.load(f)
Nov  8 18:50:23 localhost weewx[807]:         ****  ValueError: insecure string pickle
Nov  8 18:50:23 localhost weewx[807]:         ****  Generator terminated

I've been wondering if the update removed a dependency. I installed FTP, but didn't fix the issue!

Anyone got any bright ideas on this one?


gjr80

unread,
Nov 8, 2019, 6:54:02 PM11/8/19
to weewx-user
Hi,

Unlikely to be an unmet dependency, you would likely see python screaming loudly if it was. Try finding and deleting the file FTP.last, should be sitting in your HTML_ROOT, most likely /var/www/html/weewx. Once deleted check the log to see what happens on the next report cycle.

Gary

Thomas Keffer

unread,
Nov 8, 2019, 6:55:34 PM11/8/19
to weewx-user
WeeWX stores the time each file was FTPd to your server in a file called #FTP.last. This is in order to avoid unnecessary uploads. Somehow the file got corrupted. 

The fix is easy enough: delete the file. It will be regenerated at the next reporting cycle. You can find it in your HTML directory (probably in /var/www/html/weewx, or thereabouts)

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/4f5b1cfe-e4a7-4296-bddc-eb4843fd9f9a%40googlegroups.com.

James Muirhead

unread,
Nov 9, 2019, 12:48:53 PM11/9/19
to weewx-user
Thanks for that, the #FTP.last file had got horrifically corrupted. In fact it thought the local copy was a directory!!!

It also brought to light that I made a typo in the script I use to stop WeeWX, backup, update and reboot the Pi. Meant the data files doubled in size every Sunday morning. Sorted now. Also has dramatically reduced the size of the buffer.

Tom Mitchell

unread,
Nov 11, 2019, 5:16:48 AM11/11/19
to weewx-user
I just have to say how much I like this design approach. Not too clever, plan for failure. If the file is not there or is corrupt, blow it away and recreate it since it is a cache. Just love this. It is a part of how mature and fault-tolerant weewx is.

Thanks to all who work on this!
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages