Re: [weewx-user] Weewx SFTP upload error

67 views
Skip to first unread message

Tom Keffer

unread,
Jan 10, 2023, 9:51:37 AM1/10/23
to weewx...@googlegroups.com
This has been happening a lot recently. I wonder if some ftp server out there has changed its default settings?

Do you happen to know the type of ftp server your host is using?

On Tue, Jan 10, 2023 at 6:28 AM Invisible Man <axelle....@gmail.com> wrote:
I have recently enabled SFTP uploading on weewx pages to a remote server.
By hand, sftp works and I can connect to the remote server correctly.
But weewx complains with the following errors:

```
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine: ftpgenerator: (4): caught exception '<class 'socket.timeout'>': timed out
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 437, in run
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****      n = ftp_data.run()
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 175, in run
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****      ftp_server.connect(self.server, self.port)
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.7/ftplib.py", line 152, in connect
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****      source_address=self.source_address)
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.7/socket.py", line 727, in create_connection
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****      raise err
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****    File "/usr/lib/python3.7/socket.py", line 716, in create_connection
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****      sock.connect(sa)
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine:         ****  socket.timeout: timed out
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] ERROR weewx.reportengine: ftpgenerator: Upload failed
Jan 10 13:53:00 vegan python3[2160]: weewx[2160] DEBUG weewx.reportengine: Running report 'RSYNC'
```

- I am using Weewx 4.9.1 on a RPi
- I have Python 3.7.3
- With FTP I have no errors

This is my weewx config:

```
   [[FTP]]
        skin = Ftp
        enable = True
       
        # FTP'ing the results to a webserver is treated as just another report,
        # albeit one with an unusual report generator!
        #
        # If you wish to use FTP, uncomment and fill out the next four lines:
        user = ***********
        password = **************
        server = *************
        path = /
       
        # If you wish to upload files from something other than what HTML_ROOT
        # is set to above, then reset it here:
        HTML_ROOT = external_html
       
        # Most FTP servers use port 21, but if yours is different, you can
        # change it here
        port = 21
       
        # Set to 1 to use passive mode, zero for active mode:
        passive = 1
       
        # How many times to try to transfer a file before giving up:
        max_tries = 5
       
        # Set to True for a secure FTP (SFTP) connection. Not all servers
        # support this.
        secure_ftp = True
```

--
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/a08e7499-0f48-41fc-9ac7-23afd676be9en%40googlegroups.com.

Invisible Man

unread,
Jan 10, 2023, 10:21:03 AM1/10/23
to weewx-user
> This has been happening a lot recently. I wonder if some ftp server out there has changed its default settings?
> Do you happen to know the type of ftp server your host is using?

This precise error was a stupid config error of mine: I was saying SFTP on port 21 in the config, but SFTP is on port 22...
I updated the error log in the next post, because with port 22, it's still not going through till the end.

I am using SFTP which comes by default with OpenSSH on a Debian server.

Thx
Reply all
Reply to author
Forward
0 new messages