nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
466 stars 57 forks source link

preview:generate-all only running for one user #263

Open ghost opened 3 years ago

ghost commented 3 years ago

If I run the command sudo docker exec -ti --user www-data nextcloud-app /var/www/html/occ preview:generate-all it only runs for a single user out of four (always the same one).

There's nothing I can see in that command that is specifying one user, and if I run the command with a username specified it works for that user (e.g. docker exec -ti --user www-data nextcloud-app /var/www/html/occ preview:generate-all user_1.

Any ideas why it would randomly do this? My old setup (non-docker) used to run this nightly and would do all users. Not sure what happened with it.

Any ideas welcome. I can manually set it for each user to cover me for now, but it's a pain to have to manually adjust this each time.

Debian 11 PHP 8.0 Docker Nextcloud Apache, started with composer MariaDB

DeniGam commented 3 years ago

Thesame issue. Also as I can see in log - it also ignores shared folder (even owned by this user)

Ubuntu Server 20.04 PHP 8.0.13 (cli) (built: Nov 19 2021 21:36:32) Docker Nextcloud Apache, built by dockerfile (just install cron and some other tools), based on official image, started with docker compose. MariaDB

joshtrichards commented 1 year ago

One difference between not specifying any users (and therefore depending on previewgenerator to populate the list of users for the job) versus manually specifying one is that it only runs against users that have logged in at least once. But if you specify a specific user that isn't the case:

https://github.com/nextcloud/previewgenerator/blob/main/lib/Command/Generate.php#LL135

Explanation: callForSeenUsers() is used, which will only return users that have logged in once. When a specific user is specified on the command-line this doesn't happen since get() is used dirctly. I think callForAllUsers() could be swapped in here to cover everybody.

But this being the cause of this reported Issue depends on those users not having lastLogin set in their preferences. I'm not sure offhand which things count as "logins" from NC's perspective (just web UI connects? any successful authentications no matter the path? etc)

marco-calautti commented 1 month ago

The issue still persists.