icewind1991 / files_snapshots

Access filesystem snapshots from Nextcloud
40 stars 7 forks source link

filemtime(): stat failed #14

Open Greek64 opened 6 years ago

Greek64 commented 6 years ago

I get ALOT of errors like the following:

filemtime(): stat failed for /storage/nextcloud/nextcloud/data/.zfs/snapshot/zfs-auto-snap_yearly-2017-12-31-2300//JohnD/files/Nextcloud Manual.pdf at /var/www/html/custom_apps/files_snapshots/lib/Snapshot.php#71

After some investigation it turns out that the file that it tries to run "filemtime" for, does not exist in the snapshots that it gets errors for.

My PHP knowledge is almost non existing, but I'm guessing that the filemtime is executed an all snapshots without checking if the relevant file even exists in the snapshot.

Derkades commented 4 years ago

It seems like a bug in the app. The snapshot path is required to have a slash at the end (example /.zfs/snapshot/%snapshot%/ but it seems like it expects it to be without a slash at the end. Because it appends another slash, now there are two slashes: zfs-auto-snap_yearly-2017-12-31-2300//JohnD and for me: /Nextcloud/.zfs/snapshot/zfs-auto-snap_frequent-2019-12-06-1130//Derkades/files/