unable to save to file '/var/www/html/weewx/...

1,240 views
Skip to first unread message

walter Gross

unread,
Feb 9, 2024, 3:02:57 PM2/9/24
to weewx-user
Hi I am Walter from Switzerland.
First a big thank to all workers on weewx. Apologize my bad english.  on 7.2.2024 I saw that my datas are not updated anymore. I guess it was the newest update. The log say that there is no permission to write to html/weewx. Finally I had uninstall weewx and made a fresh installation without succes.. I tried also to give all permissions to the directorie in html/weewx but did not help. Here is a part of syslog.  I have no idea how to solve this permission problems. I hope to get help here. Thanks an regards Walter

Feb  9 19:02:49 hp weewxd[10624]: INFO weewx.engine: 'pyephem' detected, extended almanac data is available
Feb  9 19:02:49 hp weewxd[10624]: DEBUG weewx.engine: Finished loading service weewx.engine.StdReport
Feb  9 19:02:49 hp weewxd[10624]: INFO __main__: Starting up weewx version 5.0.1
Feb  9 19:02:49 hp weewxd[10624]: DEBUG weewx.engine: Station does not support reading the time
Feb  9 19:02:49 hp weewxd[10624]: INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
Feb  9 19:02:49 hp weewxd[10624]: INFO weewx.manager: Starting backfill of daily summaries
Feb  9 19:02:49 hp weewxd[10624]: INFO weewx.manager: Daily summaries up to date
Feb  9 19:02:50 hp weewxd[10624]: DEBUG weewx.drivers.fousb: get 3263 records since 2024-02-09 18:15:00
Feb  9 19:02:50 hp weewxd[10624]: INFO weewx.drivers.fousb: synchronising to the weather station (quality=0)
Feb  9 19:02:51 hp weewxd[10624]: DEBUG weewx.drivers.fousb: status {'rain_overflow': 0, 'lost_connection': 0, 'unknown': 0} (0)
Feb  9 19:03:36 hp weewxd[10624]: DEBUG weewx.drivers.fousb: new data
Feb  9 19:03:36 hp weewxd[10624]: DEBUG weewx.drivers.fousb: setting sensor clock 24.1543
Feb  9 19:03:36 hp weewxd[10624]: DEBUG weewx.drivers.fousb: live synchronised
Feb  9 19:03:36 hp weewxd[10624]: DEBUG weewx.drivers.fousb: packet timestamp is 18:03:36
Feb  9 19:03:36 hp weewxd[10624]: DEBUG weewx.drivers.fousb: estimated log time 17:57:12 +/- 24s (17:56:48..17:57:36)
Feb  9 19:04:21 hp weewxd[10624]: DEBUG weewx.drivers.fousb: avoid 5.829507112503052
Feb  9 19:04:27 hp weewxd[10624]: DEBUG weewx.drivers.fousb: new data
Feb  9 19:04:27 hp weewxd[10624]: DEBUG weewx.drivers.fousb: packet timestamp is 18:04:24
Feb  9 19:04:27 hp weewxd[10624]: DEBUG weewx.drivers.fousb: estimated log time 17:57:06 +/- 18s (17:56:36..17:57:24)
Feb  9 19:05:09 hp weewxd[10624]: DEBUG weewx.drivers.fousb: avoid 5.791247367858887
Feb  9 19:05:15 hp weewxd[10624]: DEBUG weewx.drivers.fousb: new data
Feb  9 19:05:15 hp weewxd[10624]: DEBUG weewx.drivers.fousb: packet timestamp is 18:05:12
Feb  9 19:05:15 hp weewxd[10624]: DEBUG weewx.drivers.fousb: estimated log time 17:57:00 +/- 12s (17:56:24..17:57:12)
Feb  9 19:05:15 hp weewxd[10624]: DEBUG weewx.drivers.fousb: synchronised to 2024-02-09 17:57:00 for ptr 0x02e0
Feb  9 19:05:15 hp weewxd[10624]: DEBUG weewx.drivers.fousb: found 0 archive records
Feb  9 19:05:15 hp weewxd[10624]: INFO weewx.engine: Starting main packet loop.
Feb  9 19:05:15 hp weewxd[10624]: INFO weewx.drivers.fousb: station status {'rain_overflow': 0, 'lost_connection': 0, 'unknown': 0} (0)
Feb  9 19:06:16 hp weewxd[10624]: INFO weewx.manager: Added record 2024-02-09 19:06:00 CET (1707501960) to database 'weewx.sdb'
Feb  9 19:06:16 hp weewxd[10624]: INFO weewx.manager: Added record 2024-02-09 19:06:00 CET (1707501960) to daily summary in 'weewx.sdb'
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.reportengine: Running reports for latest time in the database.
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.reportengine: Running report 'SeasonsReport'
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Seasons/skin.conf for report 'SeasonsReport'
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.reportengine: Running generators for report 'SeasonsReport' in directory '/etc/weewx/skins/Seasons'
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.DisplayOptions', 'weewx.cheetahgenerator.Extras', 'weewx.cheetahgenerator.Gettext', 'weewx.cheetahgenerator.JSONHelpers', 'weewx.cheetahgenerator.PlotInfo', 'weewx.cheetahgenerator.SkinInfo', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo']
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.manager: Daily summary version is 4.0
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.CheetahGenerator'
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****  [Errno 13] Keine Berechtigung: '/var/www/html/weewx/NOAA/NOAA-2023-12.txt.tmp'
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      obj.start()
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      self.run()
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 166, in run
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
Feb  9 19:06:16 hp weewxd[10624]: Traceback (most recent call last):
Feb  9 19:06:16 hp weewxd[10624]:   File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
Feb  9 19:06:16 hp weewxd[10624]:     obj.start()
Feb  9 19:06:16 hp weewxd[10624]:   File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
Feb  9 19:06:16 hp weewxd[10624]:     self.run()
Feb  9 19:06:16 hp weewxd[10624]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 166, in run
Feb  9 19:06:16 hp weewxd[10624]:     ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
Feb  9 19:06:16 hp weewxd[10624]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
Feb  9 19:06:16 hp weewxd[10624]:     ngen += self.generate(section[subsection], subsection, gen_ts)
Feb  9 19:06:16 hp weewxd[10624]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
Feb  9 19:06:16 hp weewxd[10624]:     ngen += self.generate(section[subsection], subsection, gen_ts)
Feb  9 19:06:16 hp weewxd[10624]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 371, in generate
Feb  9 19:06:16 hp weewxd[10624]:     with open(tmpname, mode='wb') as fd:
Feb  9 19:06:16 hp weewxd[10624]: PermissionError: [Errno 13] Keine Berechtigung: '/var/www/html/weewx/NOAA/NOAA-2023-12.txt.tmp'
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 371, in generate
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      with open(tmpname, mode='wb') as fd:
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****  PermissionError: [Errno 13] Keine Berechtigung: '/var/www/html/weewx/NOAA/NOAA-2023-12.txt.tmp'
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****  Generator terminated
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.manager: Daily summary version is 4.0
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.imagegenerator: Unable to save to file '/var/www/html/weewx/daybarometer.png' [Errno 13] Keine Berechtigung: '/var/www/html/weewx/daybarometer.png':
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.imagegenerator: Unable to save to file '/var/www/html/weewx/daytempdew.png' [Errno 13] Keine Berechtigung: '/var/www/html/weewx/daytempdew.png':

matthew wall

unread,
Feb 9, 2024, 3:30:51 PM2/9/24
to weewx-user
On Friday, February 9, 2024 at 3:02:57 PM UTC-5 wagr...@gmail.com wrote:
Feb  9 19:06:16 hp weewxd[10624]: PermissionError: [Errno 13] Keine Berechtigung: '/var/www/html/weewx/NOAA/NOAA-2023-12.txt.tmp'
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 371, in generate
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****      with open(tmpname, mode='wb') as fd:
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****  PermissionError: [Errno 13] Keine Berechtigung: '/var/www/html/weewx/NOAA/NOAA-2023-12.txt.tmp'
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.reportengine:         ****  Generator terminated
Feb  9 19:06:16 hp weewxd[10624]: DEBUG weewx.manager: Daily summary version is 4.0
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.imagegenerator: Unable to save to file '/var/www/html/weewx/daybarometer.png' [Errno 13] Keine Berechtigung: '/var/www/html/weewx/daybarometer.png':
Feb  9 19:06:16 hp weewxd[10624]: ERROR weewx.imagegenerator: Unable to save to file '/var/www/html/weewx/daytempdew.png' [Errno 13] Keine Berechtigung: '/var/www/html/weewx/daytempdew.png':

apparently whatever user is running weewx does not have permission to create/modify files in the HTML_ROOT area.

you can verify like this:

# find out who is running weewxd
ps aux|grep weewxd
# see what existing permissions are on HTML_ROOT
ls -la /var/www/html/weewx

assuming that the user `weewx` is running the process `weewxd`, you can fix it like this:

sudo find /var/www/html/weewx -type d -exec chmod 2775 {} \; 
sudo find /var/www/html/weewx -type t -exec chmod 644 {} \;

please see the wiki article "Understanding permissions"

https://github.com/weewx/weewx/wiki/Understanding-permissions

matthew wall

unread,
Feb 9, 2024, 3:38:04 PM2/9/24
to weewx-user
here is the sure-fire way to fix it (assuming that the user 'weewx' and group 'weewx' exist):

sudo find /var/www/html/weewx -type d -exec chmod 2775 {} \; 
sudo find /var/www/html/weewx -type t -exec chmod 644 {} \;
sudo chown -R weewx /var/www/html/weewx
sudo chgrp -R weewx /var/www/html/weewx

my apologies for double-posting.

matthew wall

unread,
Feb 9, 2024, 3:58:26 PM2/9/24
to weewx-user
my apologies again - brain and fingers are somewhat disconnected today.  the '-type t' should be '-type f' in my previous postings.

the correct (and complete) instructions for how to fix permissions can be found in the wiki page:


walter Gross

unread,
Feb 10, 2024, 6:14:22 AM2/10/24
to weewx-user
Hi Matthew

Thanks for your quick reply and given solution.
 User and group weewx exist.
ps aux|grep weewxd say : weewx      818  2.1  0.8  60016 31592 ?        Ssl  11:30   0:18 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
ls -la /var/www/html/weewx say:
insgesamt 316
drwxrwsr-x  4 weewx    weewx      4096  9. Feb 16:44 .
drwxr-x--- 23 www-data www-data   4096  7. Apr 2023  ..
-rw-rw-r--  1 weewx    weewx    184317  7. Feb 17:30 cam.jpg
-rw-rw-r--  1 weewx    weewx     11268  7. Feb 17:30 celestial.html
-rw-rw-r--  1 weewx    weewx      1150  7. Feb 17:10 favicon.ico
drwxrwsr-x  2 weewx    weewx      4096  7. Apr 2023  font
-rw-rw-r--  1 weewx    weewx     30760  7. Feb 17:30 index.html
drwxrwsr-x  2 weewx    weewx      4096  7. Feb 17:30 NOAA
-rw-rw-r--  1 weewx    weewx      9239  7. Feb 17:30 rss.xml
-rw-rw-r--  1 weewx    weewx      5406  7. Feb 17:10 seasons.css
-rw-rw-r--  1 weewx    weewx      6404  7. Feb 17:10 seasons.js
-rw-rw-r--  1 weewx    weewx     23932  7. Feb 17:30 statistics.html
-rw-rw-r--  1 weewx    weewx      7124  7. Feb 17:30 tabular.html
-rw-rw-r--  1 weewx    weewx      9474  7. Feb 17:30 telemetry.html

The user and group www-data is my joomla homepage in /var/www/html

 I tried to fix it according your instruction and wiki. Unfortunately, the problem still exists. A part of syslog say:
Feb 10 11:46:16 hp weewxd[818]: ERROR weewx.imagegenerator: Unable to save to file '/var/www/html/weewx/yearrx.png' [Errno 13] Keine Berechtigung: '/var/www/html/weewx/yearrx.png':
Feb 10 11:49:17 hp weewxd[818]: INFO weewx.imagegenerator: Generated 0 images for report SeasonsReport in 3.98 seconds
Feb 10 11:49:17 hp weewxd[818]: INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx

I think I will do again a fresh installation

Regards
Walter

Ton Karsten

unread,
Feb 10, 2024, 10:12:33 AM2/10/24
to weewx...@googlegroups.com
I have the same problem.
Tried all solutions above but no success.
The guidelines in the wiki: https://github.com/weewx/weewx/wiki/Understanding-permissions#how-to-fix-permissions also do not provide a solution.
Here are my log files.

# find out who is running weewxd
ps aux|grep weewxd
weewx       4502  0.6  4.3 192624 37908 ?        Ssl  14:49   0:04 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
ton         4527  0.0  0.2   6120  2048 pts/0    S+   15:02   0:00 grep --color=auto weewxd

 # see what existing permissions are on HTML_ROOT
ls -la /var/www/html/weewx
totaal 644
drwxrwsr-x  5 weewx weewx  4096 10 feb 14:40 .
drwxr-xr-x  3 root  root   4096  9 feb 14:31 ..
drwxrwsr-x 11 weewx weewx  4096 10 feb 14:40 belchertown
-rw-r--r--  1 weewx weewx  5516 10 feb 14:40 celestial.html
-rw-r--r--  1 weewx weewx  6427 10 feb 14:40 daybarometer.png
-rw-r--r--  1 weewx weewx  7501 10 feb 14:40 dayET.png
-rw-r--r--  1 weewx weewx  6807 10 feb 14:40 dayhumin.png
-rw-r--r--  1 weewx weewx  6809 10 feb 14:40 dayhum.png
-rw-r--r--  1 weewx weewx  7142 10 feb 14:40 dayradiation.png
-rw-r--r--  1 weewx weewx  6427 10 feb 14:40 dayrain.png
-rw-r--r--  1 weewx weewx  8393 10 feb 14:40 dayrx.png
-rw-r--r--  1 weewx weewx  8592 10 feb 14:40 daytempdew.png
-rw-r--r--  1 weewx weewx  7752 10 feb 14:40 daytempfeel.png
-rw-r--r--  1 weewx weewx  6497 10 feb 14:40 daytempin.png
-rw-r--r--  1 weewx weewx  5361 10 feb 14:40 dayUV.png
-rw-r--r--  1 weewx weewx 17964 10 feb 14:40 dayvolt.png
-rw-r--r--  1 weewx weewx  7015 10 feb 14:40 daywinddir.png
-rw-r--r--  1 weewx weewx  8025 10 feb 14:40 daywind.png
-rw-r--r--  1 weewx weewx  9173 10 feb 14:40 daywindvec.png
-rw-r--r--  1 weewx weewx  1150  9 feb 19:15 favicon.ico
drwxrwsr-x  2 weewx weewx  4096  9 feb 14:20 font
-rw-r--r--  1 weewx weewx 26091 10 feb 14:40 index.html
-rw-r--r--  1 weewx weewx  7079 10 feb 12:00 monthbarometer.png
-rw-r--r--  1 weewx weewx  7640 10 feb 12:00 monthET.png
-rw-r--r--  1 weewx weewx  6304 10 feb 12:00 monthhumin.png
-rw-r--r--  1 weewx weewx  6208 10 feb 12:00 monthhum.png
-rw-r--r--  1 weewx weewx  6360 10 feb 12:00 monthradiation.png
-rw-r--r--  1 weewx weewx  6643 10 feb 12:00 monthrain.png
-rw-r--r--  1 weewx weewx  5795 10 feb 12:00 monthrx.png
-rw-r--r--  1 weewx weewx  7967 10 feb 12:00 monthtempdew.png
-rw-r--r--  1 weewx weewx  6745 10 feb 12:00 monthtempfeel.png
-rw-r--r--  1 weewx weewx  6504 10 feb 12:00 monthtempin.png
-rw-r--r--  1 weewx weewx  4930 10 feb 12:00 monthUV.png
-rw-r--r--  1 weewx weewx 12383 10 feb 12:00 monthvolt.png
-rw-r--r--  1 weewx weewx  5609 10 feb 12:00 monthwinddir.png
-rw-r--r--  1 weewx weewx  7443 10 feb 12:00 monthwind.png
-rw-r--r--  1 weewx weewx  6826 10 feb 12:00 monthwindvec.png
drwxrwsr-x  2 weewx weewx  4096 10 feb 14:40 NOAA
-rw-r--r--  1 weewx weewx  9472 10 feb 14:40 rss.xml
-rw-r--r--  1 weewx weewx  5406  9 feb 19:15 seasons.css
-rw-r--r--  1 weewx weewx  6404  9 feb 19:15 seasons.js
-rw-r--r--  1 weewx weewx 18081 10 feb 14:40 statistics.html
-rw-r--r--  1 weewx weewx  1446 10 feb 14:40 tabular.html
-rw-r--r--  1 weewx weewx  5212 10 feb 14:40 telemetry.html
-rw-r--r--  1 weewx weewx  5975 10 feb 14:00 weekbarometer.png
-rw-r--r--  1 weewx weewx  7614 10 feb 14:00 weekET.png
-rw-r--r--  1 weewx weewx  6146 10 feb 14:00 weekhumin.png
-rw-r--r--  1 weewx weewx  6210 10 feb 14:00 weekhum.png
-rw-r--r--  1 weewx weewx  6695 10 feb 14:00 weekradiation.png
-rw-r--r--  1 weewx weewx  6567 10 feb 14:00 weekrain.png
-rw-r--r--  1 weewx weewx  6241 10 feb 14:00 weekrx.png
-rw-r--r--  1 weewx weewx  7358 10 feb 14:00 weektempdew.png
-rw-r--r--  1 weewx weewx  6837 10 feb 14:00 weektempfeel.png
-rw-r--r--  1 weewx weewx  5788 10 feb 14:00 weektempin.png
-rw-r--r--  1 weewx weewx  4735 10 feb 14:00 weekUV.png
-rw-r--r--  1 weewx weewx 12313 10 feb 14:00 weekvolt.png
-rw-r--r--  1 weewx weewx  5511 10 feb 14:00 weekwinddir.png
-rw-r--r--  1 weewx weewx  7400 10 feb 14:00 weekwind.png
-rw-r--r--  1 weewx weewx  6600 10 feb 14:00 weekwindvec.png
-rw-r--r--  1 weewx weewx  5764 10 feb 00:00 yearbarometer.png
-rw-r--r--  1 weewx weewx  7326 10 feb 00:00 yearET.png
-rw-r--r--  1 weewx weewx  6158 10 feb 00:00 yearhumin.png
-rw-r--r--  1 weewx weewx  6289 10 feb 00:00 yearhum.png
-rw-r--r--  1 weewx weewx  5773 10 feb 00:00 yearradiation.png
-rw-r--r--  1 weewx weewx  5722 10 feb 00:00 yearrain.png
-rw-r--r--  1 weewx weewx  5137 10 feb 00:00 yearrx.png
-rw-r--r--  1 weewx weewx  7086 10 feb 00:00 yeartempdew.png
-rw-r--r--  1 weewx weewx  7225 10 feb 00:00 yeartempfeel.png
-rw-r--r--  1 weewx weewx  6938 10 feb 00:00 yeartempin.png
-rw-r--r--  1 weewx weewx  5688 10 feb 00:00 yearUV.png
-rw-r--r--  1 weewx weewx 11576 10 feb 00:00 yearvolt.png
-rw-r--r--  1 weewx weewx  4942 10 feb 00:00 yearwinddir.png
-rw-r--r--  1 weewx weewx  7169 10 feb 00:00 yearwind.png
-rw-r--r--  1 weewx weewx  6376 10 feb 00:00 yearwindvec.png
sudo journalctl -u weewx -f
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.restx: CWOP: Posting not enabled.
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.restx: WOW: Posting not enabled.
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.restx: AWEKAS: Posting not enabled.
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.engine: 'pyephem' detected, extended almanac data is available
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO __main__: Starting up weewx version 5.0.1
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.engine: Clock error is -0.17 seconds (positive is fast)
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.manager: Starting backfill of daily summaries
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.manager: Daily summaries up to date
feb 10 15:05:57 raspberrypi weewxd[4548]: INFO weewx.engine: Starting main packet loop.
feb 10 15:10:15 raspberrypi weewxd[4548]: INFO weewx.manager: Added record 2024-02-10 15:10:00 CET (1707574200) to database 'weewx.sdb'
feb 10 15:10:15 raspberrypi weewxd[4548]: INFO weewx.manager: Added record 2024-02-10 15:10:00 CET (1707574200) to daily summary in 'weewx.sdb'
feb 10 15:10:15 raspberrypi weewxd[4548]: INFO user.belchertown: version 1.3.1
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.CheetahGenerator'
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  [Errno 2] Bestand of map bestaat niet: '/var/www/html/NOAA/NOAA-2024-02.txt.tmp'
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      obj.start()
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      self.run()
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 166, in run
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 371, in generate
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      with open(tmpname, mode='wb') as fd:
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****           ^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  FileNotFoundError: [Errno 2] Bestand of map bestaat niet: '/var/www/html/NOAA/NOAA-2024-02.txt.tmp'
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  Generator terminated
feb 10 15:10:15 raspberrypi weewxd[4548]: Traceback (most recent call last):
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
feb 10 15:10:15 raspberrypi weewxd[4548]:     obj.start()
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
feb 10 15:10:15 raspberrypi weewxd[4548]:     self.run()
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 166, in run
feb 10 15:10:15 raspberrypi weewxd[4548]:     ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)
feb 10 15:10:15 raspberrypi weewxd[4548]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
feb 10 15:10:15 raspberrypi weewxd[4548]:     ngen += self.generate(section[subsection], subsection, gen_ts)
feb 10 15:10:15 raspberrypi weewxd[4548]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate
feb 10 15:10:15 raspberrypi weewxd[4548]:     ngen += self.generate(section[subsection], subsection, gen_ts)
feb 10 15:10:15 raspberrypi weewxd[4548]:             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/cheetahgenerator.py", line 371, in generate
feb 10 15:10:15 raspberrypi weewxd[4548]:     with open(tmpname, mode='wb') as fd:
feb 10 15:10:15 raspberrypi weewxd[4548]:          ^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: FileNotFoundError: [Errno 2] Bestand of map bestaat niet: '/var/www/html/NOAA/NOAA-2024-02.txt.tmp'
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.reportengine.CopyGenerator'
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  [Errno 13] Toegang geweigerd: '/var/www/html/favicon.ico'
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      obj.start()
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      self.run()
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 560, in run
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      ncopy += weeutil.weeutil.deep_copy_path(path, html_dest_dir)
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1811, in deep_copy_path
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      shutil.copy(path, d)
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.11/shutil.py", line 419, in copy
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      copyfile(src, dst, follow_symlinks=follow_symlinks)
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      with open(dst, 'wb') as fdst:
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****           ^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  PermissionError: [Errno 13] Toegang geweigerd: '/var/www/html/favicon.ico'
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  Generator terminated
feb 10 15:10:15 raspberrypi weewxd[4548]: Traceback (most recent call last):
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
feb 10 15:10:15 raspberrypi weewxd[4548]:     obj.start()
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
feb 10 15:10:15 raspberrypi weewxd[4548]:     self.run()
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/reportengine.py", line 560, in run
feb 10 15:10:15 raspberrypi weewxd[4548]:     ncopy += weeutil.weeutil.deep_copy_path(path, html_dest_dir)
feb 10 15:10:15 raspberrypi weewxd[4548]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weeutil/weeutil.py", line 1811, in deep_copy_path
feb 10 15:10:15 raspberrypi weewxd[4548]:     shutil.copy(path, d)
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/lib/python3.11/shutil.py", line 419, in copy
feb 10 15:10:15 raspberrypi weewxd[4548]:     copyfile(src, dst, follow_symlinks=follow_symlinks)
feb 10 15:10:15 raspberrypi weewxd[4548]:   File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
feb 10 15:10:15 raspberrypi weewxd[4548]:     with open(dst, 'wb') as fdst:
feb 10 15:10:15 raspberrypi weewxd[4548]:          ^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: PermissionError: [Errno 13] Toegang geweigerd: '/var/www/html/favicon.ico'
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine: Caught unrecoverable exception in generator 'user.belchertown.HighchartsJsonGenerator'
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  [Errno 2] Bestand of map bestaat niet: '/var/www/html/json/homepage.json'
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      obj.start()
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      self.run()
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/etc/weewx/bin/user/belchertown.py", line 2817, in run
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      with open(json_filename, mode="w") as jf:
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  FileNotFoundError: [Errno 2] Bestand of map bestaat niet: '/var/www/html/json/homepage.json'
feb 10 15:10:16 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  Generator terminated
feb 10 15:10:16 raspberrypi weewxd[4548]: Traceback (most recent call last):
feb 10 15:10:16 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
feb 10 15:10:16 raspberrypi weewxd[4548]:     obj.start()
feb 10 15:10:16 raspberrypi weewxd[4548]:   File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
feb 10 15:10:16 raspberrypi weewxd[4548]:     self.run()
feb 10 15:10:16 raspberrypi weewxd[4548]:   File "/etc/weewx/bin/user/belchertown.py", line 2817, in run
feb 10 15:10:16 raspberrypi weewxd[4548]:     with open(json_filename, mode="w") as jf:
feb 10 15:10:16 raspberrypi weewxd[4548]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feb 10 15:10:16 raspberrypi weewxd[4548]: FileNotFoundError: [Errno 2] Bestand of map bestaat niet: '/var/www/html/json/homepage.json'
feb 10 15:10:39 raspberrypi weewxd[4548]: ERROR weewx.restx: StationRegistry: Failed to publish record 2024-02-10 15:10:00 CET (1707574200): HTTP Error 429: TOO MANY REQUESTS

Op za 10 feb 2024 om 12:14 schreef walter Gross <wagr...@gmail.com>:
--
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/3353f008-7cc5-4988-8309-c09e54694180n%40googlegroups.com.

vince

unread,
Feb 10, 2024, 1:10:13 PM2/10/24
to weewx-user
Walter and Ton…
  • What os and version are you running?
  • Which webserver are you running ?
  • What are the permissions on /var/www/html (the directory the weewx subdirectory is in) ?
  • Did you upgrade from v4 to v5…or did you install v5 on a clean os ?

Graham Eddy

unread,
Feb 10, 2024, 9:12:12 PM2/10/24
to WeeWX User
why are you writing into files outside weewx’s area? weewx user is unlikely to have perms to do that
⊣GE⊢

On 11 Feb 2024, at 1:59 am, Ton Karsten <moth...@gmail.com> wrote:

feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****      with open(dst, 'wb') as fdst:
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****           ^^^^^^^^^^^^^^^
feb 10 15:10:15 raspberrypi weewxd[4548]: ERROR weewx.reportengine:         ****  PermissionError: [Errno 13] Toegang geweigerd: '/var/www/html/favicon.ico’
...

vince

unread,
Feb 10, 2024, 11:28:45 PM2/10/24
to weewx-user
Or if you have it via cron, put it in weewx's crontab, not user 'pi'

Uwe S.

unread,
Feb 11, 2024, 3:40:02 AM2/11/24
to weewx-user
I had a very similar issue while updating my weewx instance. Finally it was a permission issue in /var/tmp

You can try changing permission or ownership of the files reported. For me it was working afterwards.

Ton Karsten

unread,
Feb 11, 2024, 5:20:17 AM2/11/24
to weewx...@googlegroups.com
Vince,
I use a raspberry Pi3 B+
As web server nginx
The latest version OS from December 5, 23 Kernel version: 6.1
Debian version: 12 (bookworm)
Completely new latest version of Weewx
installation on a new SD card
Settings for the folders according to schedule
For the HTML_ROOT directory:

# set the permissions

sudo find /var/www/html/weewx -type d -exec chmod 2775 {} \;
sudo find /var/www/html/weewx -type f -exec chmod 664 {} \;
# set the owner and group

sudo chown -R weewx /var/www/html/weewx
sudo chgrp -R weewx /var/www/html/weewx

The server writes a file in the /var/www/html directory
index.nginx-debian.html
Is also visible in the FF browser

Op zo 11 feb 2024 om 09:40 schreef Uwe S. <uwe.sc...@gmail.com>:
--
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.

vince

unread,
Feb 11, 2024, 11:25:22 AM2/11/24
to weewx-user
Debian12 virtual machine for me:
  • a new installation works
  • a v4 installation works
  • a v4 to v5 upgrade works
I did 'not' need to do any of the chmod/chown/chgrp commands. The dpkg installation worked just fine here.

Ton Karsten

unread,
Feb 11, 2024, 2:44:18 PM2/11/24
to weewx...@googlegroups.com
Vince,

Do you have the files generated by the weewx in the /var/www/html folder without the many error messages I have?
If not,  I have no idea what to do next.

Op zo 11 feb 2024 om 17:25 schreef vince <vince...@gmail.com>:

vince

unread,
Feb 11, 2024, 3:00:50 PM2/11/24
to weewx-user
Everything writes to /var/www/html/weewx here.  No errors.

matthew wall

unread,
Feb 11, 2024, 3:29:51 PM2/11/24
to weewx-user
On Sunday, February 11, 2024 at 2:44:18 PM UTC-5 moth...@gmail.com wrote:
Do you have the files generated by the weewx in the /var/www/html folder without the many error messages I have?
If not,  I have no idea what to do next.

please note that /var/www/html is not the same as /var/www/html/weewx

the weewx installer sets permissions on /var/www/html/weewx, since that is the default location of HTML_ROOT

the owner of /var/www/html is typically www-data, although this depends on the linux distribution and web server configuration.

be sure that you know who weewxd is running as.  when you do 'ps aux | grep weewxd', the first column will be the username of the owner of the weewxd process. that user must have read/write permission on the HTML_ROOT directory.

m

walter Gross

unread,
Feb 12, 2024, 11:22:13 AM2/12/24
to weewx-user
Hi Matthew

I am aware that /var/www/html is not the same as /var/www/html/weewx.
Under html is my joomla Homepage and under html/weewx should weather data go. That worked fine with version 4.10.2

I made again a new installation in the meantime, version 5. with the same permission problem.
Now I realise that "weewx" is NOT running the process `weewxd`. It runs under my own user.

How can I set required permissions to my user or how can weewx take over the the weewxd process?
Sorry to ask but my Linuxknowledge is limited :-|
Thanks again for help.
Walter

matthew wall

unread,
Feb 12, 2024, 12:01:36 PM2/12/24
to weewx-user
walter,

thank you for being patient.

On Monday, February 12, 2024 at 11:22:13 AM UTC-5 wagr...@gmail.com wrote:
I made again a new installation in the meantime, version 5. with the same permission problem.
Now I realise that "weewx" is NOT running the process `weewxd`. It runs under my own user.

how did this happen?  if you installed weewx v4 using deb/rpm, it would have run as root.  at some point, you must have modified the configuration so that weewxd runs as you instead of root. or perhaps you are running weewxd directly, in which case it is running as you now, but runs as a different user when the system boots. or perhaps at some point you changed the ownership of /var/lib/weewx so it is owned by you?

please post the contents of these files:

/etc/default/weewx
/etc/systemd/system/weewx.service
/etc/init.d/weewx

this may seem like pointless questions, but if we understand what is different about your configuration, we can make the process smoother for everyone.

How can I set required permissions to my user or how can weewx take over the the weewxd process?
Sorry to ask but my Linuxknowledge is limited :-|

 *if* weewxd is running as you, and you want that to continue, then you must change ownership of the files to your username, not 'weewx'.

however, if you want weewxd to run as the 'weewx' user, then you must:
1) ensure that the weewx user exists (from your previous posting, weewx user appears to exist)
2) change ownership of the files to weewx (from your previous posting, the owner ship was weewx:weewx, at least when you posted)
3) ensure that the systemd unit uses User=weewx and Group=weewx (look in /usr/lib/systemd/system/weewx.service)
4) ensure that you do not have other configuration that would override the default (you should not need /etc/systemd/system/weewx.service)
5) do not invoke weewxd directly as yourself, only as the weewx user

m

walter Gross

unread,
Feb 13, 2024, 9:11:14 AM2/13/24
to weewx-user
Hi Matthew

As said I made e new installation (Raspi4, bullseye) now version 5.0.2-1 according installation guide.

Weewx installs:

Entpacken von weewx (5.0.2-1) ...
weewx (5.0.2-1) wird eingerichtet ...
Using weewx:weewx as user:group
Creating /etc/default/weewx
Using configuration file /etc/weewx/weewx.conf
Processing configuration file /etc/weewx/weewx.conf

Setting record_generation to software.
Saving configuration file /etc/weewx/weewx.conf
Adding system group weewx...done
Adding system user weewx...done
Adding user wag to group weewx
Installing systemd units
Installing udev rules
Creating skins directory /etc/weewx/skins
Creating user extension directory /etc/weewx/bin/user
Configuring database directory /var/lib/weewx
Configuring reporting directory /var/www/html/weewx
Setting permissions weewx:weewx on /etc/weewx
Enabling startup using systemd
Created symlink /etc/systemd/system/multi-user.target.wants/weewx.service → /lib/systemd/system/weewx.service.
Starting weewxd using systemd

Next step:

weewx takes stored records from the weatherstation and write to database. That worked.

After this the same result:

Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.imagegenerator: Unable to save to file '/var/www/html/weewx/yearrx.png' [Errno 13] Keine Berechtigung: '/var/www/html/weewx/yearrx.png':
Feb 13 12:40:54 hp weewxd[4425]: INFO weewx.imagegenerator: Generated 0 images for report SeasonsReport in 3.97 seconds
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.reportengine.CopyGenerator'
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****  [Errno 13] Keine Berechtigung: '/var/www/html/weewx'
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****      obj.start()
Feb 13 12:40:54 hp weewxd[4425]: Traceback (most recent call last):
Feb 13 12:40:54 hp weewxd[4425]:   File "/usr/share/weewx/weewx/reportengine.py", line 220, in run
Feb 13 12:40:54 hp weewxd[4425]:     obj.start()
Feb 13 12:40:54 hp weewxd[4425]:   File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
Feb 13 12:40:54 hp weewxd[4425]:     self.run()
Feb 13 12:40:54 hp weewxd[4425]:   File "/usr/share/weewx/weewx/reportengine.py", line 560, in run
Feb 13 12:40:54 hp weewxd[4425]:     ncopy += weeutil.weeutil.deep_copy_path(path, html_dest_dir)
Feb 13 12:40:54 hp weewxd[4425]:   File "/usr/share/weewx/weeutil/weeutil.py", line 1807, in deep_copy_path
Feb 13 12:40:54 hp weewxd[4425]:     os.makedirs(d, exist_ok=True)
Feb 13 12:40:54 hp weewxd[4425]:   File "/usr/lib/python3.9/os.py", line 225, in makedirs
Feb 13 12:40:54 hp weewxd[4425]:     mkdir(name, mode)
Feb 13 12:40:54 hp weewxd[4425]: PermissionError: [Errno 13] Keine Berechtigung: '/var/www/html/weewx'
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 409, in start
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****      self.run()
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 560, in run
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****      ncopy += weeutil.weeutil.deep_copy_path(path, html_dest_dir)
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1807, in deep_copy_path
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****      os.makedirs(d, exist_ok=True)
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****    File "/usr/lib/python3.9/os.py", line 225, in makedirs
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****      mkdir(name, mode)
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****  PermissionError: [Errno 13] Keine Berechtigung: '/var/www/html/weewx'
Feb 13 12:40:54 hp weewxd[4425]: ERROR weewx.reportengine:         ****  Generator terminated

Next step:

Gave permission acc. wiki, and restarted with "sudo systemctl start weewx". No effect
-------------------------------------------------------------------------------------------------------------------
next step:

ps aux|grep weewxd:

weewx     4425 10.3  0.8  61488 33168 ?        Ssl  12:30   2:22 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
wag       5411  0.0  0.0   7372   556 pts/0    S+   12:53   0:00 grep --color=auto weewxd
--------------------------------------------------------------------------------------------------------------------

content as per your request

content of /etc/default/weewx:
WEEWX_PYTHON=python3
WEEWX_BINDIR=/usr/share/weew
---------------------------------------------------
/etc/systemd/system/weewx.service  no such file existing
---------------------------------------------------
but found in
/usr/lib/systemd/system/weewx.service:

# systemd service configuration file for WeeWX

[Unit]
Description=WeeWX
Documentation=https://weewx.com/docs
Requires=time-sync.target
After=time-sync.target
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=weewxd /etc/weewx/weewx.conf
StandardOutput=null
StandardError=journal+console
RuntimeDirectory=weewx
RuntimeDirectoryMode=775
User=weewx
Group=weewx

[Install]
WantedBy=multi-user.target

--------------------------------------------

/etc/init.d/weewx no such file existing

--------------------------------------------

next step to find files with weewx, may be it helps?

 $ sudo find / -type f -name "*eewx.*"
/etc/weewx/weewx.conf-5.0.2
/etc/weewx/weewx.conf
/etc/weewx/skins/Standard/weewx.css
/etc/weewx/systemd/weewx.service
/etc/weewx/logwatch/conf/services/weewx.conf
/etc/weewx/logwatch/conf/logfiles/weewx.conf
/etc/weewx/udev/weewx.rules
/etc/weewx/rsyslog.d/weewx.conf
/etc/apache2/sites-available/weewx.conf
/etc/apt/trusted.gpg.d/weewx.gpg
/etc/apt/sources.list.d/weewx.list
/var/lib/dpkg/info/weewx.preinst
/var/lib/dpkg/info/weewx.md5sums
/var/lib/dpkg/info/weewx.config
/var/lib/dpkg/info/weewx.list
/var/lib/dpkg/info/weewx.prerm
/var/lib/dpkg/info/weewx.postrm
/var/lib/dpkg/info/weewx.postinst
/var/lib/dpkg/info/weewx.conffiles
/var/lib/dpkg/info/weewx.templates
/var/lib/weewx/weewx.sdb
/var/lib/apt/lists/weewx.com_apt_python3_dists_buster_main_binary-all_Packages
/var/lib/apt/lists/weewx.com_apt_python3_dists_buster_InRelease
/usr/lib/systemd/system/weewx.service
/usr/lib/udev/rules.d/60-weewx.rules
/usr/share/weewx/weewx_data/util/nginx/weewx.conf
/usr/share/weewx/weewx_data/util/systemd/weewx.service
/usr/share/weewx/weewx_data/util/newsyslog.d/weewx.conf
/usr/share/weewx/weewx_data/util/tmpfiles.d/weewx.conf
/usr/share/weewx/weewx_data/util/syslog.d/weewx.conf
/usr/share/weewx/weewx_data/util/apache/weewx.conf
/usr/share/weewx/weewx_data/util/logwatch/conf/services/weewx.conf
/usr/share/weewx/weewx_data/util/logwatch/conf/logfiles/weewx.conf
/usr/share/weewx/weewx_data/util/init.d/weewx.bsd
/usr/share/weewx/weewx_data/util/udev/rules.d/weewx.rules
/usr/share/weewx/weewx_data/util/launchd/com.weewx.weewxd.plist
/usr/share/weewx/weewx_data/util/rsyslog.d/weewx.conf
/usr/share/weewx/weewx_data/weewx.conf
/usr/share/weewx/weewx_data/skins/Standard/weewx.css

----------------------------------------------------------------

Next step:
I took a new ssd and installed latest os (bookworm lite) and installed weewx the same way and it works!
The only different is, that no apache server is running resp. a hompepage under /var/www/html

ps aux|grep weewxd gave the same output as mentioned above

-----------------------------------------------------------------

Next step:
I have added a weewx.conf in apache 2/sites-enabled to allow to write to /var/www/html/weewx, but no success.

Now I am out of Ideas

Walter

matthew wall

unread,
Feb 13, 2024, 9:44:05 AM2/13/24
to weewx-user
the process 'weewxd' does not have permission to create the directory /var/www/html/weewx

assuming that weewxd is configured to run as the user 'weewx', you can fix it like this:

sudo mkdir /var/www/html/weewx
sudo chown weewx /var/www/html/weewx
sudo chgrp weewx /var/www/html/weewx

Pierre-Yves

unread,
Feb 13, 2024, 2:31:29 PM2/13/24
to weewx-user
Hello,

I experience very similar behavior to that described above.

Recently, I failed to upgrade my Weewx 4.10 to Weewx 5.0.x.
I reverted "temporarily" to 4.10 and decided to make a fresh install on a spare set Pi4 + SDR stick.

I installed RTL_433 and sdr-rtl following the https://github.com/weewx/weewx/wiki/sdr-rpi-recipe tutorial. I then installed weewx 5.0.3 and the sdr driver

I finally replaced the weewx.conf by the one coming from my 4.10 setup.

I tried several commands :
 
- rtl_433 -> ok

- rtl_433 -f 868.3M -f 433.92M -H 90 -Y autolevel -s 1024k -R 173 -R 172 -R 42 -M utc -F json -> ok

- sudo PYTHONPATH=/usr/share/weewx python3 /etc/weewx/bin/user/sdr.py --cmd="rtl_433 -f 868.3M -f 433.92M -H 90 -Y autolevel -s 1024k -R 173 -R 172 -R 42 -M utc -F json" -> ok
 
 But "weewxd" fails : problem of permission error (see "weewxd log")
 

And "sudo systemctl start weewx" fails too (see "sudo systemctl start weewx log")

Finally I tried "sudo weewd" that works and writes data to /var/www/html/weewx ...

ps aux|grep weewxd gives :

pi@raspberrypi:~ $ ps aux|grep weewxd
pi       31049  0.0  0.0   7460   548 pts/1    S+   19:23   0:00 grep --color=auto weewxd

It seems that weewx user doesn't exist !

ls -la /var/www/html/weewx gives :

 pi@raspberrypi:~ $ ls -la /var/www/html/weewx
total 824
drwxrwsrwx 4 weewx weewx  4096 13 févr. 19:20 .
drwxr-xr-x 3 root  root   4096 13 févr. 14:57 ..
-rw-r--r-- 1 root  weewx  5628 13 févr. 19:20 celestial.html
-rw-r--r-- 1 weewx weewx 10018 13 févr. 19:20 daybarometer.png
-rw-r--r-- 1 weewx weewx  7875 13 févr. 19:20 dayET.png
-rw-r--r-- 1 weewx weewx  8068 13 févr. 19:20 dayhumext.png
-rw-r--r-- 1 weewx weewx  7226 13 févr. 19:20 dayhumin.png
-rw-r--r-- 1 weewx weewx  8086 13 févr. 19:20 dayhum.png
-rw-r--r-- 1 weewx weewx  6884 13 févr. 09:21 daylightning.png
-rw-r--r-- 1 weewx weewx  8608 13 févr. 19:20 dayradiation.png
-rw-r--r-- 1 weewx weewx  7004 13 févr. 19:20 dayrain.png
-rw-r--r-- 1 weewx weewx  6490 13 févr. 19:20 dayrx.png
-rw-r--r-- 1 weewx weewx  9330 13 févr. 19:20 daytempdew.png
-rw-r--r-- 1 weewx weewx  8071 13 févr. 19:20 daytempext.png
-rw-r--r-- 1 weewx weewx  8923 13 févr. 19:20 daytempfeel.png
-rw-r--r-- 1 weewx weewx  8125 13 févr. 19:20 daytempin.png
-rw-r--r-- 1 weewx weewx  6225 13 févr. 19:20 dayUV.png
-rw-r--r-- 1 weewx weewx 11508 13 févr. 19:20 dayvolt.png
-rw-r--r-- 1 weewx weewx  8087 13 févr. 19:20 daywinddir.png
-rw-r--r-- 1 weewx weewx  9878 13 févr. 19:20 daywind.png
-rw-r--r-- 1 weewx weewx  8503 13 févr. 19:20 daywindvec.png
-rw-r--r-- 1 weewx weewx  1150 13 févr. 19:20 favicon.ico
drwxr-sr-x 2 weewx weewx  4096 13 févr. 09:21 font
-rw-r--r-- 1 root  weewx 31797 13 févr. 19:20 index.html
-rw-r--r-- 1 weewx weewx  7702 13 févr. 18:00 monthbarometer.png
-rw-r--r-- 1 weewx weewx  8532 13 févr. 18:00 monthET.png
-rw-r--r-- 1 weewx weewx  8006 13 févr. 18:00 monthhumext.png
-rw-r--r-- 1 weewx weewx  7446 13 févr. 18:00 monthhumin.png
-rw-r--r-- 1 weewx weewx  7328 13 févr. 18:00 monthhum.png
-rw-r--r-- 1 weewx weewx  7383 13 févr. 09:21 monthlightning.png
-rw-r--r-- 1 weewx weewx  8135 13 févr. 18:00 monthradiation.png
-rw-r--r-- 1 weewx weewx  7181 13 févr. 18:00 monthrain.png
-rw-r--r-- 1 weewx weewx  6503 13 févr. 18:00 monthrx.png
-rw-r--r-- 1 weewx weewx  7870 13 févr. 18:00 monthtempdew.png
-rw-r--r-- 1 weewx weewx  7357 13 févr. 18:00 monthtempext.png
-rw-r--r-- 1 weewx weewx  9012 13 févr. 18:00 monthtempfeel.png
-rw-r--r-- 1 weewx weewx  7911 13 févr. 18:00 monthtempin.png
-rw-r--r-- 1 weewx weewx  6574 13 févr. 18:00 monthUV.png
-rw-r--r-- 1 weewx weewx 11055 13 févr. 18:00 monthvolt.png
-rw-r--r-- 1 weewx weewx  6080 13 févr. 18:00 monthwinddir.png
-rw-r--r-- 1 weewx weewx  7732 13 févr. 18:00 monthwind.png
-rw-r--r-- 1 weewx weewx  6752 13 févr. 18:00 monthwindvec.png
drwxr-sr-x 2 weewx weewx 12288 13 févr. 19:20 NOAA
-rw-r--r-- 1 root  weewx 11717 13 févr. 19:20 rss.xml
-rw-r--r-- 1 weewx weewx  5406 13 févr. 19:20 seasons.css
-rw-r--r-- 1 weewx weewx  6404 13 févr. 19:20 seasons.js
-rw-r--r-- 1 root  weewx 23189 13 févr. 19:20 statistics.html
-rw-r--r-- 1 root  weewx  1461 13 févr. 19:20 tabular.html
-rw-r--r-- 1 root  weewx  5460 13 févr. 19:20 telemetry.html
-rw-r--r-- 1 weewx weewx  8165 13 févr. 19:20 weekbarometer.png
-rw-r--r-- 1 weewx weewx  8273 13 févr. 19:20 weekET.png
-rw-r--r-- 1 weewx weewx  7852 13 févr. 19:20 weekhumext.png
-rw-r--r-- 1 weewx weewx  7285 13 févr. 19:20 weekhumin.png
-rw-r--r-- 1 weewx weewx  7532 13 févr. 19:20 weekhum.png
-rw-r--r-- 1 weewx weewx  7056 13 févr. 09:21 weeklightning.png
-rw-r--r-- 1 weewx weewx  7758 13 févr. 19:20 weekradiation.png
-rw-r--r-- 1 weewx weewx  7419 13 févr. 19:20 weekrain.png
-rw-r--r-- 1 weewx weewx  6577 13 févr. 19:20 weekrx.png
-rw-r--r-- 1 weewx weewx  8905 13 févr. 19:20 weektempdew.png
-rw-r--r-- 1 weewx weewx  7887 13 févr. 19:20 weektempext.png
-rw-r--r-- 1 weewx weewx  8105 13 févr. 19:20 weektempfeel.png
-rw-r--r-- 1 weewx weewx  7566 13 févr. 19:20 weektempin.png
-rw-r--r-- 1 weewx weewx  6136 13 févr. 19:20 weekUV.png
-rw-r--r-- 1 weewx weewx 11665 13 févr. 19:20 weekvolt.png
-rw-r--r-- 1 weewx weewx  6919 13 févr. 19:20 weekwinddir.png
-rw-r--r-- 1 weewx weewx  8827 13 févr. 19:20 weekwind.png
-rw-r--r-- 1 weewx weewx  7495 13 févr. 19:20 weekwindvec.png
-rw-r--r-- 1 weewx weewx  9525 13 févr. 09:21 yearbarometer.png
-rw-r--r-- 1 weewx weewx  7754 13 févr. 09:21 yearET.png
-rw-r--r-- 1 weewx weewx 13773 13 févr. 09:21 yearhumext.png
-rw-r--r-- 1 weewx weewx  8247 13 févr. 09:21 yearhumin.png
-rw-r--r-- 1 weewx weewx 10196 13 févr. 09:21 yearhum.png
-rw-r--r-- 1 weewx weewx  7123 13 févr. 09:21 yearlightning.png
-rw-r--r-- 1 weewx weewx  9078 13 févr. 09:21 yearradiation.png
-rw-r--r-- 1 weewx weewx  7971 13 févr. 09:21 yearrain.png
-rw-r--r-- 1 weewx weewx  6105 13 févr. 09:25 yearrx.png
-rw-r--r-- 1 weewx weewx 11713 13 févr. 09:21 yeartempdew.png
-rw-r--r-- 1 weewx weewx 11726 13 févr. 09:21 yeartempext.png
-rw-r--r-- 1 weewx weewx 11084 13 févr. 09:21 yeartempfeel.png
-rw-r--r-- 1 weewx weewx  8401 13 févr. 09:21 yeartempin.png
-rw-r--r-- 1 weewx weewx  8797 13 févr. 09:21 yearUV.png
-rw-r--r-- 1 weewx weewx 10464 13 févr. 09:25 yearvolt.png
-rw-r--r-- 1 weewx weewx  9513 13 févr. 09:21 yearwinddir.png
-rw-r--r-- 1 weewx weewx 11318 13 févr. 09:21 yearwind.png
-rw-r--r-- 1 weewx weewx 10569 13 févr. 09:21 yearwindvec.png

I applied the differrent fixe proposals from https://github.com/weewx/weewx/wiki/Understanding-permissions. But no change

Any clue to solve this problem ?

Thanks,

Pierre-Yves
sudo systemctl start weewx log
weewxd log

Pierre-Yves

unread,
Feb 13, 2024, 2:43:22 PM2/13/24
to weewx-user
Contents of several files to complete the previous post:

/etc/default/weewx :

WEEWX_PYTHON=python3
WEEWX_BINDIR=/usr/share/weewx

/etc/systemd/system/weewx.service :

no file named weewx.service

/etc/init.d/weewx

no file named weewx

PYB

vince

unread,
Feb 13, 2024, 2:47:39 PM2/13/24
to weewx-user
I suggest you try to get weewx and your webserver working using the Simulator driver first before trying to get the RTL/SDR configuration working.

Pierre-Yves

unread,
Feb 13, 2024, 3:31:54 PM2/13/24
to weewx-user
Thanks Vince for feedback.

Weewx and webserver are perfectly working in simulator mode with "sudo systemctl start weewx" command

Feb 13 21:28:23 raspberrypi systemd[1]: Started WeeWX.
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Initializing weewxd version 5.0.2
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Using Python 3.9.2 (default, Mar 12 2021, 04:06:34) #012[GCC 10.2.1 20210110]
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Located at /usr/bin/python3
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Platform Linux-6.1.21-v8+-aarch64-with-glibc2.31
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Locale: 'fr_FR.UTF-8'
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Entry path: /usr/share/weewx/weewxd.py
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: WEEWX_ROOT: /etc/weewx
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Configuration file: /etc/weewx/weewx.conf
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: User module: /etc/weewx/bin/user
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Debug: 1
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG __main__: Initializing engine
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: Loading station type Simulator (weewx.drivers.simulator)
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.engine.StdTimeSynch
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.engine.StdTimeSynch
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: No services in service group data_services
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.engine.StdConvert
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: StdConvert target unit is 0x1
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.engine.StdConvert
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.engine.StdCalibrate
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.engine.StdCalibrate
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.engine.StdQC
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.engine.StdQC
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.wxservices.StdWXCalculate
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.wxservices: StdWXCalculate will use data binding wx_binding
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.manager: Daily summary version is 4.0
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.wxservices.StdWXCalculate
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.wxxtypes.StdWXXTypes
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdWXXTypes
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.wxxtypes.StdPressureCooker
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdPressureCooker
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.wxxtypes.StdRainRater
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdRainRater
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.wxxtypes.StdDelta
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.wxxtypes.StdDelta
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.engine.StdArchive
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: Archive will use data binding wx_binding
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: Record generation will be attempted in 'hardware'
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: Using archive interval of 300 seconds (specified in weewx configuration)
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Use LOOP data in hi/low calculations: 1
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.engine.StdArchive
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.restx.StdStationRegistry
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.restx: StationRegistry: Registration not requested.
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.restx.StdStationRegistry
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.restx.StdWunderground
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.restx: Wunderground: Posting not enabled.
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.restx.StdWunderground
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.restx.StdPWSweather
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.restx: PWSweather: Posting not enabled.
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.restx.StdPWSweather
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.restx.StdCWOP
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.restx: CWOP: Posting not enabled.
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.restx.StdCWOP
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.restx.StdWOW
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.restx: WOW: Posting not enabled.
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.restx.StdWOW
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.restx.StdAWEKAS
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.restx: AWEKAS: Posting not enabled.
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.restx.StdAWEKAS
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.engine.StdPrint
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.engine.StdPrint
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Loading service weewx.engine.StdReport
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: 'pyephem' detected, extended almanac data is available
Feb 13 21:28:23 raspberrypi weewxd[17482]: DEBUG weewx.engine: Finished loading service weewx.engine.StdReport
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO __main__: Starting up weewx version 5.0.2
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: Clock error is -0.11 seconds (positive is fast)
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.manager: Starting backfill of daily summaries
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.manager: Daily summaries up to date
Feb 13 21:28:23 raspberrypi weewxd[17482]: INFO weewx.engine: Starting main packet loop.
Feb 13 21:30:16 raspberrypi weewxd[17482]: INFO weewx.manager: Added record 2024-02-13 21:30:00 CET (1707856200) to database 'weewx.sdb'
Feb 13 21:30:16 raspberrypi weewxd[17482]: INFO weewx.manager: Added record 2024-02-13 21:30:00 CET (1707856200) to daily summary in 'weewx.sdb'
Feb 13 21:30:16 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Running reports for latest time in the database.
Feb 13 21:30:17 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Running report 'SeasonsReport'
Feb 13 21:30:17 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Found configuration file /etc/weewx/skins/Seasons/skin.conf for report 'SeasonsReport'
Feb 13 21:30:17 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Running generators for report 'SeasonsReport' in directory '/etc/weewx/skins/Seasons'
Feb 13 21:30:17 raspberrypi weewxd[17482]: DEBUG weewx.cheetahgenerator: Using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.DisplayOptions', 'weewx.cheetahgenerator.Extras', 'weewx.cheetahgenerator.Gettext', 'weewx.cheetahgenerator.JSONHelpers', 'weewx.cheetahgenerator.PlotInfo', 'weewx.cheetahgenerator.SkinInfo', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo']
Feb 13 21:30:17 raspberrypi weewxd[17482]: DEBUG weewx.manager: Daily summary version is 4.0
Feb 13 21:30:18 raspberrypi weewxd[17482]: INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 1.91 seconds
Feb 13 21:30:18 raspberrypi weewxd[17482]: DEBUG weewx.manager: Daily summary version is 4.0
Feb 13 21:30:19 raspberrypi weewxd[17482]: INFO weewx.imagegenerator: Generated 17 images for report SeasonsReport in 0.72 seconds
Feb 13 21:30:19 raspberrypi weewxd[17482]: INFO weewx.reportengine: Copied 5 files to /var/www/html/weewx
Feb 13 21:30:19 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Report 'SmartphoneReport' not enabled. Skipping.
Feb 13 21:30:19 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Report 'MobileReport' not enabled. Skipping.
Feb 13 21:30:19 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Report 'StandardReport' not enabled. Skipping.
Feb 13 21:30:19 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Report 'Belchertown' not enabled. Skipping.
Feb 13 21:30:19 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Report 'FTP' not enabled. Skipping.
Feb 13 21:30:19 raspberrypi weewxd[17482]: DEBUG weewx.reportengine: Report 'RSYNC' not enabled. Skipping.

PYB

vince

unread,
Feb 13, 2024, 3:57:21 PM2/13/24
to weewx-user
On Tuesday, February 13, 2024 at 12:31:54 PM UTC-8 Pierre-Yves wrote:
Weewx and webserver are perfectly working in simulator mode with "sudo systemctl start weewx" command

Good.  That means your problem appears to be related to getting weewx as a non-privileged user to access your RTL-STR hardware.

When running weewx using the Simulator does "ps aux|grep weewxd" show it running as weewxd ?  Or pi ?  Or something else ?

 

Pierre-Yves

unread,
Feb 13, 2024, 4:03:45 PM2/13/24
to weewx-user
Yes
With simulator, ps aux|grep weewxd shows that weewx user exixts...


pi@raspberrypi:~ $ ps aux|grep weewxd
weewx    17482  1.0  1.6  52056 32100 ?        Ss   21:28   0:06 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
pi       19150  0.0  0.0   7460   592 pts/1    S+   21:38   0:00 grep --color=auto weewxd

PY

vince

unread,
Feb 13, 2024, 4:05:10 PM2/13/24
to weewx-user
oops, I meant running as 'weewx' or 'pi' or 'something else'....

The reason I'm asking is that your systemctl log shows a sudo error that means that the account you are trying to use sudo under is not permitted to do so.  The default dpkg installation creates a weewx user and group but does not create a /etc/sudoers.d file for that user.  So the weewx user is not going to be able to sudo if you specify that.

But....you should be able to add the weewx user to the correct group(s) that can access your hardware.  I think there are other threads related to how to do that.

Pierre-Yves

unread,
Feb 13, 2024, 4:14:40 PM2/13/24
to weewx-user
Thanks Vince.
I'll try to find the way to do that

Pierre-Yves

unread,
Feb 13, 2024, 4:49:27 PM2/13/24
to weewx-user
I haven't found any thread related to the creation of weewx user and group...
PY

vince

unread,
Feb 13, 2024, 5:49:36 PM2/13/24
to weewx-user
You want to look for 'rtl' or 'sdr' and adding the weewx user to the appropriate group that has permissions to access the hardware.

https://groups.google.com/g/weewx-user/c/7CIRRoo6Qdk/m/8dwn6EBiAQAJ is one link.   Note that 'plugdev' is correct for that example.  We cannot predict what 'your' system will require.

Pierre-Yves

unread,
Feb 14, 2024, 3:13:48 AM2/14/24
to weewx-user
Thanks Vince

I found in rtl-sdr. rules a rule corresponding to my SDR stick :

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", ENV{ID_SOFTWARE_RADIO}="1", MODE="0660", GROUP="plugdev"

I added the weewx user to that group: "sudo usermod -aG plugdev weewx"

I still can start weewx with the  "sudo weewd" command as before but I can't run weewx in daemon mode. "sudo  systemctl start weewx" gives still the same error :

Feb 14 08:49:54 raspberrypi weewxd[5905]: INFO weewx.engine: Starting main packet loop.
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr:
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr: Nous espérons que vous avez reçu de votre administrateur système local
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr: les consignes traditionnelles. Généralement, elles se concentrent sur ces trois éléments :
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr:
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr:     #1) Respectez la vie privée des autres.
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr:     #2) Réfléchissez avant d'utiliser le clavier.
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr:     #3) De grands pouvoirs confèrent de grandes responsabilités.
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr:
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr: sudo: un terminal est requis pour lire le mot de passe; utilisez soit l'option -S pour lire depuis l'entrée standard ou configurez un outil askpass de demande de mot de passe
Feb 14 08:49:54 raspberrypi weewxd[5905]: ERROR user.sdr: sudo: il est nécessaire de saisir un mot de passe
Feb 14 08:49:54 raspberrypi weewxd[5905]: INFO weewx.engine: Main loop exiting. Shutting engine down.
Feb 14 08:49:54 raspberrypi weewxd[5905]: INFO user.sdr: shutdown process sudo /usr/local/bin/rtl_433 -f 868.3M -f 433.92M -H 90 -Y autolevel -s 1024k -R 173 -R 172 -R 42 -M utc -F json
Feb 14 08:49:54 raspberrypi weewxd[5905]: DEBUG user.sdr: close stdout
Feb 14 08:49:54 raspberrypi weewxd[5905]: DEBUG user.sdr: close stderr
Feb 14 08:49:54 raspberrypi weewxd[5905]: Exception in thread stdout-thread:
Feb 14 08:49:54 raspberrypi weewxd[5905]: DEBUG user.sdr: shutdown stdout-thread
Feb 14 08:49:54 raspberrypi weewxd[5905]: Traceback (most recent call last):
Feb 14 08:49:54 raspberrypi weewxd[5905]: Exception in thread stderr-thread:
Feb 14 08:49:54 raspberrypi weewxd[5905]: Traceback (most recent call last):
Feb 14 08:49:54 raspberrypi weewxd[5905]:   File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Feb 14 08:49:54 raspberrypi weewxd[5905]:   File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Feb 14 08:49:54 raspberrypi weewxd[5905]:     self.run()
Feb 14 08:49:54 raspberrypi weewxd[5905]:   File "/etc/weewx/bin/user/sdr.py", line 198, in run
Feb 14 08:49:54 raspberrypi weewxd[5905]:     self.run()
Feb 14 08:49:54 raspberrypi weewxd[5905]:   File "/etc/weewx/bin/user/sdr.py", line 198, in run
Feb 14 08:49:54 raspberrypi weewxd[5905]:     for line in iter(self._fd.readline, ''):
Feb 14 08:49:54 raspberrypi weewxd[5905]: ValueError: PyMemoryView_FromBuffer(): info->buf must not be NULL
Feb 14 08:49:54 raspberrypi weewxd[5905]: DEBUG user.sdr: shutdown stderr-thread
Feb 14 08:49:54 raspberrypi weewxd[5905]:     for line in iter(self._fd.readline, ''):
Feb 14 08:49:54 raspberrypi weewxd[5905]: ValueError: PyMemoryView_FromBuffer(): info->buf must not be NULL
Feb 14 08:49:54 raspberrypi weewxd[5905]: INFO user.sdr: shutdown complete
Feb 14 08:49:54 raspberrypi weewxd[5905]: CRITICAL __main__: Caught WeeWxIOError: rtl_433 process is not running
Feb 14 08:49:54 raspberrypi weewxd[5905]: CRITICAL __main__:     ****  Waiting 60.0 seconds then retrying...
Feb 14 08:50:03 raspberrypi weewxd[5905]: INFO __main__: Received signal TERM (15).
Feb 14 08:50:03 raspberrypi systemd[1]: Stopping WeeWX...
Feb 14 08:50:03 raspberrypi weewxd[5905]: Traceback (most recent call last):
Feb 14 08:50:03 raspberrypi weewxd[5905]:   File "/usr/share/weewx/weewxd.py", line 166, in main
Feb 14 08:50:03 raspberrypi weewxd[5905]:     engine.run()
Feb 14 08:50:03 raspberrypi weewxd[5905]:   File "/usr/share/weewx/weewx/engine.py", line 204, in run
Feb 14 08:50:03 raspberrypi weewxd[5905]:     for packet in self.console.genLoopPackets():
Feb 14 08:50:03 raspberrypi weewxd[5905]:   File "/etc/weewx/bin/user/sdr.py", line 3316, in genLoopPackets
Feb 14 08:50:03 raspberrypi weewxd[5905]:     raise weewx.WeeWxIOError("rtl_433 process is not running")
Feb 14 08:50:03 raspberrypi weewxd[5905]: weewx.WeeWxIOError: rtl_433 process is not running
Feb 14 08:50:03 raspberrypi weewxd[5905]: During handling of the above exception, another exception occurred:
Feb 14 08:50:03 raspberrypi weewxd[5905]: Traceback (most recent call last):
Feb 14 08:50:03 raspberrypi weewxd[5905]:   File "/usr/share/weewx/weewxd.py", line 265, in <module>
Feb 14 08:50:03 raspberrypi weewxd[5905]:     main()
Feb 14 08:50:03 raspberrypi weewxd[5905]:   File "/usr/share/weewx/weewxd.py", line 193, in main
Feb 14 08:50:03 raspberrypi weewxd[5905]:     time.sleep(wait_time)
Feb 14 08:50:03 raspberrypi weewxd[5905]:   File "/usr/share/weewx/weewxd.py", line 260, in sigTERMhandler
Feb 14 08:50:03 raspberrypi weewxd[5905]:     raise Terminate
Feb 14 08:50:03 raspberrypi weewxd[5905]: __main__.Terminate
Feb 14 08:50:04 raspberrypi systemd[1]: weewx.service: Main process exited, code=exited, status=1/FAILURE
Feb 14 08:50:04 raspberrypi systemd[1]: weewx.service: Failed with result 'exit-code'.
Feb 14 08:50:04 raspberrypi systemd[1]: Stopped WeeWX.


When I start weewx again with "sudo weewxd", ps aux|grep weewxd gives:

pi@raspberrypi:~ $ ps aux|grep weewxd
root      8308  0.3  0.2  13112  4268 pts/1    S+   09:02   0:00 sudo weewxd
root      8309  3.4  0.9  46004 18724 pts/1    Sl+  09:02   0:00 python3 /usr/share/weewx/weewxd.py
pi        8347  0.0  0.0   7460   560 pts/3    S+   09:03   0:00 grep --color=auto weewxd

Here, I am stuck...

Pierre-Yves

Pierre-Yves

unread,
Feb 14, 2024, 3:32:43 AM2/14/24
to weewx-user
To complete the post above, I tested the command : "sudo systemctl restart udev weewx"

ps aux|grep weewxd issues now:

pi@raspberrypi:~ $ ps aux|grep weewxd
weewx    11862  7.0  0.9  46012 18772 ?        Ss   09:26   0:00 python3 /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
pi       11883  0.0  0.0   7460   572 pts/3    S+   09:26   0:00 grep --color=auto weewxd

But weewx still fails to start with the same error...

Dominic Reich

unread,
Feb 14, 2024, 3:33:15 AM2/14/24
to weewx...@googlegroups.com
Hello, i replied inline.
I don't speak french, but it looks like you still have a sudo command
somewhere in your unit file.

Would you please show us the contents of your running unit file

systemctl show -P FragmentPath weewx.service

will get you the path of that file. cat that file and paste it here or
if you are confident remove the sudo statement in there somwhere at
ExecStart...="sudo /usr......"

because you should not need sudo when you added weewx to the plugdev
group.

That file contains usually also the information what user runs the
daemon in the end.
When you run weewx directly with sudo, the password is cached and taken
from the underlying driver to access the device. If the systemd-unit
runs the daemon that password is never entered and it would ask the
systemd-unit to enter it, but you can't cause its not running on your
terminal. Therefore we need to add the running user (weewx) to the right
group so it can access the RTL-SDR device without root privilieges
(sudo).

Hope that makes some sense :D

-dominic
>--
>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/cea6b4c6-5b5f-49f8-b6fc-fa7e317c36ddn%40googlegroups.com.


--
The intelligence consists not only in the knowledge
but also in the skill to apply the knowledge into practice.
- Aristotle

Pierre-Yves

unread,
Feb 14, 2024, 4:02:54 AM2/14/24
to weewx-user
hello Dominic,

Thanks for feedback.

Unfortunately, I don't see any "sudo" in the file "/lib/systemd/system/weewx.service". See below:

# systemd service configuration file for WeeWX

[Unit]
Description=WeeWX
Documentation=https://weewx.com/docs
Requires=time-sync.target
After=time-sync.target
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=weewxd /etc/weewx/weewx.conf
StandardOutput=null
StandardError=journal+console
RuntimeDirectory=weewx
RuntimeDirectoryMode=775
User=weewx
Group=weewx

[Install]
WantedBy=multi-user.target

Pierre-Yves

Pierre-Yves

unread,
Feb 14, 2024, 4:24:55 AM2/14/24
to weewx-user
Just an idea...

Could the problem come from the fact I installed rtl-sdr and rtl_433 prior to install weewx 5.0.2 ?

PY

gjr80

unread,
Feb 14, 2024, 4:30:40 AM2/14/24
to weewx-user
WeeWX is being run just fine, the error is in the [SDR] stanza in weewx.conf. As is often the case the clue is in the log:

Feb 14 08:49:54 raspberrypi weewxd[5905]: INFO user.sdr: shutdown process sudo /usr/local/bin/rtl_433 -f 868.3M -f 433.92M -H 90 -Y autolevel -s 1024k -R 173 - R 172 -R 42 -M utc -F json

Almost certainly the command to run rtl_433 at the cmd setting includes sudo. Remove the sudo and it should be fine.

Gary

Pierre-Yves

unread,
Feb 14, 2024, 5:03:12 AM2/14/24
to weewx-user
Wahoo Gary ! You are a genius ;-) Thanks a lot

I would never have searched the bug here. it works perfectly now.

Thanks to all you guys too, who patiently answered my posts

Pierre-Yves

walter Gross

unread,
Feb 14, 2024, 12:04:36 PM2/14/24
to weewx-user
SOLVED


Hi Matthew

I have spent hours to solve this permission problems on version 5.  I had tested all with a new installation on a sep. SSD. After installing an Apache server and a dummy CMS I get the the same permission errors. Don't ask me why.
Anyway, I fetched the Version 4.10.2 with wget and installed the *.deb,  gave the relevant permissions, uploaded the database to my "running system" and all works fine now. I am a bit anxious to get again problems on a system update, so I marked weewx on hold. Apologize for doing this. Thanks for your help

regards
Walter
Reply all
Reply to author
Forward
0 new messages