Problems with Maps app photo scan & external CIFS storages

Nextcloud version (eg, 29.0.5): 28.0.5
Operating system and version (eg, Ubuntu 24.04): Debian bullseye
Apache or nginx version (eg, Apache 2.4.25): 2.4.62
PHP version (eg, 8.3): 8.1.18

The issue you are facing:

Hi all,

I’m having a major problem with the Maps app scan for new photos. I’m running Nextcloud 28.0.5 on a Raspberry Pi 4 w/8GB memory. It’s been up and running for several years with multiple updates over time and minimal issues. I have several external storages attached using CIFS/SMB from a Synology NAS server, and I can access them with no problems and reasonable performance from the NC Files app. I ran an OCC Maps scan for all photos and it’s been running for several days now and it always shows me the same message whenever I go to the Maps app - ‘0 of 38985 new photos. This might take a while’. However I now also have several thousands of errors showing up in my log (see below) that seem to indicate issues with it accessing the external storage. I ran a monitor to verify that it wasn’t a system resource problem - CPU, memory and network utilization on my RPi NC system were all consistently below 50% over several hours while new errors continued to show up in the log. I also checked the performance of my Synology NAS device and while it had occasional peaks of 75% or so I saw adequate performance on other shares it’s serving. I also manually mounted a test CIFS share on my Nextcloud host and ran a dd to read a file from the share and it consistently provided around 20MB/s. I have both the PHP smbclient and the regular SMB client installed.

Requests:

  • How can I terminate the OCC Maps photo scan background job?
  • Any suggestions for addressing the errors and running a successful Maps photo scan?
  • Is there a way to limit what folders/storages the Maps app scans for photos? All of my photos are under a single folder on one of the shares.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Attach external storage using CIFS
  2. Run a Maps full photo scan

The output of your Nextcloud log in Admin > Logging:

Error	core	
StorageNotAvailableException
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1885650 [userId] => Field User 1 ) )

Sep 13, 2024, 7:29:08 AM	

Error	no app in context	
ConnectionRefusedException
Error while opening file
Error while opening file

Sep 13, 2024, 7:29:08 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1885704 [userId] => Field User 1 ) )

Sep 13, 2024, 7:29:08 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 7:29:08 AM	

Error	PHP	
TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#54

Sep 13, 2024, 7:28:47 AM	

Error	core	
InvalidTokenException
Token does not exist: edeb84faa1a737ac41daa837be37348e1a2730837c86da113ddc787302b7b26e54f32ef876ce0d9a0ea4e20e8a6da74beee57823628ebce5ea93bde77c2b8ee9
Renewing session token failed: Token does not exist: edeb84faa1a737ac41daa837be37348e1a2730837c86da113ddc787302b7b26e54f32ef876ce0d9a0ea4e20e8a6da74beee57823628ebce5ea93bde77c2b8ee9

Sep 13, 2024, 7:28:47 AM	

Error	core	
StorageNotAvailableException
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1885810 [userId] => Field User 1 ) )

Sep 13, 2024, 7:26:33 AM	

Error	no app in context	
ConnectionRefusedException
Error while opening file
Error while opening file

Sep 13, 2024, 7:26:33 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1885720 [userId] => Field User 1 ) )

Sep 13, 2024, 7:26:33 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 7:26:33 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1885670 [userId] => Field User 1 ) )

Sep 13, 2024, 7:26:33 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 7:26:33 AM	

Error	core	
StorageAuthException
Storage unauthorized. Unknown error
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1885621 [userId] => Field User 1 ) )

Sep 13, 2024, 7:22:42 AM	

Error	no app in context	
ConnectException
Unknown error
Error while getting file info

Sep 13, 2024, 7:22:42 AM	

Error	core	
StorageAuthException
Storage unauthorized. Unknown error
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1885672 [userId] => Field User 1 ) )

Sep 13, 2024, 7:22:42 AM

[Thousands more like these...]

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '*****',
  'secret' => '*****',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    7 => 'nextcloudpi',
    5 => 'nextcloudpi.local',
    8 => 'nextcloudpi.lan',
    3 => 'nextcloudpi',
    11 => '****',
    1 => '192.168.1.58',
    14 => 'nextcloudpi',
    20 => 'local',
    21 => '****',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.5.1',
  'overwrite.cli.url' => 'https://nextcloudpi/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '****',
  'dbpassword' => '****',
  'installed' => true,
  'instanceid' => 'ocqhf0oh40r2',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '',
  ),
  'tempdirectory' => '/var/www/nextcloud/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '****',
  'mail_domain' => '****',
  'preview_max_x' => NULL,
  'preview_max_y' => NULL,
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'trusted_proxies' => 
  array (
    11 => '127.0.0.1',
    12 => '::1',
  ),
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
    0 => 'Users',
  ),
  'maintenance' => false,
  'preview_max_memory' => 1024,
  'preview_max_filesize_image' => 200,
  'theme' => '',
  'loglevel' => 2,
  'mail_sendmailmode' => 'smtp',
  'session_timeout' => 6000,
);

The output of your Apache/nginx/system log in /var/log/____:

[Fri Sep 13 00:00:01.330494 2024] [ssl:warn] [pid 1507:tid 1507] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Sep 13 00:00:01.330894 2024] [ssl:error] [pid 1507:tid 1507] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=fv-az504-71 / issuer: CN=fv-az504-71 / serial: 327BBA51C67A8AB40811E2BF0D7D9195CB7139EB / notbefore: Oct  3 22:08:25 2022 GMT / notafter: Sep 30 22:08:25 2032 GMT]
[Fri Sep 13 00:00:01.330960 2024] [ssl:error] [pid 1507:tid 1507] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Fri Sep 13 00:00:01.335440 2024] [mpm_event:notice] [pid 1507:tid 1507] AH00489: Apache/2.4.62 (Debian) OpenSSL/1.1.1w configured -- resuming normal operations
[Fri Sep 13 00:00:01.335481 2024] [core:notice] [pid 1507:tid 1507] AH00094: Command line: '/usr/sbin/apache2'
[Fri Sep 13 00:14:03.663973 2024] [authz_core:error] [pid 653891:tid 653957] [client 184.105.247.196:30762] AH01630: client denied by server configuration: /var/www/ncp-web/
[Fri Sep 13 00:14:24.113212 2024] [authz_core:error] [pid 653891:tid 653948] [client 184.105.247.196:57492] AH01630: client denied by server configuration: /var/www/ncp-web/
[Fri Sep 13 01:44:36.743627 2024] [authz_core:error] [pid 653893:tid 653995] [client 35.160.44.223:47600] AH01630: client denied by server configuration: /var/www/ncp-web/
[Fri Sep 13 06:13:57.401127 2024] [authz_host:error] [pid 653893:tid 653985] [client 165.154.163.199:58492] AH01753: access check of 'localhost' to / failed, reason: unable to get the remote host name
[Fri Sep 13 06:13:57.401864 2024] [authz_core:error] [pid 653893:tid 653985] [client 165.154.163.199:58492] AH01630: client denied by server configuration: /var/www/ncp-web/
[Fri Sep 13 06:14:02.650556 2024] [authz_host:error] [pid 653891:tid 653976] [client 165.154.163.199:54896] AH01753: access check of 'localhost' to /favicon.ico failed, reason: unable to get the remote host name
[Fri Sep 13 06:14:02.650668 2024] [authz_core:error] [pid 653891:tid 653976] [client 165.154.163.199:54896] AH01630: client denied by server configuration: /var/www/ncp-web/favicon.ico
[Fri Sep 13 06:14:02.902179 2024] [authz_host:error] [pid 653893:tid 653996] [client 165.154.163.199:54910] AH01753: access check of 'localhost' to /robots.txt failed, reason: unable to get the remote host name
[Fri Sep 13 06:14:02.902258 2024] [authz_core:error] [pid 653893:tid 653996] [client 165.154.163.199:54910] AH01630: client denied by server configuration: /var/www/ncp-web/robots.txt
[Fri Sep 13 06:14:03.162969 2024] [authz_host:error] [pid 653893:tid 653993] [client 165.154.163.199:54924] AH01753: access check of 'localhost' to /sitemap.xml failed, reason: unable to get the remote host name
[Fri Sep 13 06:14:03.163045 2024] [authz_core:error] [pid 653893:tid 653993] [client 165.154.163.199:54924] AH01630: client denied by server configuration: /var/www/ncp-web/sitemap.xml
[Fri Sep 13 08:03:50.977464 2024] [authz_core:error] [pid 653893:tid 653950] [client 87.236.176.205:33603] AH01630: client denied by server configuration: /var/www/ncp-web/

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893510 [userId] => Field User 1 ) )

Sep 13, 2024, 8:17:10 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 8:17:10 AM	

Error	core	
StorageNotAvailableException
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893641 [userId] => Field User 1 ) )
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893641 [userId] => Field User 1 ) )

Sep 13, 2024, 8:17:10 AM	

Error	no app in context	
ConnectionRefusedException
Error while opening file
Error while opening file

Sep 13, 2024, 8:17:10 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893669 [userId] => Field User 1 ) )

Sep 13, 2024, 8:17:10 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 8:17:10 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893467 [userId] => Field User 1 ) )

Sep 13, 2024, 8:14:57 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 8:14:56 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893633 [userId] => Field User 1 ) )

Sep 13, 2024, 8:14:56 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 8:14:56 AM	

Error	core	
StorageNotAvailableException
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893766 [userId] => Field User 1 ) )
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893766 [userId] => Field User 1 ) )

Sep 13, 2024, 8:14:27 AM	

Error	no app in context	
ConnectionRefusedException
Error while opening file
Error while opening file

Sep 13, 2024, 8:14:27 AM	

Error	core	
StorageNotAvailableException
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893707 [userId] => Field User 1 ) )
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893707 [userId] => Field User 1 ) )

Sep 13, 2024, 8:14:27 AM	

Error	no app in context	
ConnectionRefusedException
Error while opening file
Error while opening file

Sep 13, 2024, 8:14:27 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893691 [userId] => Field User 1 ) )

Sep 13, 2024, 8:10:00 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893552 [userId] => Field User 1 ) )

Sep 13, 2024, 8:10:00 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 8:10:00 AM	

Error	no app in context	
ConnectionRefusedException
Error while getting file info
Error while getting file info

Sep 13, 2024, 8:10:00 AM	

Error	core	
StorageAuthException
Storage unauthorized.
Error while running background job (class: OCA\Maps\BackgroundJob\AddPhotoJob, arguments: Array ( [photoId] => 1893580 [userId] => Field User 1 ) )

Sep 13, 2024, 8:09:34 AM

p.s. I checked the logs on my Synology and it shows all of the incoming NextCloud access requests as successful.

Nextcloud Pi (NextcloudPi) does support external CIFS/SMB storage. Here are the key points about configuring external CIFS storage in NextcloudPi:

  • External storage support needs to be enabled in Nextcloud. This can be done through the Apps page in the Nextcloud admin interface.
  • The SMB client needs to be installed on the system. For Debian-based systems like Raspberry Pi OS

When I said ‘External’ I meant NC External storage - I have the External store app installed and SMB installed.