OCP\Files\NotFoundException on removed folders

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 16.0.1
Operating system and version (eg, Ubuntu 17.04): Debian 4.9.168
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.3
The issue you are facing:

Getting a NotFoundException on folders that have since long been deleted and cleaned out.

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

Steps to replicate it:

  1. Add a new folder
  2. Remove the folder and refresh
  3. Go to the logs and find the " OCP\Files\NotFoundException" error

The output of your Nextcloud log in Admin > Logging:

[index] Error: OCP\Files\NotFoundException: /user/files/Rent_powerbank at <<closure>>

 0. /var/www/html/lib/private/Files/Node/Folder.php line 134
    OC\Files\Node\Root->get("/user/files/Rent_powerbank")
 1. /var/www/html/apps/recommendations/lib/Service/RecentlySharedFilesSource.php line 122
    OC\Files\Node\Folder->get("/Rent_powerbank")
 2. <<closure>>
    OCA\Recommendations\Service\RecentlySharedFilesSource->OCA\Recommendations\Service\{closure}("*** sensitive parameters replaced ***")
 3. /var/www/html/apps/recommendations/lib/Service/RecentlySharedFilesSource.php line 127
    undefinedundefinedarray_map(Closure {}, ["*** sensitive  ... }])
 4. /var/www/html/apps/recommendations/lib/Service/RecommendationService.php line 91
    OCA\Recommendations\Service\RecentlySharedFilesSource->getMostRecentRecommendation(OC\User\User {}, 6)
 5. <<closure>>
    OCA\Recommendations\Service\RecommendationService->OCA\Recommendations\Service\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/html/apps/recommendations/lib/Service/RecommendationService.php line 92
    undefinedundefinedarray_reduce([OCA\Recommendat ... "], Closure {}, [])
 7. /var/www/html/apps/recommendations/lib/Controller/RecommendationController.php line 63
    OCA\Recommendations\Service\RecommendationService->getRecommendations(OC\User\User {})
 8. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 166
    OCA\Recommendations\Controller\RecommendationController->index()
 9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 99
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Recommendati ... {}, "index")
10. /var/www/html/lib/private/AppFramework/App.php line 126
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Recommendati ... {}, "index")
11. /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\Recommenda ... r", "index", OC\AppFramework\ ... {}, {_route: "recomm ... "})
12. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "recomm ... "})
13. /var/www/html/lib/private/Route/Router.php line 297
    undefinedundefinedcall_user_func(OC\AppFramework\ ... {}, {_route: "recomm ... "})
14. /var/www/html/lib/base.php line 975
    OC\Route\Router->match("/apps/recommend ... s")
15. /var/www/html/index.php line 42
    OC::handleRequest()

GET /apps/recommendations/api/recommendations
from 62.119.168.112 by user at 2019-07-05T07:10:39+00:00

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

<?php
$CONFIG = array (
  'instanceid' => 'REDACTED',
  'passwordsalt' => 'REDACTED',
  'secret' => 'REDACTED',
  'trusted_domains' =>
  array (
    0 => 'nc.hostname.com',
  ),
  'trusted_proxies' =>
  array (
    0 => '192.168.100.100',
  ),
  'overwritehost' => 'nc.hostname.com',
  'overwriteprotocol' => 'https',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'pgsql',
  'version' => '16.0.1.1',
  'overwrite.cli.url' => 'https://nc.hostname.com',
  'dbname' => 'nc',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_user',
  'dbpassword' => 'REDACTED',
  'installed' => true,
  'mail_from_address' => 'noreply',
  'mail_smtpmode' => 'smtp',
  'mail_domain' => 'hostname.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'mail.hostname.com',
  'mail_smtpport' => '25',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'redis' =>
  array (
    'host' => 'redis',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'maintenance' => false,
  'loglevel' => 2,
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'user@hostname.com',
  'mail_smtppassword' => 'REDACTED',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
  'htaccess.RewriteBase' => '/',
  '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,
    ),
  ),
  'theme' => '',
  'data-fingerprint' => 'REDACTED',
  'updater.release.channel' => 'production',
  'updater.secret' => 'REDACTED',
);