Cannot update FHEM: No such file or directory, aborting the update

Begonnen von okebaja, 17 Januar 2022, 19:12:50

Vorheriges Thema - Nächstes Thema

okebaja

Probably and hopefully a simple question, but I cannot find the answer nor solve it myself: my update process fails since it cannot find a file or folder. Please see this excerpt from my logs:

2022.01.17 19:08:13 1 : UPD ./CHANGED
2022.01.17 19:08:13 1 : copy ././CHANGED ./restoreDir/update/2022-01-17/./CHANGED failed:No such file or directory, aborting the update

I am using FHEM for many years and this was never a problem. Last weekend I had to restore a backup of FHEM and update is not working since, and failing on this error. What am I doing wrong?
Viele Grüße aus Rotterdam, NL
Eltako Funk 14-series EnOcean home automation managed by FHEM @ DietPi @ RaspberryPi 3B+

Otto123

could you please post the complete answer of this command in the FHEM commandline:
list global modpath

Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle

aktives Mitglied des FHEM e.V. (Technik)

okebaja

Hi Otto123, that is:

global            .

Is that what it's supposed to be?
Viele Grüße aus Rotterdam, NL
Eltako Funk 14-series EnOcean home automation managed by FHEM @ DietPi @ RaspberryPi 3B+

Otto123

yes that's ok.
I think this line ... copy ././CHANGED ... is from update modul. It want normally copy the file CHANGED from directory . (which is fhem Homedir)
The path is read from global motdpath.
It looks like the motdpath or the filename is strange.
What gives you:
{qx(find . -name *CHANGED)}}
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle

aktives Mitglied des FHEM e.V. (Technik)

okebaja

That gives:
./restoreDir/update/2022-01-17/CHANGED
./restoreDir/update/2022-01-15/CHANGED
./www/frontend/CHANGED
./CHANGED
./contrib/HMCCU/CHANGED
./contrib/YAF/CHANGED
./contrib/voip2fhem/CHANGED

I am quite sure it has something to do with permissions. The OS user has 777 permissions on CHANGED and on ./restoreDir. During the process CHANGED is copied to the restoreDir/update/2022-01-17 directory, however, it is not authorised to read it.

File permissions of CHANGED:
364K -rw-r--r-- 1 fhem   364K Jan 17 20:19 CHANGED

Is the user correct? The rest of the installation has my OS user as user:
dietpi@BrightPi:/opt$ ls -lsa
total 16K
4.0K drwxr-xr-x  4 root   4.0K Jan 16 12:53 ./
4.0K drwxr-xr-x 21 root   4.0K Jul 10  2020 ../
4.0K drwxr-xr-x 13 dietpi 4.0K Jan 17 20:02 fhem/
Viele Grüße aus Rotterdam, NL
Eltako Funk 14-series EnOcean home automation managed by FHEM @ DietPi @ RaspberryPi 3B+

Otto123

which user is running FHEM?
for FHEM commandline:
{qx(whoami)}

for normally the right rights commandline system:
sudo chown -R fhem: /opt/fhem
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle

aktives Mitglied des FHEM e.V. (Technik)

okebaja

Vielen Dank! That did the trick! User running was 'fhem', user on the file system was 'dietpi'.
Viele Grüße aus Rotterdam, NL
Eltako Funk 14-series EnOcean home automation managed by FHEM @ DietPi @ RaspberryPi 3B+

yersinia

#7
@okebaja:
For couriosity, any reason why you run fhem on dietpi and not on RaspiOS lite? (Assuming that you run it on a raspberry)
I used dietpi first when i installed pihole, but every second dietpi update screwed up the pihole install. Since I moved to RaspiOs lite I never had such issues anymore - it also survived the upgrade path stretch->buster->bullseye.
I see the stats but is it worth? Would be glad when you share your experience. :)

Edit: the pihole is still on buster
viele Grüße, yersinia
----
FHEM 6.4 (SVN) on RPi 4B with RasPi OS Trixie (perl 5.40.1) | FTUI
nanoCUL->2x868(1x ser2net)@tsculfw, 1x433@Sduino | MQTT2 | Tasmota | ESPEasy
VCCU->14xSEC-SCo, 7xCC-RT-DN, 5xLC-Bl1PBU-FM, 3xTC-IT-WM-W-EU, 1xPB-2-WM55, 1xLC-Sw1PBU-FM, 1xES-PMSw1-Pl