rsync not working (weewx-Belchertown skin)

327 views
Skip to first unread message

gszla...@gmail.com

unread,
Jan 13, 2022, 10:58:19 AM1/13/22
to weewx-user
WeeWX version 4.5.1 - debian install
MQTT
GW1000 API
also running neowx-material skin
--
rsync works perfectly on the command line but it does not work in weewx.
The web host uses port 2222 for SSH.
I've tried all types of things with ~.ssh/config but whether or not I even use the config file or not, I get the exact same error:

2022-01-12 2:39 P.M.        weewx.service        weewx[19782] ERROR weeutil.rsyncupload: [['rsync', '--archive', '--stats', '-e ssh -p 2222', '/var/www/html/weewx/belchertown/', 'remote_user@mydomainca:public_html/glenns/belchertown']] reported errors: Host key verification failed.. rsync: connection unexpectedly closed (0 bytes received so far) [sender]. rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.3]

I did see Chri's's Jan 2 thread about his port problem for rsync but in my case adding port = 2222 in the RSYNC section appears to work as I see -p 2222 in the error message above.

note: if you add a "/" slash in front of public_html for the target directory on the remote host, rsync does not work on the command line.

note: I don't "git" git - could not see a way to download Tom's patched rsyncupload.py - so i just did a cut and paste of his code with notepad++ and duplicated the permissions. Hopefully it worked..at least I get the same error with the patched file! I have attached a copy of the patched  file..just in case i didn't get the right one. I also have attached a debug=1 file  along with weewx.conf.

Any help with this rsync problem would be greatly appreciated!
weewx.conf
weewx-debug1
rsyncupload.txt

Topslakr Topslakr

unread,
Jan 13, 2022, 12:11:47 PM1/13/22
to weewx-user
Is WeeWx running as the same user as your user? Error looks to me like the weewx user hasn't done the key sharing to allow password-less rsync over ssh.

vince

unread,
Jan 13, 2022, 1:28:32 PM1/13/22
to weewx-user
"Host key verification failed." is the indicator here.

You need to attempt to ssh into the remote computer as the local weewx user (probably root) at least once so that ssh saves the other side's host key.   When it prompts you, say yes.

It should look something like this example:

# ssh testuser@pi
The authenticity of host 'nuc2 (192.168.1.171)' can't be established.
ECDSA key fingerprint is 4e:8a:b5:6a:12:a2:a0:6d:f6:64:07:35:d0:e7:17:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'nuc2,192.168.1.171' (ECDSA) to the list of known hosts.



Lastly,  your log and weewx.conf show a user name of 'remote_user' which I'm hoping is a typo.   If it's what you really want, you will need a user named "remote_user" created on the host you want to rsync to, and they will need to be able to write to whatever directory on the remote side that you specified in weewx.conf or you'll get permission errors.

gszla...@gmail.com

unread,
Jan 14, 2022, 6:17:18 PM1/14/22
to weewx-user
Thanks vince!

I assume that weewx is running as root for a normal apt-get debian type of install.

It looks like when I ssh as root it asks for a password each time. So if weewx-rsync fails each time as root, then would you not have to generate keys as root instead of a  non-root user?

vince

unread,
Jan 14, 2022, 6:27:59 PM1/14/22
to weewx-user
yes - connect in once as whatever user weewx is running as (which is almost always root)

gszla...@gmail.com

unread,
Jan 14, 2022, 7:37:14 PM1/14/22
to weewx-user
Thanks. I believe you are correct.The weewx user is root so weewx rsync  with non-root  user keysis not going to work. Learn something new every day..
Reply all
Reply to author
Forward
0 new messages