Rsync error after updating to Ubuntu 22.04

1,067 views
Skip to first unread message

Jon B

unread,
Aug 22, 2023, 1:34:09 PM8/22/23
to weewx-user
I recently updated the operating system on which I'm running weewx to Ubuntu 22.04 and now Rsync to my web server is no longer working. I'm pretty sure it's because the version of ssh in Ubuntu 22.04 is newer than the previous version and I've tried various fixes but haven't been able to solve it.

The error in the logs is:

Unable to negotiate with ***.***.**.** port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
ERROR weeutil.rsyncupload: **** rsync: connection unexpectedly closed (0 bytes received so far) [sender]
ERROR weeutil.rsyncupload: **** rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]

From searching online I've tried adding various things to different ssh config files but none has worked. I'm sure it must be a fairly simple solution though - can anyone point me in the right direction?

Thanks!

Invisible Man

unread,
Aug 23, 2023, 2:42:26 AM8/23/23
to weewx-user
Your Rsync works through SSH, and the first line of the logs shows that it expects to be able to log in using a host key, but it can't find your host key.
So, you need to copy the SSH key of the host you are Rsyncing from to the host you are Rsyncing to, in its .ssh/authorized_keys.

I presume that this happened when you changed your OS. The SSH key has obviously changed, and currently in .ssh/authorized_keys you probably have the old key.

Be sure to copy the correct user's key depending on who's running weewx on your system.

Jon B

unread,
Aug 23, 2023, 1:25:24 PM8/23/23
to weewx-user
Thanks for the reply. I've just copied the correct key across to the server, but I'm still getting the same error. When I try to ssh to the server using simply "ssh username@remote-server" I also get that error, and I have to add "-o HostKeyAlgorithms=ssh-dss" to be able to ssh in successfully. Could this be the issue with the Rsync as well? Is there a way to add the same option to the Rsync command?
Message has been deleted

Jon B

unread,
Sep 27, 2023, 3:16:40 PM9/27/23
to weewx-user
I was able to fix this issue by adding "ssh_options = "-av -oHostKeyAlgorithms=+ssh-dss" " to the Rsync section of weewx.conf and the Rsync now works (it's able to make the connection and transfer files), though there is still an error in the logs. This error is:

Sep 27 16:38:25 machine-name weewx[503476] ERROR weeutil.rsyncupload: **** rsync: failed to set times on "/path/to/files/.": Operation not permitted (1)

I'm using the Belchertown skin and the "last updated" banner, the forecast and the graphs on the homepage no longer appear. I can view the graphs on the Graphs page though. Is this related to the above error? The logs also say:

Sep 27 16:38:25 machine-name weewx[503476] ERROR weeutil.rsyncupload: **** rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]

So I guess that it might be. How is the "last updated" banner generated by Belchertown?

The website is here:

vince

unread,
Sep 27, 2023, 5:59:51 PM9/27/23
to weewx-user
See if https://stackoverflow.com/questions/667992/rsync-error-failed-to-set-times-on-foo-bar-operation-not-permitted helps any....

For the graphs thing, look at https://groups.google.com/g/weewx-user/c/yfG1JvCP3Us if you're running an old version of Belchertown.   Current Belchertown has a fix for this one based on the changelog for the skin dated in late April.

Jon B

unread,
Sep 27, 2023, 6:46:24 PM9/27/23
to weewx-user
Thanks, that fixed the graphs. Turns out that the lack of a "Last updated" message was due to me playing around with the message that is displayed when the data hasn't been updated for a while - for some reason trying to customise this caused it to break. I'll try the stack overflow solutions for the Rsync error

Thanks!
Reply all
Reply to author
Forward
0 new messages