Weewx 5.0 FTP and Rsync not even attempting to upload what's going on?

212 views
Skip to first unread message

Kevin Key

unread,
Jun 16, 2024, 3:07:29 AM6/16/24
to weewx-user
I have FTP and Rsync enabled and the servers and credentials specified, but no uploads and no errors in the log. Any suggestions? The local files are created, but there is nothing on the log to indicate any upload attempts. I have debug = 1.

gjr80

unread,
Jun 16, 2024, 4:40:21 AM6/16/24
to weewx-user
The clue will be in the log, sometimes it is what is not in the log rather than an error message that provides the clue. I suggest you leave debug = 1, restart WeeWX and post a log extract showing the full WeeWX startup and at least a couple of report cycles.

Gary
Message has been deleted

vince

unread,
Jun 16, 2024, 9:14:51 PM6/16/24
to weewx-user
[[RSYNC]] # rsync'ing to a webserver is treated as just another report skin = Belchertown HTML_ROOT = /var/www/html/weewx/rsync

Should be skin = Rsync 

(you posted your forecast credentials in your belchertown section of debug.txt so you might want to generate a new key for that..)

On Sunday, June 16, 2024 at 1:36:12 PM UTC-7 Kevin Key wrote:
Here ya go. The only lines that, IMHO, stand out:

Jun 16 13:24:25 linux weewxd[1930780]: DEBUG weewx.reportengine: Running report 'FTP'
Jun 16 13:24:25 linux weewxd[1930780]: DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Belchertown/skin.conf for report 'FTP'
Jun 16 13:24:25 linux weewxd[1930780]: DEBUG weewx.reportengine: Invalid report_timing setting for report 'FTP', running report anyway
Jun 16 13:24:25 linux weewxd[1930780]: DEBUG weewx.reportengine:        ****  Invalid field 'minutes' in 'minutes hours day_of_month months day_of_week'
Jun 16 13:24:25 linux weewxd[1930780]: DEBUG weewx.reportengine: Running generators for report 'FTP' in directory '/etc/weewx/skins/Belchertown'

Kevin Key

unread,
Jun 16, 2024, 9:35:30 PM6/16/24
to weewx-user
Thanks.

Kevin Key

unread,
Jun 16, 2024, 10:29:56 PM6/16/24
to weewx-user
Thanks Vince. I'm getting closer. For some reason, the connection via weewx gets rejected but not when I do so via the command line:


Jun 16 15:27:54 linux weewxd[2084707]: DEBUG weeutil.rsyncupload: rsyncupload: cmd: [['rsync', '--archive', '--stats', '-e', 'ssh', '/var/www/html/weewx/belchertown/', 'kevi...@192.254.224.66:/home2/kevinphy/kevinkeyphotography.com']]
Jun 16 15:27:54 linux weewxd[2084707]: ERROR weeutil.rsyncupload: rsync reported errors. Original command: ['rsync', '--archive', '--stats', '-e', 'ssh', '/var/www/html/weewx/belchertown/', 'kevi...@192.254.224.66:/home2/kevinphy/kevinkeyphotography.com']
Jun 16 15:27:54 linux weewxd[2084707]: ERROR weeutil.rsyncupload: **** Host key verification failed.
Jun 16 15:27:54 linux weewxd[2084707]: ERROR weeutil.rsyncupload: **** rsync: connection unexpectedly closed (0 bytes received so far) [sender]
Jun 16 15:27:54 linux weewxd[2084707]: ERROR weeutil.rsyncupload: **** rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]
^X^C
kevin@linux:/usr/share/weewx/weeutil$

This works fine via command line:

rsync -arP /var/www/html/weewx/  kevi...@192.254.224.66:/home2/kevinphy/kevinkeyphotography.com/weewx

On Sunday, June 16, 2024 at 2:14:51 PM UTC-7 vince wrote:

vince

unread,
Jun 16, 2024, 11:07:36 PM6/16/24
to weewx-user
Host key verification failed......

Remember weewx runs as user 'weewx' and not your typical user (in your case 'kevinphy')....

You need to ssh into the remote host as the user weewx runs as 'once', accept the remote host's system key when prompted, and weewx will be able to rsync over ssh as 'its' user.  It can be a little convoluted to do this typically, so I usually cheat a little....

# temporarily let weewx run a shell
sudo chsh -s /bin/bash weewx

# su to the weewx account
su - weewx
(you will be in a shell as weewx)

# seed its known_hosts file and set permissions correctly
ssh your_remote_host_or_ip
(answer yes for the host key prompt, then ^C to exit)
(and exit your weewx shell)

# (re)set weewx's shell to nologin
sudo chsh -s /usr/sbin/nologin weewx

There is undoubtedly many ways to do it, but this worked for me.

Kevin Key

unread,
Jun 16, 2024, 11:51:53 PM6/16/24
to weewx-user
And now I keep getting this ""Received disconnect from 192.254.224.66 port 2222:2: Too many authentication failures". Do I need to delete everything and start over?

Kevin Key

unread,
Jun 17, 2024, 12:02:57 AM6/17/24
to weewx-user

weewx@linux:~$ ssh we...@192.254.224.66 -p2222
we...@192.254.224.66's password:

Received disconnect from 192.254.224.66 port 2222:2: Too many authentication failures
Disconnected from 192.254.224.66 port 2222
weewx@linux:~$

Kevin Key

unread,
Jun 17, 2024, 12:39:51 AM6/17/24
to weewx-user
All good now. I had to have my web hosting company take care of some issues.

Ben W.

unread,
Jul 5, 2024, 1:48:06 PM7/5/24
to weewx-user
Hello Vince,

For this step...


# su to the weewx account
su - weewx
(you will be in a shell as weewx)

...it is asking for a password. If I can no longer remember it or cannot find it, then I'm toast, correct?

Graham Eddy

unread,
Jul 5, 2024, 2:05:56 PM7/5/24
to WeeWX User
try ' sudo -u weewx -i ‘ to get an interactive shell as weewx
⊣GE⊢

Chris Eidem

unread,
Jul 5, 2024, 2:29:31 PM7/5/24
to weewx...@googlegroups.com

You can change a user's password as root, use 

passwd <weewx user>

and you will be prompted to enter a password.

Ben W.

unread,
Jul 5, 2024, 3:20:39 PM7/5/24
to weewx-user

Thanks - that was able to work for me. The rsync is still failing but at least it's for a new reason now! 

I get this
ERROR weeutil.rsyncupload: **** Permission denied, please try again.

even though I was able to connect via this step:

# seed its known_hosts file and set permissions correctly
ssh your_remote_host_or_ip
(answer yes for the host key prompt, then ^C to exit)
(and exit your weewx shell)


vince

unread,
Jul 5, 2024, 4:52:16 PM7/5/24
to weewx-user
Hard to say but I still think your weewx user's ssh setup vs. your remote system is incorrect.
  • use your normal account and ssh in 'without' a password using a passwordless keypair and see if it works
  • do the same test from the weewx account and see if that also works
If you can ssh in as yourself but 'not' as weewx, that means your weewx .ssh/config setup isn't quite right....

Remember - you need a 'passwordless' keypair for weewx. 

Ben W.

unread,
Jul 6, 2024, 2:32:17 AM7/6/24
to weewx-user


" If you can ssh in as yourself but 'not' as weewx, that means your weewx .ssh/config setup isn't quite right...."

This is exactly what is happening. Should I generate the pub/priv keys again but as the weewx user rather than the main user?

vince

unread,
Jul 6, 2024, 4:39:41 AM7/6/24
to weewx-user
Yes.  You need the 'weewx' user to be able to ssh into the remote system with a passwordless ssh keypair.

Ben W.

unread,
Jul 6, 2024, 12:54:03 PM7/6/24
to weewx-user
YES!

INFO weeutil.rsyncupload: rsync'd 21 files (1,181,568 bytes) in 1.79 seconds


How do I buy you all a coffee? It was the generating the key as the weewx user that I missed (among other things through this journey!)
Reply all
Reply to author
Forward
0 new messages