I have now contacted both the maintainer of Nextcloud-AIO and Nextcloud-Memories, and have been suggested to seek help here.
The issue you are facing:
I have a dedicated server, on which I run Nextcloud AIO, Photos, recognize and Memories. In general all works well.
We create a lot of albums in Memories.
All our media is stored on a 2 different NAS, and the folder(s) is mounted into Nextcloud via the External Folders Feature.
I mount the folders via /etc/fstab entry and use SMB/CIFS. The files paths, Never change.
This is the second time it happens, that we have accessed memories, and while I see all the albums, they have ZERO pictures/content in it.
Since files get added externally, I have a periodic cron jobs running Nextcloud files scan, and also memories Index (below).
*/10 * * * * docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-nextcloud$" && docker exec --user www-data nextcloud-aio-nextcloud php occ files:scan --all
*/15 * * * * docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-nextcloud$" && docker exec --user www-data nextcloud-aio-nextcloud php occ memories:index
Everything is connected via lan and 10G switches, My initial guess was, it could be that if there is an intermittent network disconnection Photos/Memories loses all album info, but I can see all photos and videos in the Timeline.
I am thinking that may be if the nextcloud files:scan -all
runs when the network is down, then it removes files, and when they get readded the fileid
changes and therefore I lose all media in Albums?
But the thing is, when i ssh into the server and looked into the server and mounted folder, it did not give me erros like
- stale file handles
, that happens when accessing a mounted folder after network disconnect.
Memories Maintainers view was that -all
should not cause entries to disappear.
Do you think this is normal? will removing -all from files:scan help? Or is there something else i can do?
I don’t experience this issue on a Photoprism instance using the same media repository. (Unused for a while since I moved to Photos/Memories)
Ref chat with Pulsejet:
pulsejet/memories#1287
Also, noticed that all face recognition data is gone as well.
Error i saw is below.
Shows when accessing empty album in Photos, but shows when accessing in Memories.
<html>
<body>
<!--StartFragment-->
Error | index | ExceptionOCA\Photos\Album\AlbumFile::__construct(): Argument #2 ($name) must be of type string, null given, called in /var/www/html/apps/photos/lib/Album/AlbumMapper.php on line 250 in file '/var/www/html/apps/photos/lib/Album/AlbumFile.php' line 32
-- | -- | --
<!--EndFragment-->
</body>
</html>
[/details]
Nextcloud AIO v9.5.1
Nextcloud version (eg, 29.0.5): 29.0.6.1
Operating system and version (eg, Ubuntu 24.04): Ubuntu Server 22.04
Apache or nginx version (eg, Apache 2.4.25): AIO+Nginx-Proxy-Manager
PHP version (eg, 8.3): As with AIO
Is this the first time you’ve seen this error? (Y/N): Second time
Steps to replicate it:
- It’s happened 2nd time in 6 months. I am not sure how to replicate it.
The output of your Nextcloud log in Admin > Logging:
{"reqId":"pehGXv4Du8E6nX4F1bkV","level":3,"time":"2024-09-15T18:35:53+00:00","remoteAddr":"192.168.50.1","user":"bisu","app":"index","method":"GET","url":"/apps/photos/api/v1/preview/15723900?x=512&y=512","message":"OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #2 ($name) must be of type string, null given, called in /var/www/html/apps/photos/lib/Album/AlbumMapper.php on line 250 in file '/var/www/html/apps/photos/lib/Album/AlbumFile.php' line 32","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"29.0.6.1","exception":{"Exception":"Exception","Message":"OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #2 ($name) must be of type string, null given, called in /var/www/html/apps/photos/lib/Album/AlbumMapper.php on line 250 in file '/var/www/html/apps/photos/lib/Album/AlbumFile.php' line 32","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Photos\\Controller\\PreviewController"],"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":331,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Photos\\Controller\\PreviewController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["15723900","photos.preview.index"]]},{"file":"/var/www/html/lib/base.php","line":1058,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/photos/api/v1/preview/15723900"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":170,"Previous":{"Exception":"TypeError","Message":"OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #2 ($name) must be of type string, null given, called in /var/www/html/apps/photos/lib/Album/AlbumMapper.php on line 250","Code":0,"Trace":[{"file":"/var/www/html/apps/photos/lib/Album/AlbumMapper.php","line":250,"function":"__construct","class":"OCA\\Photos\\Album\\AlbumFile","type":"->","args":[0,null,null,0,0,null,1724410830,"bisu"]},{"file":"/var/www/html/apps/photos/lib/Controller/PreviewController.php","line":150,"function":"getForAlbumIdAndFileId","class":"OCA\\Photos\\Album\\AlbumMapper","type":"->","args":[57,15723900]},{"file":"/var/www/html/apps/photos/lib/Controller/PreviewController.php","line":114,"function":"getFileIdForAlbums","class":"OCA\\Photos\\Controller\\PreviewController","type":"->","args":[15723900,[["OCA\\Photos\\Album\\AlbumInfo"]]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"index","class":"OCA\\Photos\\Controller\\PreviewController","type":"->","args":[15723900,512,512]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Photos\\Controller\\PreviewController"],"index"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Photos\\Controller\\PreviewController"],"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":331,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Photos\\Controller\\PreviewController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["15723900","photos.preview.index"]]},{"file":"/var/www/html/lib/base.php","line":1058,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/photos/api/v1/preview/15723900"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/apps/photos/lib/Album/AlbumFile.php","Line":32},"message":"OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #2 ($name) must be of type string, null given, called in /var/www/html/apps/photos/lib/Album/AlbumMapper.php on line 250 in file '/var/www/html/apps/photos/lib/Album/AlbumFile.php' line 32","exception":[],"CustomMessage":"OCA\\Photos\\Album\\AlbumFile::__construct(): Argument #2 ($name) must be of type string, null given, called in /var/www/html/apps/photos/lib/Album/AlbumMapper.php on line 250 in file '/var/www/html/apps/photos/lib/Album/AlbumFile.php' line 32"},"id":"66e7291292559"}