FTP Upload error (permission error)

75 views
Skip to first unread message

Marco P. Ferrara

unread,
Oct 1, 2024, 8:41:37 AM10/1/24
to weewx-user
Hi there,
I have a Raspberry Pi (named pi-radar) with weewx 5.1.0 with python3 that receives data though Interceptor on a ecowitt protocol, generates pages with the Belchertown skin and then should FTP to an external server.

I have the following error that drops out:

Oct 01 14:26:02 pi-radar weewxd[39953]: INFO weewx.reportengine: Copied 3 files to /var/www/html/weewx
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'PermissionError'>': [Errno 13] Permission denied: '/var/www/html/weewx/#FTP.last'
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 519, in run
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****      n = ftp_data.run()
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****          ^^^^^^^^^^^^^^
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 226, in run
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****      self.save_last_upload(timestamp, fileset, hashdict)
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 258, in save_last_upload
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****      with open(timestamp_file_path, "wb") as f:
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 01 14:26:08 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****  PermissionError: [Errno 13] Permission denied: '/var/www/html/weewx/#FTP.last'
Oct 01 14:26:13 pi-radar weewxd[39953]: ERROR weewx.reportengine: ftpgenerator: (1): caught exception '<class 'PermissionError'>': [Errno 13] Permission denied: '/var/www/html/weewx/#FTP.last'
Oct 01 14:26:13 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Oct 01 14:26:13 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 519, in run
Oct 01 14:26:13 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****      n = ftp_data.run()
Oct 01 14:26:13 pi-radar weewxd[39953]: ERROR weewx.reportengine:         ****          ^^^^^^^^^^^^^^

When I run the reports manually they get uploaded correctly. Any idea what could generate the issue?

Thanks!
--
MPF

Tom Keffer

unread,
Oct 1, 2024, 8:46:04 AM10/1/24
to weewx...@googlegroups.com
I would guess that, for some reason, the file /var/www/html/weewx/#FTP.last was protected. Perhaps weewx was run as root, but now you're running it as a non-root user? 

Try deleting it:

sudo rm /var/www/html/#FTP.last

It's used only to optimize the FTP transfer. It will be regenerated at the next reporting cycle.

-tk

--
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/a133f7c6-416f-4c0c-a77b-c8f55b3ab6c3n%40googlegroups.com.

Marco P. Ferrara

unread,
Oct 1, 2024, 8:46:11 AM10/1/24
to weewx-user
And to clarify, the reports gets generated correctly, it is the FTP that fails.

Marco P. Ferrara

unread,
Oct 6, 2024, 3:08:17 PM10/6/24
to weewx-user
Yup, that solved the issue, thank you.
Reply all
Reply to author
Forward
0 new messages