Search not working after Migration

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

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: 20.5.0
Operating system and version: Debian 10
Apache or nginx version: neweset jwilder nginx
PHP version (eg, 7.4): docker nextcloud

The issue you are facing:

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

Steps to replicate it:

  1. Migrate files to new Server
  2. Import data, database and config into nextcloud docker
  3. try filesearch

The output of your Nextcloud log in Admin > Logging:

[no app in context] Error: OCP\Files\NotFoundException: Node for share not found, fileid: 131165 at <<closure>>

 0. /var/www/html/lib/private/Share20/Share.php line 236
    OC\Share20\Share->getNode()
 1. /var/www/html/apps/files_sharing/lib/SharedStorage.php line 367
    OC\Share20\Share->getNodeType()
 2. <<closure>>
    OCA\Files_Sharing\SharedStorage->getItemType()
 3. /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php line 507
    call_user_func_array([OCA\Files_Shari ... "], [])
 4. /var/www/html/apps/files_sharing/lib/Cache.php line 183
    OC\Files\Storage\Wrapper\Wrapper->__call("getItemType", [])
 5. <<closure>>
    OCA\Files_Sharing\Cache->search("%why do%")
 6. /var/www/html/lib/private/Files/View.php line 1667
    call_user_func_array([OCA\Files_Sharing\Cache {},"search"], ["%why do%"])
 7. /var/www/html/lib/private/Files/View.php line 1599
    OC\Files\View->searchCommon("search", ["%why do%"])
 8. /var/www/html/lib/private/Files/Filesystem.php line 763
    OC\Files\View->search("why do")
 9. /var/www/html/lib/private/Search/Provider/File.php line 47
    OC\Files\Filesystem::search("why do")
10. /var/www/html/apps/files/lib/Search/FilesSearchProvider.php line 120
    OC\Search\Provider\File->search("why do")
11. /var/www/html/lib/private/Search/SearchComposer.php line 162
    OCA\Files\Search\FilesSearchProvider->search(OC\User\User {}, OC\Search\SearchQuery {})
12. /var/www/html/core/Controller/UnifiedSearchController.php line 110
    OC\Search\SearchComposer->search(OC\User\User {}, "files", OC\Search\SearchQuery {})
13. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 169
    OC\Core\Controller\UnifiedSearchController->search("files", "why do", null, null, null, "/apps/files/?dir=/&fileid=6")
14. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OC\Core\Controll ... {}, "search")
15. /var/www/html/lib/private/AppFramework/App.php line 152
    OC\AppFramework\Http\Dispatcher->dispatch(OC\Core\Controll ... {}, "search")
16. /var/www/html/lib/private/Route/Router.php line 309
    OC\AppFramework\App::main("OC\\Core\\Contr ... r", "search", OC\AppFramework\ ... {}, {providerId: "fi ... "})
17. /var/www/html/ocs/v1.php line 88
    OC\Route\Router->match("/ocsapp/search/providers/files/search")
18. /var/www/html/ocs/v2.php line 24
    require_once("/var/www/html/ocs/v1.php")

GET /ocs/v2.php/search/providers/files/search?term=why+do&from=%2Fapps%2Ffiles%2F%3Fdir%3D%2F%26fileid%3D6
from 212.102.35.98 by der_spotter at 2021-02-25T00:01:21+00:00

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

<?php
$CONFIG = array (
  'instanceid' => ---',
  'passwordsalt' => '---',
  'secret' => '---',
  'trusted_domains' => 
  array (
    0 => '---',
    1 => '---',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '20.0.5.2',
  'overwrite.cli.url' => '---',
  'htaccess.RewriteBase' => '/',
  'dbname' => 'nextcloud',
  'dbhost' => 'nc_db',
  'dbport' => '3306',
  'dbtableprefix' => 'oc_',
  'dbuser' => '---',
  'dbpassword' => ---',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'mysql.utf8mb4' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'updater.release.channel' => 'stable',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '---',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpport' => '587',
  'mail_from_address' => '--',
  'mail_domain' => '---',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '---',
  'mail_smtppassword' => '---',
  'mail_smtpsecure' => 'tls',
  'app_install_overwrite' => 
  array (
    0 => 'discoursesso',
  ),
  '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,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => '',
    'port' => 6379,
  ),
);

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

n/a

Please help me. I can’t understand why the filesearch doesn’t work anymore. Emailsearch, search in Deck and Discourse works fine. When I update to 21 Deck also isn’t searchable anymore. I still have the same instance running outside docker on another Debian 9 server with exactly the same data, database and config and everything works fine!

I would really appreciate some help. Does no one else experience this problem?

I am still having this issue and no solution is in sight. I don’t even know where to look…

Is Elasticsearch installed and working on your server?

As root from CLI, what is the output off the following command?
curl http://localhost:9200/_cluster/health?pretty

or on Debian/Ubuntu navigate to the Elasticsearch installation directory:

cd /usr/share/elasticsearch 

and type:

sudo ./bin/elasticsearch --version

If Elasticsearch is not installed take a look here (in German): Volltextsuche mit Nextcloud 20

I don’t think those commands are applicable to docker. At least I can’t run them in my container. As I installed the standard Nextcloud Docker image (tried serveral different vesions and the Dockerfile) I would assume that elasticsearch is part of it. Is there any way I can figure it out through the UI or via Docker?

Unfortunately I am not using docker. But maybe the following links will help you:

Anyway, just search for elasticsearch+docker+Nextcloud and you will find plenty of hints.