FTP-TLS File transfer fails

169 views
Skip to first unread message

Karl Napp

unread,
Aug 23, 2023, 12:01:27 PM8/23/23
to weewx-user
HI,
I've enabled the FTP over TLS as described in the user's guide. When the FTP Upload starts  weewx returns with ERRORS
 Here is a snippet  syslog output:

Aug 23 16:50:44 berryzero weewx[2267] ERROR weeutil.ftpupload: Failed uploading /var/www/html/weewx/monthvolt.png to server ossipage.de. Reason: '425 Unable to build data connection: Operation not permitted'
Aug 23 16:50:44 berryzero weewx[2267] ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'ftplib.error_temp'>': 425 Unable to build data connection: Operation not permitted
...

on the remote server only the file monthsvolt.png is written with a size of 0 Bytes. 
I'm using Python 3.9.2
Copying files manually to the remote server with FTP over TLS works.
Something missing in the setting ?


Tom Keffer

unread,
Aug 23, 2023, 3:01:59 PM8/23/23
to weewx...@googlegroups.com
Do you know which FTP server this is?

What version of Python are you using?

Set debug=2, then try again. It will give additional information.

-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/3c4c658e-4ac2-4b8b-b923-bc4137e32c14n%40googlegroups.com.

Karl Napp

unread,
Aug 24, 2023, 3:18:14 AM8/24/23
to weewx-user
I don't know the FTP server, it's provided by DomainFactory.
I using Python 3.9.2
I have set debug = 2 in weewx.conf here is the ouput of syslog:

Aug 24 07:56:14 berryzero weewx[14238] DEBUG weewx.reportengine: Running report 'FTP'
Aug 24 07:56:14 berryzero weewx[14238] DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report 'FTP'
Aug 24 07:56:14 berryzero weewx[14238] DEBUG weewx.reportengine: Cannot read localization file /etc/weewx/skins/Ftp/lang/en.conf for report 'FTP': Config file not found: "/etc/weewx/skins/Ftp/lang/en.conf".
Aug 24 07:56:14 berryzero weewx[14238] DEBUG weewx.reportengine: **** Using defaults instead.
Aug 24 07:56:14 berryzero weewx[14238] DEBUG weeutil.ftpupload: Attempting secure connection to ossipage.de
Aug 24 07:56:14 berryzero weewx[14238] DEBUG weeutil.ftpupload: Secure data connection to ossipage.de
Aug 24 07:56:15 berryzero weewx[14238] DEBUG weeutil.ftpupload: 0 ./monthvolt.png d0881dfeb05b7be0f05f66b3d36f7baff02679c2b081990e738339851bc51bb6
Aug 24 07:56:15 berryzero weewx[14238] ERROR weeutil.ftpupload: Failed uploading /var/www/html/weewx/monthvolt.png to server ossipage.de. Reason: '425 Unable to build data connection: Operation not permitted'
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'ftplib.error_temp'>': 425 Unable to build data connection: Operation not permitted
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 437, in run
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****      n = ftp_data.run()
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 220, in run
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****      ftp_server.storbinary(stor_cmd, fd)
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/ftplib.py", line 502, in storbinary
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****      return self.voidresp()
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/ftplib.py", line 257, in voidresp
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****      resp = self.getresp()
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/ftplib.py", line 250, in getresp
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****      raise error_temp(resp)
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine:         ****  ftplib.error_temp: 425 Unable to build data connection: Operation not permitted
Aug 24 07:56:15 berryzero weewx[14238] DEBUG weeutil.ftpupload: Attempting secure connection to ossipage.de
Aug 24 07:56:15 berryzero weewx[14238] DEBUG weeutil.ftpupload: Secure data connection to ossipage.de
Aug 24 07:56:15 berryzero weewx[14238] DEBUG weeutil.ftpupload: 0 ./monthvolt.png d0881dfeb05b7be0f05f66b3d36f7baff02679c2b081990e738339851bc51bb6
Aug 24 07:56:15 berryzero weewx[14238] ERROR weeutil.ftpupload: Failed uploading /var/www/html/weewx/monthvolt.png to server ossipage.de. Reason: '425 Unable to build data connection: Operation not permitted'
Aug 24 07:56:15 berryzero weewx[14238] ERROR weewx.reportengine: ftpgenerator: (1): caught exception '<class 'ftplib.error_temp'>': 425 Unable to build data connection: Operation not permitted

Tom Keffer

unread,
Aug 24, 2023, 5:56:58 PM8/24/23
to weewx...@googlegroups.com
I'm not sure what is going on. It's likely to be a server configuration issue. One thing you can try is the "reuse_ssl" option.

[[FTP]]
     ... (as before)
    reuse_ssl = True

Karl Napp

unread,
Aug 25, 2023, 10:34:50 AM8/25/23
to weewx-user
Thank's a lot,
with
reuse_ssl = True
it works !

Tom Keffer

unread,
Aug 25, 2023, 7:27:12 PM8/25/23
to weewx...@googlegroups.com
Good to know. I've added your experience to the list of symptoms.

Reply all
Reply to author
Forward
0 new messages