Hi folks,
I’ve had this issue for a while, but haven’t had the time to triage it until now.
I’m able to update via the CLI, but I get errors when I try to do it from the GUI.
In the logs I’m getting lots of "Permission denied"s - output below.
I always just assumed that I did something wrong when I first span up this LXC in Proxmox - I didn’t originally install in the “pi” user and do had to some chowns to get it working.
However, I just created a new Ubuntu 22.04 LXC. Did my updates, created “pi” user and followed all the instructions on the docs.openenergymonitor scripts page. The install ran successfully, no errors. I was able to create a new user and login. However, when running my first software update via the GUI, I’m met with the same errors.
I compared the user and group for a bunch of these locations - see below.
/var/www/emoncms - drwxr-xr-x 8 root root 13 Mar 9 22:58 .git
/var/www/emoncms/Modules/app - drwxr-xr-x 8 root root 13 Mar 9 22:58 .git
etc
/opt/emoncms/modules/backup - drwxr-xr-x 8 root root 13 Mar 9 22:58 .git
I suspect most of this is root root as when I originally installed I did a “sudo ./main.sh” … when logged in as the “pi” user should this have been run with a sudo?
Starting update via service-runner-update.sh (v3.0) >
Filesystem Size Used Avail Use% Mounted on
rpool/data/subvol-119-disk-0 10G 941M 9.1G 10% /
none 492K 4.0K 488K 1% /dev
tmpfs 48G 0 48G 0% /dev/shm
tmpfs 19G 132K 19G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 9.5G 0 9.5G 0% /run/user/1000
- Could not find emonSD version file
git pull /opt/openenergymonitor/EmonScripts
master
* stable
On branch stable
Your branch is up to date with 'origin/stable'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
install/Mosquitto-PHP/
install/phpredis/
nothing added to commit but untracked files present (use "git add" to track)
Already up to date.
-------------------------------------------------------------
Main Update Script
-------------------------------------------------------------
Date: Sun Mar 9 11:15:10 PM GMT 2025
EUID: 1000
openenergymonitor_dir: /opt/openenergymonitor
type: all
serial_port: ttyUSB0
firmware: none
Traceback (most recent call last):
File "/opt/openenergymonitor/EmonScripts/other/i2cdetect.py", line 2, in <module>
import smbus
ModuleNotFoundError: No module named 'smbus'
Hardware detected: rfm2pi
Reading package lists...
Building dependency tree...
Reading state information...
python3-pip is already the newest version (22.0.2+dfsg-1ubuntu0.5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: redis in /usr/local/lib/python3.10/dist-packages (5.2.1)
Requirement already satisfied: async-timeout>=4.0.3 in /usr/local/lib/python3.10/dist-packages (from redis) (5.0.1)
Running apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists...
Start emonhub update script:
-------------------------------------------------------------
emonHub update
-------------------------------------------------------------
Enabling SPI for RFM69SPI
sed: can't read /boot/config.txt: No such file or directory
EmonHub not found
Start emoncms update:
-------------------------------------------------------------
Update Emoncms Core
-------------------------------------------------------------
Updating /var/www/emoncms
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/var/www/emoncms/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- component updated
-------------------------------------------------------------
Update Emoncms Services
-------------------------------------------------------------
emoncms_mqtt.service already installed
feedwriter.service already installed
service-runner.service already installed
Reloading systemctl deamon
Restarting Services...
- sudo systemctl restart feedwriter.service
--- ActiveState=active ---
- sudo systemctl restart emoncms_mqtt.service
--- ActiveState=active ---
-------------------------------------------------------------
Update Emoncms Modules
-------------------------------------------------------------
Updating /var/www/emoncms/Modules/app
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/var/www/emoncms/Modules/app/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/dashboard
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/var/www/emoncms/Modules/dashboard/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/device
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/var/www/emoncms/Modules/device/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- component updated
Updating /var/www/emoncms/Modules/graph
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/var/www/emoncms/Modules/graph/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- component updated
Updating /opt/emoncms/modules/backup
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/opt/emoncms/modules/backup/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- running module install/update script (user=pi)
- config.cfg already exists, left unmodified
- creating /etc/php/8.1/mods-available/emoncmsbackup.ini
post_max_size = 3G
upload_max_filesize = 3G
upload_tmp_dir = /var/opt/emoncms/backup/uploads
- phpenmod emoncmsbackup
- restarting apache
- component updated
Updating /opt/emoncms/modules/network
- current branch: master
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/opt/emoncms/modules/network/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- running module install/update script (user=pi)
This script must be run as root
Try "sudo /opt/emoncms/modules/network/install.sh"
- component updated
Updating /opt/emoncms/modules/postprocess
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/opt/emoncms/modules/postprocess/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- component updated
Updating /opt/emoncms/modules/sync
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/opt/emoncms/modules/sync/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- running module install/update script (user=pi)
[]
/opt/emoncms/modules/sync/install.sh: line 9: /opt/emoncms/modules/sync/emoncms_sync.service: Permission denied
- installing emoncms_sync.service
mv: cannot stat '/opt/emoncms/modules/sync/emoncms_sync.service': No such file or directory
Failed to enable unit: Unit file emoncms_sync.service does not exist.
Failed to restart emoncms_sync.service: Unit emoncms_sync.service not found.
- Service ActiveState=inactive
- component updated
Updating /opt/emoncms/modules/usefulscripts
- current branch: stable
- local changes: no
error: cannot open .git/FETCH_HEAD: Permission denied
- git fetch:
fatal: Unable to create '/opt/emoncms/modules/usefulscripts/.git/index.lock': Permission denied
- git checkout:
error: cannot open .git/FETCH_HEAD: Permission denied
- git pull:
- database update: no changes
- component updated
-------------------------------------------------------------
System update done: Sun Mar 9 11:15:13 PM GMT 2025
-------------------------------------------------------------
restarting service-runner