problem with ftp upload ("class 'ftplib.error_perm")

67 views
Skip to first unread message

sc.lep...@gmail.com

unread,
Aug 16, 2024, 6:53:51 PM8/16/24
to weewx-user

I ve updated to  last Wewx version 

 When I want to use ftp  skin : 

ERROR weeutil.ftpupload: Failed uploading /var/www/html/weewx/BRESSER/belchertown/index.html to server ftp.XXXXX.odns.fr. Reason: '553 Can't open that file: No such file or directory'
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'ftplib.error_perm'>': 553 Can't open that file: No such file or directory
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 519, in run
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      n = ftp_data.run()
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 208, in run
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      ftp_server.storbinary(stor_cmd, fd)
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 498, in storbinary
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      with self.transfercmd(cmd, rest) as conn:
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 393, in transfercmd
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      return self.ntransfercmd(cmd, rest)[0]
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 793, in ntransfercmd
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      conn, size = super().ntransfercmd(cmd, rest)
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 359, in ntransfercmd
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      resp = self.sendcmd(cmd)
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 281, in sendcmd
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      return self.getresp()
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 254, in getresp
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****      raise error_perm(resp)
Aug 17 00:50:31 meteo-Ubuntu weewx-BRESSER[110516]: ERROR weewx.reportengine:         ****  ftplib.error_perm: 553 Can't open that file: No such file or directory


I m tryingh  whith filezilla my ftp parameters ... 
It s ok  :)  

Can someone help me ?

Tom Keffer

unread,
Aug 16, 2024, 8:05:08 PM8/16/24
to weewx...@googlegroups.com
You are not showing very much of the log. In particular, we cannot see which file is causing the problem. 

Some suggestions:
  1. Make sure that whatever file you are having problems with actually exists.
  2. Make sure you have write permissions on the server for the value of "path" that you specified in the [[FTP]] section
  3. Run with debug=2 in weewx.conf. This will give you extra debug information, although I doubt it will help much. Post the results. 
  4. If all else fails, please post the [[FTP]] section of weewx.conf, after obfuscating your password.



--
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/9a78301d-ac4a-489b-bcc4-efd4cd3f1c71n%40googlegroups.com.

sc.lep...@gmail.com

unread,
Aug 17, 2024, 4:12:28 AM8/17/24
to weewx-user
Hi 

This log withe debug=2

Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weewx.reportengine: Running report 'FTP'
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Ftp/skin.conf for report 'FTP'
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weewx.reportengine: Running generators for report 'FTP' in directory '/etc/weewx/skins/Ftp' with locale 'fr_FR.UTF-8'
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weeutil.ftpupload: Attempting secure connection to ftp.XXXXXXXX.odns.fr
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weeutil.ftpupload: Secure data connection to ftp.XXXXXXXX.odns.fr
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weeutil.ftpupload: 0 ./json/weewx.json 1aae81699bc1155768b9a4a4c6e52a79f09f5465cabd46c229bac2311eaa4890
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weeutil.ftpupload: Failed uploading /var/www/html/weewx/BRESSER/json/weewx.json to server ftp.XXXXXXXX.odns.fr. Reason: '553 Can't open that file: No such file or directory'
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'ftplib.error_perm'>': 553 Can't open that file: No such file or directory
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 519, in run
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      n = ftp_data.run()
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 208, in run
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      ftp_server.storbinary(stor_cmd, fd)
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 498, in storbinary
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      with self.transfercmd(cmd, rest) as conn:
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 393, in transfercmd
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      return self.ntransfercmd(cmd, rest)[0]
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 793, in ntransfercmd
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      conn, size = super().ntransfercmd(cmd, rest)
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 359, in ntransfercmd
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      resp = self.sendcmd(cmd)
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 281, in sendcmd
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      return self.getresp()
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.10/ftplib.py", line 254, in getresp
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****      raise error_perm(resp)
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: ERROR weewx.reportengine:         ****  ftplib.error_perm: 553 Can't open that file: No such file or directory
Aug 17 10:05:31 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weeutil.ftpupload: Attempting secure connection to ftp.XXXXXXXX.odns.fr
Aug 17 10:05:32 meteo-Ubuntu weewx-BRESSER[118424]: DEBUG weeutil.ftpupload: Secure data connection to ftp.XXXXXXXX.odns.fr



where XXXXX is my DNS for ftp 
 weewx try 3 times and after stop upload

In this example is the skin JSON  but , i try  to disable this and with belcheretown files its the same  ;-( 


I  give you too   weewx.conf for ftp 


[[FTP]]
        # FTP'ing the results to a webserver is treated as just another report,
        # albeit one with an unusual report generator!
        skin = Ftp

        # If you wish to use FTP, set "enable" to "true", then
        # fill out the next four lines.
        # Use quotes around passwords to guard against parsing errors.
        enable = true
        user = met...@meteo-pontscorff.fr
        password = ZZZZZZZZZZZ
        server = ftp.XXXXXXXXX.odns.fr    # The ftp server name, e.g, www.myserver.org
        path = /data-weewx/BRESSER    # The destination directory, e.g., /weather

        # Set to True for an FTP over TLS (FTPS) connection. Not all servers
        # support this.
        secure_ftp = true

        # To upload files from something other than what HTML_ROOT is set
        # to above, specify a different HTML_ROOT here.
        HTML_ROOT = /var/www/html/weewx/BRESSER

        # Most FTP servers use port 21
        port = 21

        # Set to 1 to use passive mode, zero for active mode
        passive = 1


Tanks a lot  ;)  

Can i Use  another protocol to  upload data  ? Rsync ?  but its not easy to transfer ssh keys

Best regards

Tom Keffer

unread,
Aug 17, 2024, 11:42:26 AM8/17/24
to weewx...@googlegroups.com
And... does the FTP user have write permissions to the directory /data-weewx/BRESSER? Probably not.

Message has been deleted

sc.lep...@gmail.com

unread,
Aug 17, 2024, 5:08:31 PM8/17/24
to weewx-user
Sorry   Tom  ;)  All it s ok now   my account ftp dont match to data-weewx/BRESSER
All is ok  now  ;)  
Thanks a lot 

Reply all
Reply to author
Forward
0 new messages