Rsync on V5..0.2 not working and alos on v5.1

214 views
Skip to first unread message

philip....@gmail.com

unread,
Jul 10, 2024, 10:57:28 AM7/10/24
to weewx-user
Ive built a new build on raspi 5 with weewx 5.02 and it all works ok apart from rsync to my local server . 
Ive set up ssh-keygen from the home directory and to the root withh sudo -i

rsync works in a .sh file via crontab

Ive tried the following 

phil@raspberrypi:~ $ rsync -a /etc/weewx/webpages/testcenter/ Lush...@192.168.1.157:/volume1/web/SheringhamWeatherCenter/
phil@raspberrypi:~ $ sudo -i
root@raspberrypi:~# rsync -a /etc/weewx/webpages/testcenter/ Lush...@192.168.1.157:/volume1/web/SheringhamWeatherCenter/
root@raspberrypi:~#
and both work ok

Now with the following in the rsync section of weewx.conf
    [[RSYNC]]
        skin = Rsync
        enable = true
HTML_ROOT = /etc/weewx/webpages/testcenter/
        server = 192.68.1.157
        user = LushEr21
        path = /volume1/web/SheringhamWeatherCenter/

i get the following lines of erroes in the log  

2024-07-10T15:32:32.056993+01:00 raspberrypi weewxd[4788]: ERROR weeutil.rsyncupload: rsync reported errors. Original command: ['rsync', '--archive', '--stats', '-e', 'ssh', '/etc/weewx/webpages/testcenter/', 'Lush...@192.68.1.157:/volume1/web/SheringhamWeatherCenter']
2024-07-10T15:32:32.057086+01:00 raspberrypi weewxd[4788]: ERROR weeutil.rsyncupload: **** ssh: connect to host 192.68.1.157 port 223: Connection timed out
2024-07-10T15:32:32.057115+01:00 raspberrypi weewxd[4788]: ERROR weeutil.rsyncupload: **** rsync: connection unexpectedly closed (0 bytes received so far) [sender]
2024-07-10T15:32:32.057141+01:00 raspberrypi weewxd[4788]: ERROR weeutil.rsyncupload: **** rsync error: unexplained error (code 255) at io.c(231) [sender=3.2.7]

The ssh port  223  is correct.

Sending to my host from the home and the root is OK just wondered what else I need to set up for weewx to work ok.

Thanks any help
P





 

Glenn McKechnie

unread,
Jul 10, 2024, 7:31:33 PM7/10/24
to weewx...@googlegroups.com


typo...

vs
server = 192.68.1.157

On Thu, 11 Jul 2024 at 00:57, philip....@gmail.com <philip....@gmail.com> wrote:
[...]

phil@raspberrypi:~ $ rsync -a /etc/weewx/webpages/testcenter/ Lush...@192.168.1.157:/volume1/web/SheringhamWeatherCenter/


Now with the following in the rsync section of weewx.conf
    [[RSYNC]]
        skin = Rsync
        enable = true
HTML_ROOT = /etc/weewx/webpages/testcenter/
        server = 192.68.1.157
        user = LushEr21
        path = /volume1/web/SheringhamWeatherCenter/

i get the following lines of erroes in the log  

2024-07-10T15:32:32.056993+01:00 raspberrypi weewxd[4788]: ERROR weeutil.rsyncupload: rsync reported errors. Original command: ['rsync', '--archive', '--stats', '-e', 'ssh', '/etc/weewx/webpages/testcenter/', 'Lush...@192.68.1.157:/volume1/web/SheringhamWeatherCenter']



Cheers
 Glenn

Various WeeWx addons at
https://github.com/glennmckechnie

Tom Keffer

unread,
Jul 10, 2024, 7:44:42 PM7/10/24
to weewx...@googlegroups.com
You didn't show enough of the log for a definitive answer, but most likely the user under which weewxd is running does not have the proper credentials. 

You tested as user "phil". Is this the user weewxd is running as? Or, is it running as weewx (the default for V5.x), root, LushEr21, or something else?

See the wiki rsync troubleshooting.

--
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/1e00dc38-38c2-4f94-8707-64a5930fac90n%40googlegroups.com.

philip....@gmail.com

unread,
Jul 11, 2024, 6:17:53 AM7/11/24
to weewx-user
Thanks Tom
Ive confused myself so any help is appreciated.
I loaded weewx via Debian on a new build if thats any help while logged on as phil@raspberrypi 
with groups at the prompt phil and weewx are both there.
txt file has 2 cycles in
rsync.txt

Glenn McKechnie

unread,
Jul 11, 2024, 6:58:45 AM7/11/24
to weewx-user
I'll try yet again. The SPAM folder must be working overtime?

It looks very much like a typo. 
In your command line it's 192.168. 
In weewx.conf you have 192.68

LushEr...(at)192.168.1.157
vs
server = 192.68.1.157

philip....@gmail.com

unread,
Jul 11, 2024, 8:44:08 AM7/11/24
to weewx-user
Thanks Glenn and well spotted. 
But still fails.
It now has an extra line in the logs  " Host key verification failed"
Now the ssh keys have been added to my normal logon phil@raspberrypi, which is where weewx was loaded from, and from the prompt  rsync -a /etc/weewx/webpages/testcenter/ Lush...@192.168.1.157:/volume1/web/SheringhamWeatherCenter works ok without password

Have with sudo -i also added the ssh keygen at root@raspberrypi and rsync also works
in groups weewx and phil are both there so where do I load the ssh  keygen ????
weewx was restarted when I changed the weewx.conf file.

Tom Keffer

unread,
Jul 11, 2024, 9:32:28 AM7/11/24
to weewx...@googlegroups.com
From your log, you have two instances of weewxd running, one labeled 'weewxd', the other 'weewxd-sunhours'. Both are running as user 'weewx'.

So, the credentials should be put in ~weewx/.ssh. They should contain credentials for user LushEr21 on host 192.168.1.157.


philip....@gmail.com

unread,
Jul 12, 2024, 7:20:50 AM7/12/24
to weewx-user
Hi Tom
Im in /etc/weewx     Weewx Home directory
With ssh-keygen is entered it comes up with a file to save it in I put in /etc/weewx/.ssh/id_rsa
With nothing entered for either catchphase I then use ssh-copy-id with my server info
It then asks for the servers password which its happy with.
If I then enter ssh Lush...@192.168.1.157 it opens up in the server which is what I expect
Using rsync -a from cd /etc/weewx it works OK
I do have a raspi with weewx 4.10.2 which is working perfectly.
What am I doing wrong ??


Tom Keffer

unread,
Jul 12, 2024, 10:19:44 AM7/12/24
to weewx...@googlegroups.com
1. When you say "If I then enter ssh Lush...@192.168.1.157 it opens up..." What user were you running as? Was it the same as the user weewxd is running as?

2. You can determine the user weewxd is running as with the command:

systemctl show -p User weewx

3. What is the home directory for that user?




philip....@gmail.com

unread,
Jul 12, 2024, 11:05:04 AM7/12/24
to weewx-user
User=weewx
home directory for weewx is /etc/weewx 

vince

unread,
Jul 12, 2024, 12:09:17 PM7/12/24
to weewx-user
A dpkg installation sets weewx $HOME to /var/lib/weewx unless you've manually changed things....

(from my /etc/passwd in a clean 5.1.0-4 installation)
weewx:x:104:109::/var/lib/weewx:/usr/sbin/nologin

philip....@gmail.com

unread,
Jul 12, 2024, 12:32:05 PM7/12/24
to weewx-user
Vince
I thought weewx $Home directory is where the bin/init.d folders are which is in /etc/weewx
var/lib/weewx only has the database in
Have a got that wrong

vince

unread,
Jul 12, 2024, 12:56:13 PM7/12/24
to weewx-user
Sorry, you do have it wrong.

You need to put the .ssh tree under the $HOME of the user weewx runs as ('weewx' for a dpkg installation) per the /etc/password file definition of its home directory, so it would be /var/lib/weewx

philip....@gmail.com

unread,
Jul 12, 2024, 1:44:05 PM7/12/24
to weewx-user
Welll thank you Vince It worked
I did try and ssh-keygen and changed the file name to /var/lib/weewx/.ssh and it did produce the files but it still didnt work
So I copied and paste from my home/phil/.ssh folder and it worked
So again thank you
Plus I also learnt where the $HOME directory is for user weewx which I most admit still feels odd but perhaps I can read up on.
Phil

vince

unread,
Jul 12, 2024, 2:12:19 PM7/12/24
to weewx-user
It is in an unusual place, yes, but rsync over ssh works like it always does.  You put the .ssh tree for the user under that user's $HOME whatever it is.
Reply all
Reply to author
Forward
0 new messages