Permission denied: '/etc/weewx/weewx.conf.

233 views
Skip to first unread message

Daniel Fourlas

unread,
Mar 23, 2024, 5:26:40 PM3/23/24
to weewx-user
You can register the station on weewx.com, where it will be included in a
map. If you choose to register, you will also need a unique URL to identify
the station (such as a website, or a WeatherUnderground link).
register this station (y/n)? [n] n
Saving configuration file /etc/weewx/weewx.conf
Traceback (most recent call last):
  File "/usr/lib/python3.9/shutil.py", line 806, in move
    os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/etc/weewx/weewx.conf' -> '/etc/weewx/weewx.conf.20240323232454'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weewx/weectl.py", line 74, in <module>
    main()
  File "/usr/share/weewx/weectl.py", line 66, in main
    namespace.func(namespace)
  File "/usr/share/weewx/weectllib/__init__.py", line 121, in dispatch
    namespace.action_func(config_dict, namespace)
  File "/usr/share/weewx/weectllib/station_cmd.py", line 311, in reconfigure_station
    weectllib.station_actions.station_reconfigure(config_dict=config_dict,
  File "/usr/share/weewx/weectllib/station_actions.py", line 183, in station_reconfigure
    backup_path = weecfg.save(config_dict, config_dict['config_path'], not no_backup)
  File "/usr/share/weewx/weecfg/__init__.py", line 224, in save
    backup_path = weeutil.weeutil.move_with_timestamp(config_path)
  File "/usr/share/weewx/weeutil/weeutil.py", line 1697, in move_with_timestamp
    shutil.move(path, newpath)
  File "/usr/lib/python3.9/shutil.py", line 820, in move
    copy_function(src, real_dst)
  File "/usr/lib/python3.9/shutil.py", line 435, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/etc/weewx/weewx.conf.20240323232454'

Tom Keffer

unread,
Mar 23, 2024, 5:42:09 PM3/23/24
to weewx...@googlegroups.com
It looks like you are trying to run "weectl station reconfigure". Is that right? And, you're getting a permissions error.

You didn't say which version of v5.0 you are using, but I'll assume v5.0.2. With this version, all files in /etc/weewx should be owned by user "weewx", group "weewx". Check to make sure that this is so. Here is what I get when I check on an Ubuntu virtual machine:

ubuntu@fit-bushbuck:~$ ls -al /etc/weewx

total 88

drwxrwsr-x 12 weewx weewx  4096 Mar 23 14:33 .

drwxr-xr-x 96 root  root   4096 Mar 23 14:33 ..

drwxrwsr-x  3 weewx weewx  4096 Mar 23 14:33 bin

drwxrwsr-x  8 weewx weewx  4096 Mar 23 14:33 examples

drwxrwsr-x  2 weewx weewx  4096 Mar 23 14:33 import

drwxrwsr-x  2 weewx weewx  4096 Mar 23 14:33 init.d

drwxrwsr-x  2 weewx weewx  4096 Mar 23 14:33 logrotate.d

drwxrwsr-x  4 weewx weewx  4096 Mar 23 14:33 logwatch

drwxrwsr-x  2 weewx weewx  4096 Mar 23 14:33 rsyslog.d

drwxrwsr-x  8 weewx weewx  4096 Mar 23 14:33 skins

drwxrwsr-x  2 weewx weewx  4096 Mar 23 14:33 systemd

drwxrwsr-x  2 weewx weewx  4096 Mar 23 14:33 udev

-rw-rw-r--  1 weewx weewx 19467 Mar 23 14:33 weewx.conf

-rw-rw-r--  1 weewx weewx 19463 Feb  9 23:03 weewx.conf-5.0.2


Note how all files are owned by user "weewx", group "weewx". Because of this, they can be modified by anyone in the group "weewx". The install process makes sure that you are in that group. To check: just type "groups". Here's what I get when I try it in the Ubuntu virtual machine:

ubuntu@fit-bushbuck:~$ groups

ubuntu adm dialout cdrom floppy sudo audio dip video plugdev netdev lxd weewx


Note the user weewx at the end. See if you get something similar. If not, try logging back out, then back in. 

Then try your reconfigure again.

-tk

--
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/c79ed39a-c813-4253-b225-89d8db8dd568n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages