nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
590 stars 62 forks source link

sync-albums crash when no UserID supplied #1887

Open xkill opened 1 year ago

xkill commented 1 year ago

Describe the bug When you run the command to sync-albums without providing an userID, it crash. The help mentions that if no userID it will sync all users.

  -u, --user_id=USER_ID  Sync albums for a given user only. If not given, sync albums for all users.

Crash:

# occ face:sync-albums 
Synchronizing albums for the user <>. An unhandled exception has been thrown:
TypeError: OCA\FaceRecognition\Helper\PhotoAlbums::syncUser(): Argument #1 ($userId) must be of type string, null given, called in /srv/http/nextcloud/apps/facerecognition/lib/Command/SyncAlbumsCommand.php on line 119 and defined in /srv/http/nextcloud/apps/facerecognition/lib/Helper/PhotoAlbums.php:67
Stack trace:
#0 /srv/http/nextcloud/apps/facerecognition/lib/Command/SyncAlbumsCommand.php(119): OCA\FaceRecognition\Helper\PhotoAlbums->syncUser()
#1 /srv/http/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\FaceRecognition\Command\SyncAlbumsCommand->execute()
#2 /srv/http/nextcloud/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#3 /srv/http/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#4 /srv/http/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#5 /srv/http/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#6 /srv/http/nextcloud/console.php(100): OC\Console\Application->run()
#7 /srv/http/nextcloud/occ(11): require_once('...')
#8 {main}

To Reproduce Steps to reproduce the behavior:

  1. Run occ with face:sync-album command without providing a user_id

Expected behavior Run sync-album looping over all the users

Additional context NC 27 (if not tested in NC 25 or 26 as I just discovered the functionality). Ubuntu 22.04.2 LTS (Jammy)

Hainer1 commented 1 year ago

I have the same issue on NC 26.0.2 with the same error message. I expected: Run sync-album looping over all the users

joshtrichards commented 1 year ago

This isn't a Photos app issue, but looks like it was addressed in the latest release of the third-party FaceRecognition app.

See matiasdelellis/facerecognition/issues/634 and close out this issue here. Thanks!