FHEM Forum

FHEM => English Corner => Thema gestartet von: okebaja am 17 Januar 2022, 19:12:50

Titel: Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: okebaja am 17 Januar 2022, 19:12:50
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?
Titel: Antw:Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: Otto123 am 17 Januar 2022, 20:02:40
could you please post the complete answer of this command in the FHEM commandline:
list global modpath

Titel: Antw:Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: okebaja am 17 Januar 2022, 20:16:34
Hi Otto123, that is:

global            .

Is that what it's supposed to be?
Titel: Antw:Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: Otto123 am 17 Januar 2022, 20:22:30
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)}}
Titel: Antw:Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: okebaja am 17 Januar 2022, 20:25:12
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/
Titel: Antw:Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: Otto123 am 17 Januar 2022, 21:13:59
which user is running FHEM?
for FHEM commandline:
{qx(whoami)}

for normally the right rights commandline system:
sudo chown -R fhem: /opt/fhem
Titel: Antw:Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: okebaja am 17 Januar 2022, 21:53:39
Vielen Dank! That did the trick! User running was 'fhem', user on the file system was 'dietpi'.
Titel: Antw:Cannot update FHEM: No such file or directory, aborting the update
Beitrag von: yersinia am 18 Januar 2022, 09:30:37
@okebaja:
For couriosity, any reason why you run fhem on dietpi (https://dietpi.com/#download) and not on RaspiOS lite (https://www.raspberrypi.com/software/operating-systems/)? (Assuming that you run it on a raspberry)
I used dietpi first when i installed pihole (https://pi-hole.net/), 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 (https://dietpi.com/stats.html) but is it worth? Would be glad when you share your experience. :)

Edit: the pihole is still on buster