Occ files:scan error Path not found for all users

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 29.0.8.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Fedora Linux 40 (Server Edition)
  • Web server and version (e.g, Apache 2.4.25):
    • could not find it (container name nextcloud/aio-apache:latest)
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • not in use
  • PHP version (e.g, 8.3):
    • PHP 8.2.25 (cli)
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • after unmounting the file storage, adding files and remounting the storage.
  • Installation method (e.g. AIO, NCP, Bare Metal/Archive, etc.)
    • replace me
  • Are you using Cloudflare, mod_security, or similar? (Yes / No)
    • AIO

Summary of the issue you are facing:

I have the nextcloud aio docker running, the data is on an external hard drive. I had to add a lot of data yesterday, and therefore unmounted the ssd, copied the files to ssd, remounted it and edited the permissions.

For a test, before all the action, I added a test folder and occ files:scan --all worked perfectly fine.

However, now after remounting the ssd, I get the error

Starting scan for user 1 out of 6 (admin)
Path not found: User folder /mnt/ncdata/admin/ exists in cache but not on disk

for every user, except one (where i added the data to, he is called ‘user’ in the logs). However, the user data is not shown on my phone app anymore.

the output at the end was

+---------+-------+-----+---------+---------+--------+--------------+
| Folders | Files | New | Updated | Removed | Errors | Elapsed time |
+---------+-------+-----+---------+---------+--------+--------------+
| 1       | 0     | 0   | 0       | 4      | 5      | 00:00:21     |
+---------+-------+-----+---------+---------+--------+--------------+

The user data is, and always was, in /mnt/ncdata/nextcloud/username/ and also the .ocdata file is in this folder. I tried to chance the config in var/www/html/config/config.php but obviously this only yield more errors and no solution.

I can not get to the root of the problem by myself and appreciate any help.
Please ask if any information is missing, i tried to collect as much as i could that semed relevant to me.

Steps to replicate it (hint: details matter!):

I can not try to replicate it.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{"reqId":"v8BK3DYqG2274YtxghCa","level":3,"time":"2024-11-19T09:36:06+00:00","remoteAddr":"","user":"--","app":"richdocuments","method":"","url":"--","message":"Failed to fetch capabilities: Could not create path \"/appdata_ockmf4mcv1hf/richdocuments/remoteData/capabilities\"","userAgent":"--","version":"29.0.8.1","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create path \"/appdata_ockmf4mcv1hf/richdocuments/remoteData/capabilities\"","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/SimpleFS/SimpleFolder.php","line":89,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->","args":["capabilities","{\"convert-to\":{\"available\":false},\"hasMobileSupport\":true,\"hasProxyPrefix\":false,\"hasTemplateSaveAs\":false,\"hasTemplateSource\":true,\"hasWASMSupport\":false,\"hasZoteroSupport\":true,\"productName\":\"Collabora Online Development Edition\",\"productVersion\":\"24.04.8.1\",\"productVersionHash\":\"8475197\",\"serverId\":\"5ce666e1\"}"]},{"file":"/var/www/html/custom_apps/richdocuments/lib/Service/CachedRequestService.php","line":78,"function":"newFile","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->","args":["capabilities","{\"convert-to\":{\"available\":false},\"hasMobileSupport\":true,\"hasProxyPrefix\":false,\"hasTemplateSaveAs\":false,\"hasTemplateSource\":true,\"hasWASMSupport\":false,\"hasZoteroSupport\":true,\"productName\":\"Collabora Online Development Edition\",\"productVersion\":\"24.04.8.1\",\"productVersionHash\":\"8475197\",\"serverId\":\"5ce666e1\"}"]},{"file":"/var/www/html/custom_apps/richdocuments/lib/Backgroundjobs/ObtainCapabilities.php","line":52,"function":"fetch","class":"OCA\\Richdocuments\\Service\\CachedRequestService","type":"->","args":[]},{"file":"/var/www/html/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OCA\\Richdocuments\\Backgroundjobs\\ObtainCapabilities","type":"->","args":[null]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":102,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->","args":[["OC\\BackgroundJob\\JobList"]]},{"file":"/var/www/html/lib/public/BackgroundJob/TimedJob.php","line":92,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[["OC\\BackgroundJob\\JobList"]]},{"file":"/var/www/html/cron.php","line":177,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->","args":[["OC\\BackgroundJob\\JobList"]]}],"File":"/var/www/html/lib/private/Files/Node/Folder.php","Line":197,"message":"Failed to fetch capabilities: Could not create path \"/appdata_ockmf4mcv1hf/richdocuments/remoteData/capabilities\"","exception":[],"CustomMessage":"Failed to fetch capabilities: Could not create path \"/appdata_ockmf4mcv1hf/richdocuments/remoteData/capabilities\""},"id":"673c641c419bf"}
{"reqId":"v8BK3DYqG2274YtxghCa","level":3,"time":"2024-11-19T09:36:06+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file_put_contents(/mnt/ncdata/appdata_ockmf4mcv1hf/richdocuments/remoteData/discovery): Failed to open stream: I/O error at /var/www/html/lib/private/Files/Storage/Local.php#339","userAgent":"--","version":"29.0.8.1","data":{"app":"PHP"},"id":"673c641c418e7"}
{"reqId":"4QLkEXlPFGCAFyBev1nw","level":3,"time":"2024-11-19T08:22:52+00:00","remoteAddr":"193.81.122.140","user":"user","app":"index","method":"GET","url":"/index.php/avatar/user/512","message":"Exception thrown: OCP\\Files\\GenericFileException","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.2","version":"29.0.8.1","exception":{"Exception":"OCP\\Files\\GenericFileException","Message":"","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/SimpleFS/SimpleFile.php","line":74,"function":"getContent","class":"OC\\Files\\Node\\File","type":"->","args":[]},{"file":"/var/www/html/lib/public/AppFramework/Http/FileDisplayResponse.php","line":70,"function":"getContent","class":"OC\\Files\\SimpleFS\\SimpleFile","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":241,"function":"callback","class":"OCP\\AppFramework\\Http\\FileDisplayResponse","type":"->","args":[["OC\\AppFramework\\Http\\Output"]]},{"file":"/var/www/html/lib/private/Route/Router.php","line":331,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Core\\Controller\\AvatarController","getAvatar",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["user","512","core.avatar.getavatar"]]},{"file":"/var/www/html/lib/base.php","line":1058,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/avatar/user/512"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/Node/File.php","Line":56,"message":"","exception":[],"CustomMessage":"Exception thrown: OCP\\Files\\GenericFileException"},"id":"673c641c45653"}
{"reqId":"nCK0RmwFAdvsA4mFKYAX","level":3,"time":"2024-11-19T08:15:01+00:00","remoteAddr":"193.81.122.140","user":"user","app":"PHP","method":"GET","url":"/ocs/v2.php/cloud/user?format=json","message":"opendir(/mnt/ncdata/user/cache): Failed to open directory: I/O error at /var/www/html/lib/private/Files/Storage/Local.php#164","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.29.2","version":"29.0.8.1","data":{"app":"PHP"},"id":"673c641c4569d"}

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

It is not related to a web interface

Web server / Reverse Proxy

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

no logs available at /var/log/...

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

<?php                                        
$CONFIG = array (                               
  'one-click-instance' => true,                                      
  'one-click-instance.user-limit' => 100,                            
  'memcache.local' => '\\OC\\Memcache\\APCu',       
  'apps_paths' =>                                                    
  array (                                                          
    0 =>                                                                                   
    array (                                                      
      'path' => '/var/www/html/apps',                                
      'url' => '/apps',                            
      'writable' => false,                                           
    ),                                               
    1 =>                                                             
    array (                                                          
      'path' => '/var/www/html/custom_apps',                     
      'url' => '/custom_apps',                       
      'writable' => true,                                            
    ),                                                               
  ),                                                                 
  'check_data_directory_permissions' => false,                                             
  'memcache.distributed' => '\\OC\\Memcache\\Redis',                 
  'memcache.locking' => '\\OC\\Memcache\\Redis',                     
  'redis' =>                                                         
  array (                                                                       
    'host' => 'nextcloud-aio-redis',                                 
    'password' => '** REMOVED **',
    'port' => 6379,                                                                        
  ),                                                                                       
  'overwritehost' => '** REMOVED **',                                        
  'overwriteprotocol' => 'https',                                    
  'passwordsalt' => '** REMOVED **',                                      
  'secret' => '** REMOVED **',    
  'trusted_domains' =>                                          
  array (                                                       
    0 => 'localhost',                                                
    1 => '** REMOVED **',                                                    
  ),                                                                            
  'datadirectory' => '/mnt/ncdata',                                  
  'dbtype' => 'pgsql',                                               
  'version' => '29.0.8.1',                                           
  'overwrite.cli.url' => '** REMOVED **',                           
  'dbname' => 'nextcloud_database',                                  
  'dbhost' => 'nextcloud-aio-database:5432',                                               
  'dbport' => '',                                                               
  'dbtableprefix' => 'oc_',                                                     
  'dbuser' => 'oc_nextcloud',                                                   
  'dbpassword' => '** REMOVED **',
  'installed' => true,                                                          
  'instanceid' => 'ockmf4mcv1hf',                 
  'maintenance' => false,               
 $CONFIG = array (                                                    
  'one-click-instance' => true,                                      
  'one-click-instance.user-limit' => 100,                            
  'memcache.local' => '\\OC\\Memcache\\APCu',                        
  'apps_paths' =>                                                    
  array (                                                            
    0 =>                                                             
    array (                                                          
      'path' => '/var/www/html/apps',                                
      'url' => '/apps',                                                                    
      'writable' => false,                                           
    ),                                                               
    1 =>                                                             
    array (                                                                     
      'path' => '/var/www/html/custom_apps',                         
      'url' => '/custom_apps',                                       
      'writable' => true,                                                                  
    ),                                                                                     
  ),                                                                                       
  'check_data_directory_permissions' => false,                       
  'memcache.distributed' => '\\OC\\Memcache\\Redis',                                       
  'memcache.locking' => '\\OC\\Memcache\\Redis',                     
  'redis' =>                                                         
  array (                                                            
    'host' => 'nextcloud-aio-redis',                                 
    'password' => '** REMOVED **',                      
    'port' => 6379,                                                             
  ),                                                                 
  'overwritehost' => '** REMOVED **',                  
  'overwriteprotocol' => 'https',                                    
  'passwordsalt' => '** REMOVED **',                                      
  'secret' => '** REMOVED **',    
  'trusted_domains' =>                                                                     
  array (                                                                       
    0 => 'localhost',                                                           
    1 => '** REMOVED **',                                         
  ),                                                                 
  'datadirectory' => '/mnt/ncdata',                                             
  'dbtype' => 'pgsql',                                               
  'version' => '29.0.8.1',                     
  'overwrite.cli.url' => '** REMOVED **/',     
  'dbname' => 'nextcloud_database',                                  
  'dbhost' => 'nextcloud-aio-database:5432',                         
  'dbport' => '',                                                    
  'dbtableprefix' => 'oc_',                                          
  'dbuser' => 'oc_nextcloud',                                                              
  'dbpassword' => '** REMOVED **',
  'installed' => true,                                               
  'instanceid' => 'ockmf4mcv1hf',                                    
  'maintenance' => false,                                            
  'loglevel' => 2,                                                   
  'log_type' => 'file',                                              
  'logfile' => '/var/www/html/data/nextcloud.log',                   
  'log_rotate_size' => 10485760,                                     
  'log.condition' =>                                                 
  array (                                                            
    'apps' =>                                                        
    array (                                                          
      0 => 'admin_audit',                                                                  
    ),                                                               
  ),                                                                 
  'preview_max_x' => 2048,                                           
  'preview_max_y' => 2048,                                                      
  'jpeg_quality' => 60,                                              
  'enabledPreviewProviders' =>                                       
  array (                                                                                  
    1 => 'OC\\Preview\\Image',                                                             
    2 => 'OC\\Preview\\MarkDown',                                                          
    3 => 'OC\\Preview\\MP3',                                         
    4 => 'OC\\Preview\\TXT',                                                               
    5 => 'OC\\Preview\\OpenDocument',                                
    6 => 'OC\\Preview\\Movie',                                       
    7 => 'OC\\Preview\\Krita',                                       
    0 => 'OC\\Preview\\Imaginary',                                   
  ),                                                                                       
  'enable_previews' => true,                                                    
  'upgrade.disable-web' => true,                                     
  'mail_smtpmode' => 'smtp',                                         
  'trashbin_retention_obligation' => 'auto, 30',                     
  'versions_retention_obligation' => 'auto, 30',                                           
  'activity_expire_days' => 30,                                      
  'simpleSignUpLink.shown' => false,                                                       
  'share_folder' => '/Shared',                                                  
  'one-click-instance.link' => 'https://nextcloud.com/all-in-one/',             
  'upgrade.cli-upgrade-link' => 'https://github.com/nextcloud/all-in-one/discussions/2726',
  'updatedirectory' => '/nc-updater',                                                      
  'maintenance_window_start' => 100,                                                       
  'allow_local_remote_servers' => true,       
  'davstorage.request_timeout' => 3600,                                                    
  'htaccess.RewriteBase' => '/',                                                           
  'dbpersistent' => false,                                                                 
  'auth.bruteforce.protection.enabled' => true,                                            
  'ratelimit.protection.enabled' => true,                                                  
  'files_external_allow_create_new_local' => false,                                        
  'trusted_proxies' =>                                                                     
  array (                                                                                  
    0 => '127.0.0.1',                                                                      
    1 => '::1',                                                                            
    10 => '172.18.0.0/16',                                                                 
  ),                                                                                       
  'preview_imaginary_url' => 'http://nextcloud-aio-imaginary:9000',                        
  'preview_imaginary_key' => '** REMOVED **',           
);                                   

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 2.21.1
  - admin_audit: 1.19.0
  - calendar: 4.7.16
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contacts: 6.0.0
  - contactsinteraction: 1.10.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - deck: 1.13.2
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.1
  - files_downloadlimit: 2.0.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - nextcloud-aio: 0.6.0
  - nextcloud_announcements: 1.18.0
  - notes: 4.11.0
  - notifications: 2.17.0
  - notify_push: 0.7.0
  - oauth2: 1.17.1
  - password_policy: 1.19.0
  - photos: 2.5.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - richdocuments: 8.4.8
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - spreed: 19.0.11
  - support: 1.12.0
  - survey_client: 1.17.0
  - systemtags: 1.19.0
  - tasks: 0.16.1
  - text: 3.10.1
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_totp: 11.0.0-dev
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - whiteboard: 1.0.4
  - workflowengine: 2.11.0
Disabled:
  - bruteforcesettings: 2.9.0
  - encryption: 2.17.0
  - files_external: 1.21.0
  - suspicious_login: 7.0.0
  - user_ldap: 1.20.0

The problem disappeared overnight (I have no idea how, though) , and all files are visible on all clients now.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.