OK, with that added, I can run the query confirming I’m affected:
nextcloud:/var/www/html# mysql nextcloud -u nextcloud -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14306
Server version: 10.6.20-MariaDB-ubu2004 mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [nextcloud]> SELECT COUNT(*) FROM oc_filecache WHERE mtime < 86400;
+----------+
| COUNT(*) |
+----------+
| 904 |
+----------+
1 row in set (0.003 sec)
But the script still returns nothing:
nextcloud:/var/www/html# ./solvable_files.sh /var/www/html/data mysql localhost nextcloud nextcloud nextcloud list scan use_birthday verbose
nextcloud:/var/www/html#
Let’s see if adding set +x
to the script tells us anything. Nope, not a thing.
OK, digging further into the script, it starts with a find
command. Let’s try that from the shell:
nextcloud:/var/www/html/data# find . -type f ! -newermt "@86400"
…and it returns nothing. Curious. If I understand the find
manpage correctly, that should find any files with a modification time not newer than (i.e., at or older than) 2 Jan 1970 at 0000Z. And I know there are 904 files for which the database thinks that’s the case.
Well, let’s take a look at some of the files. A bit of poking around to figure out which UUID corresponds to my account leads to this:
nextcloud:/var/www/html/data/9ea222d8-a9c4-1037-923c-01a044b2ff54/files/Photos/2006/05# ls -lh
total 15M
-rw-r--r-- 1 www-data www-data 1.2M Jan 19 2038 06-05-16 03-09-40 E0F4.jpg
-rw-r--r-- 1 www-data www-data 1.2M Jan 19 2038 06-05-16 03-09-46 60AB.jpg
-rw-r--r-- 1 www-data www-data 1.2M Jan 19 2038 06-05-16 03-52-31 93C1.jpg
-rw-r--r-- 1 www-data www-data 1.1M Jan 19 2038 06-05-16 03-53-24 948C.jpg
-rw-r--r-- 1 www-data www-data 1.1M Jan 19 2038 06-05-16 03-54-18 9487.jpg
-rw-r--r-- 1 www-data www-data 1.2M Mar 28 2021 06-05-16 03-54-54 2F48.jpg
-rw-r--r-- 1 www-data www-data 1.1M Jan 19 2038 06-05-16 03-57-34 D66E.jpg
-rw-r--r-- 1 www-data www-data 1.1M Aug 24 2020 06-05-16 03-57-53 E513.jpg
-rw-r--r-- 1 www-data www-data 1.1M Aug 23 2020 06-05-16 03-58-18 816A.jpg
-rw-r--r-- 1 www-data www-data 1.1M Mar 28 2021 06-05-16 03-58-31 CF77.jpg
-rw-r--r-- 1 www-data www-data 1.1M Aug 23 2020 06-05-16 04-01-19 7C37.jpg
-rw-r--r-- 1 www-data www-data 1.1M Aug 23 2020 06-05-16 04-01-30 5650.jpg
-rw-r--r-- 1 www-data www-data 1.2M Aug 23 2020 06-05-16 04-01-38 A441.jpg
Well, the mod date on those files isn’t 1970; it’s 2038. And since I don’t have a time machine, that isn’t very plausible. But unless this is some kind of rollover, it doesn’t represent “before 86400” and thus isn’t found by the find command.