nextcloud / nextcloud/fulltextsearch

Not working on NC 21

Open
#614 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
234
Forks
64
Avg merge
6h 18m
Merged PRs (30d)
10

Description

The current version does appear in the menu bar, but always returns nothing found. When my cronjob gets executed it throws a wrning:
Private methods cannot be final as they are never overridden by other classes in /path/to/cloud/lib/private/FullTextSearch/Model/IndexDocument.php, line 725.

Also Elasticsearch returns an error repeatedly:

Errors ```output {"reqId":"YEnOlw6jH8HBeU8UagTt6wAAAJE","level":3,"time":"2021-03-11T08:02:31+00:00","remoteAddr":"2003:df:4f30:400:4d9f:b389:f806:d58a","user":"TheColin21","app":"PHP","method":"GET","url":"/index.php/apps/fulltextsearch/v1/search?request=%7B%22providers%22%3A%5B%22files%22%5D%2C%22options%22%3A%7B%22files_local%22%3A%220%22%2C%22files_extension%22%3A%22%22%7D%2C%22search%22%3A%22willy%22%2C%22page%22%3A1%7D","message":{"Exception":"Error","Message":"Elasticsearch\\Connections\\Connection::Elasticsearch\\Connections\\{closure}(): Argument #2 ($key) must be passed by reference, value given at /path/to/cloud/apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php#358","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/path/to/cloud/apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php","line":358,"function":"array_walk"},{"file":"/path/to/cloud/apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php","line":218,"function":"getURI","class":"Elasticsearch\\Connections\\Connection","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php","line":110,"function":"performRequest","class":"Elasticsearch\\Connections\\Connection","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php","line":1637,"function":"performRequest","class":"Elasticsearch\\Transport","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php","line":1220,"function":"performRequest","class":"Elasticsearch\\Client","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch_elasticsearch/lib/Service/SearchService.php","line":100,"function":"search","class":"Elasticsearch\\Client","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch_elasticsearch/lib/Platform/ElasticSearchPlatform.php","line":336,"function":"searchRequest","class":"OCA\\FullTextSearch_Elasticsearch\\Service\\SearchService","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch/lib/Service/SearchService.php","line":197,"function":"searchRequest","class":"OCA\\FullTextSearch_Elasticsearch\\Platform\\ElasticSearchPlatform","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch/lib/Service/SearchService.php","line":161,"function":"searchFromProviders","class":"OCA\\FullTextSearch\\Service\\SearchService","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch/lib/Controller/ApiController.php","line":120,"function":"search","class":"OCA\\FullTextSearch\\Service\\SearchService","type":"->"},{"file":"/path/to/cloud/apps/fulltextsearch/lib/Controller/ApiController.php","line":95,"function":"searchDocuments","class":"OCA\\FullTextSearch\\Controller\\ApiController","type":"->"},{"file":"/path/to/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"search","class":"OCA\\FullTextSearch\\Controller\\ApiController","type":"->"},{"file":"/path/to/cloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/path/to/cloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/path/to/cloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/path/to/cloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/path/to/cloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/path/to/cloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36 Edg/89.0.774.45","version":"21.0.0.18","id":"6049cf2c52922"}

FullTextSearch also repeatedly throws this error:
{"reqId":"YEnN3VaaWpYN6lnwgvCCGAAAAEo","level":3,"time":"2021-03-11T07:59:25+00:00","remoteAddr":"2003:df:4f30:400:4d9f:b389:f806:d58a","user":"TheColin21","app":"no app in context","method":"DELETE","url":"/remote.php/dav/files/TheColin21/NPP_Settings/backup/index.html@2021-03-11_085831","message":{"Exception":"OCP\FullTextSearch\Exceptions\FullTextSearchAppNotAvailableException","Message":"No IIndexService registered","Code":0,"Trace":[{"file":"/path/to/cloud/lib/private/FullTextSearch/FullTextSearchManager.php","line":193,"function":"getIndexService","class":"OC\FullTextSearch\FullTextSearchManager","type":"->"},{"file":"/path/to/cloud/apps/files_fulltextsearch/lib/Listeners/FileDeleted.php","line":61,"function":"updateIndexStatus","class":"OC\FullTextSearch\FullTextSearchManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/path/to/cloud/lib/private/EventDispatcher/ServiceEventListener.php","line":76,"function":"handle","class":"OCA\Files_FullTextSearch\Listeners\FileDeleted","type":"->"},{"file":"/path/to/cloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\EventDispatcher\ServiceEventListener","type":"->"},{"file":"/path/to/cloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->"},{"file":"/path/to/cloud/lib/private/EventDispatcher/EventDispatcher.php","line":86,"function":"dispatch","class":"Symfony\Component\EventDispatcher\EventDispatcher","type":"->"},{"file":"/path/to/cloud/lib/private/EventDispatcher/EventDispatcher.php","line":98,"function":"dispatch","class":"OC\EventDispatcher\EventDispatcher","type":"->"},{"file":"/path/to/cloud/lib/private/Files/Node/HookConnector.php","line":157,"function":"dispatchTyped","class":"OC\EventDispatcher\EventDispatcher","type":"->"},{"file":"/path/to/cloud/lib/private/legacy/OC_Hook.php","line":110,"function":"postDelete","class":"OC\Files\Node\HookConnector","type":"->"},{"file":"/path/to/cloud/lib/private/Files/View.php","line":1281,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/path/to/cloud/lib/private/Files/View.php","line":1209,"function":"runHooks","class":"OC\Files\View","type":"->"},{"file":"/path/to/cloud/lib/private/Files/View.php","line":725,"function":"basicOperation","class":"OC\Files\View","type":"->"},{"file":"/path/to/cloud/apps/dav/lib/Connector/Sabre/File.php","line":466,"function":"unlink","class":"OC\Files\View","type":"->"},{"file":"/path/to/cloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":179,"function":"delete","class":"OCA\DAV\Connector\Sabre\File","type":"->"},{"file":"/path/to/cloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\DAV\Tree","type":"->"},{"file":"/path/to/cloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\DAV\CorePlugin","type":"->"},{"file":"/path/to/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\DAV\Server","type":"->"},{"file":"/path/to/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\DAV\Server","type":"->"},{"file":"/path/to/cloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\DAV\Server","type":"->"},{"file":"/path/to/cloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\DAV\Server","type":"->"},{"file":"/path/to/cloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\DAV\Server","type":"->"},{"file":"/path/to/cloud/remote.php","line":167,"args":["/path/to/cloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/path/to/cloud/lib/private/FullTextSearch/FullTextSearchManager.php","Line":117,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows) mirall/3.1.3stable-Win64 (build 20210218) (Nextcloud)","version":"21.0.0.18","id":"6049cf2c55333"}

```

Nextcloud 21.0.0 on Ubuntu 20.04 with PHP 8.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/private/FullTextSearch/Model/IndexDocument.php at line 725 and the Elasticsearch vendor error at Connection.php line 358. Trace the search path through apps/fulltextsearch_elasticsearch/lib/Service/SearchService.php and FullTextSearchManager.php line 193, then reproduce the reported search and deletion flows. Done means Nextcloud 21 with PHP 8 and Elasticsearch no longer produces these errors and search returns results.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, php
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.