Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fulltextsearch test failing on nextcloud 15 #477

Open
disc0very opened this issue Mar 24, 2019 · 14 comments
Open

fulltextsearch test failing on nextcloud 15 #477

disc0very opened this issue Mar 24, 2019 · 14 comments

Comments

@disc0very
Copy link

Hello please help me i can't find any solution! Thanks

Here is my env:
NextCloud 15.0.5
Full text search 1.2.5
Full text search - Elasticsearch Platform 1.2.4
Full text search - Files 1.2.6
Full text search - Files - Tesseract OCR 1.2.0
PHP 7.2.10
mysql Ver 15.1 Distrib 5.5.60-MariaDB

/var/www/html/nextcloud# sudo -u apache php occ fulltextsearch:test

.Testing your current setup:
Creating mocked content provider. ok
Testing mocked provider: get indexable documents. (2 items) ok
Loading search platform. (Elasticsearch) ok
Testing search platform. ok
Locking process ok
Removing test. ok
Pausing 3 seconds 1 2 3 ok
Initializing index mapping. ok
Indexing generated documents. ok
Pausing 3 seconds 1 2 3 ok
Retreiving content from a big index (license). (size: 32386) ok
Comparing document with source. ok
Searching basic keywords:

  • 'test' An unhandled exception has been thrown:
    TypeError: Return value of OCA\FullTextSearch\Model\SearchRequest::getProviders() must be of the type array, null returned in /var/www/html/nextcloud/apps/fulltextsearch/lib/Model/SearchRequest.php:110
    Stack trace:
    #0 /var/www/html/nextcloud/apps/fulltextsearch/lib/Model/SearchRequest.php(665): OCA\FullTextSearch\Model\SearchRequest->getProviders()
    Search within the trash bin #1 [internal function]: OCA\FullTextSearch\Model\SearchRequest->jsonSerialize()
    Search within the shared file #2 /var/www/html/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/SearchService.php(98): json_encode(Object(OCA\FullTextSearch\Model\SearchRequest))
    Supporting epub and openoffice documents #3 /var/www/html/nextcloud/apps/fulltextsearch_elasticsearch/lib/Platform/ElasticSearchPlatform.php(340): OCA\FullTextSearch_ElasticSearch\Service\SearchService->searchRequest(Object(Elasticsearch\Client), Object(OCA\FullTextSearch\Model\SearchResult), Object(OCP\FullTextSearch\Model\DocumentAccess))
    Number of documents #4 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Test.php(582): OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform->searchRequest(Object(OCA\FullTextSearch\Model\SearchResult), Object(OCP\FullTextSearch\Model\DocumentAccess))
    0 1 0 #5 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Test.php(434): OCA\FullTextSearch\Command\Test->search(Object(Symfony\Component\Console\Output\ConsoleOutput), Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\FullTextSearch\Provider\TestProvider), Object(OCP\FullTextSearch\Model\DocumentAccess), 'test', Array)
    merge 0.2.0 #6 /var/www/html/nextcloud/apps/fulltextsearch/lib/Command/Test.php(170): OCA\FullTextSearch\Command\Test->testSearchSimple(Object(Symfony\Component\Console\Output\ConsoleOutput), Object(OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform), Object(OCA\FullTextSearch\Provider\TestProvider))
    escape using queryhelper #7 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\FullTextSearch\Command\Test->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    update schema using API #8 /var/www/html/nextcloud/core/Command/Base.php(166): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    double display #9 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    0.3.0 #10 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\FullTextSearch\Command\Test), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    Auto-check configuration on upgrade #11 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    flag the configuration as incomplete #12 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    More robust way to get the local absolute path of a file #13 /var/www/html/nextcloud/console.php(96): OC\Console\Application->run()
    Forbidden Exception when ./occ nextant:scan #14 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
@danst0
Copy link

danst0 commented May 17, 2020

Same issue here, what did you do to resolve it?

@Happyfeet01
Copy link

i have this issue too.

Here the Log result from FTS

`root@dasnetzundich /var/log/elasticsearch # sudo -uwww-data php /var/www/nextcloud/occ fulltextsearch:search lars ratingen
search

In Connection.php line 632:

{"error":{"root_cause":[{"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [should]"}],"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [must]"
,"caused_by":{"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [should]","caused_by":{"type":"x_content_parse_exception","reason":"[1:63] [bool] failed to parse field [should
]","caused_by":{"type":"illegal_state_exception","reason":"expected value but got [START_ARRAY]"}}}},"status":400}

and the logs from Nextcloud https://paste.dasnetzundich.de/view/bff9f8f8#L18
`

@thomaslc66
Copy link

Same problem here, this issue needs to be reopened

@sbauschulte
Copy link

I get the same error - please reopen.

@disc0very disc0very reopened this May 31, 2020
@disc0very
Copy link
Author

Same issue here, what did you do to resolve it?

Can’t actually remember.
Make sure Elasticsearch work properly using curl:

curl -XGET 'localhost:9200/?pretty'

and check that fulltextsearch config in nextcloud correctly link to the elastisearch servlet address and index name.
Good luck

@Happyfeet01
Copy link

Happyfeet01 commented May 31, 2020

There is an hotfix, when you have installed elasticsearch 7.7.0 and later nextcloud/fulltextsearch_elasticsearch#107

@sbauschulte
Copy link

Thanks for your suggestion! I tried it an now i get this:

Searching basic keywords:

  • 'test' (result: 1, expected: ["simple"]) ok
  • 'document is a simple test' (result: 0, expected: ["simple","license"]) fail
    Error detected, unlocking process ok
    In Test.php line 652:

Unexpected SearchResult: {"provider":{"id":"test_provider","name":"Test Pro
vider"},"platform":{"id":"elastic_search","name":"Elasticsearch"},"document
s":[],"info":[],"meta":{"timedOut":false,"time":142,"count":0,"total":0,"ma
xScore":0}}

When I do a "curl -XGET 'localhost:9200/?pretty'" i get this:

{
"name" : "nextcloud-server",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "zV__XZHuRgWHUBIV3xgBdw",
"version" : {
"number" : "7.7.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf",
"build_date" : "2020-05-12T02:01:37.602180Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

@Happyfeet01
Copy link

What happens when you start the Fulltextsearch Scan?

@Happyfeet01
Copy link

If it works, make a review please. Without this review the update can’t release.

Thanks

@sbauschulte
Copy link

What exactly do you mean by "Fulltextsearch Scan" ? If I try to search from nextcloud I still get no response from the dialog.
image

On the commandline i can successfully search with "curl -XGET localhost:9200/main_elastic/_search?q=lemon":

{"took":44,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":30,"relation":"eq"},"max_score":14.416168,"hits":[{"_index":"main_elastic","_type":"standard","_id":"files:176422","_score":14.416168,"_source":{"owner":"simonb","groups":["Kollegen","KollegenPlus"],"circles":[],"metatags":["files_local"],"source":"files_local",

In this case I git a searchresult of 313K. It's really frustrating because everything seems to work fine except the integration into nextcloud.

@thomaslc66
Copy link

Hello,
I have the exact same error as @sbauschulte

Thanks for your suggestion! I tried it an now i get this:

Searching basic keywords:

  • 'test' (result: 1, expected: ["simple"]) ok
  • 'document is a simple test' (result: 0, expected: ["simple","license"]) fail
    Error detected, unlocking process ok
    In Test.php line 652:

Unexpected SearchResult: {"provider":{"id":"test_provider","name":"Test Pro
vider"},"platform":{"id":"elastic_search","name":"Elasticsearch"},"document
s":[],"info":[],"meta":{"timedOut":false,"time":142,"count":0,"total":0,"ma
xScore":0}}

When I do a "curl -XGET 'localhost:9200/?pretty'" i get this:

{
"name" : "nextcloud-server",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "zV__XZHuRgWHUBIV3xgBdw",
"version" : {
"number" : "7.7.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "81a1e9eda8e6183f5237786246f6dced26a10eaf",
"build_date" : "2020-05-12T02:01:37.602180Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

But I've asked on the fulltextsearch_elasticsearch repository: Issue here

@tao-polito
Copy link

Hi There,

I got the same error as @thomaslc66 after applying nextcloud/fulltextsearch_elasticsearch#107, the first round of test seems ok, but:

.Testing your current setup:
Creating mocked content provider. ok
Testing mocked provider: get indexable documents. (2 items) ok
Loading search platform. (Elasticsearch) ok
Testing search platform. ok
Locking process ok
Removing test. ok
Pausing 3 seconds 1 2 3 ok
Initializing index mapping. ok
Indexing generated documents. ok
Pausing 3 seconds 1 2 3 ok
Retreiving content from a big index (license). (size: 32386) ok
Comparing document with source. ok
Searching basic keywords:

  • 'test' (result: 1, expected: ["simple"]) ok
  • 'document is a simple test' (result: 0, expected: ["simple","license"]) fail
    Error detected, unlocking process ok
    In Test.php line 652:

Unexpected SearchResult: {"provider":{"id":"test_provider","name":"Test Provider"},"platform":{"id":"elastic_search","name":"Elasticsearch"},"documents":[],"info":[],"meta":{"timedOut":false,"time":2,"count":0,"total":0,"maxScore":0}}

fulltextsearch:test [--output [OUTPUT]] [-j|--json] [-d|--platform_delay PLATFORM_DELAY]

When I do curl -XGET http://localhost:9200/?pretty
I get:

{
"name" : "nc_search",
"cluster_name" : "nextcloud",
"cluster_uuid" : "8TswmC9gT6GYiTg32CT_ng",
"version" : {
"number" : "7.7.1",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "ad56dce891c901a492bb1ee393f12dfff473a423",
"build_date" : "2020-05-28T16:30:01.040088Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}

When I do curl -XGET http://localhost:9200/nextcloud/_search?q=Basic, I got the following results (shortened... but it seems elasticsearch works perfectly in the backend.

[.....] Nextcloud Web interface\n\tWeb browser requirements\n\tNavigating the main user interface\n\n\tFiles & synchronization\n\tAccessing your files using the Nextcloud Web interface\n\tAccessing Nextcloud files using WebDAV\n\tGallery app\n\tManaging deleted files\n\tDesktop and mobile synchronization\n\tEncrypting your Nextcloud files on the server\n\tUsing Federation Shares\n\tMaking anonymous uploads\n\tLarge file uploads\n\tStorage quota\n\tVersion control\n\tProjects\n\n\tGroupware\n\tUsing the Contacts app\n\tUsing the Calendar app\n\tSynchronizing with Android\n\tSynchronizing with iOS\n\tSynchronizing with macOS\n\tSynchronizing with Thunderbird\n\tSynchronizing with KDE Kontact\n\tSynchronizing with the GNOME desktop\n\tSynchronizing with Windows 10\n\n\tSetting your preferences\n\tUsing two-factor authentication\n\tConfiguring two-factor authentication\n\tRecovery codes in case you lost your 2nd factor\n\tLogging in with two-factor authentication\n\tUsing client applications with two-factor authentication\n\n\tManage connected browsers and devices\n\tManaging connected browsers\n\tManaging devices\n\tDevice-specific passwords and password changes\n\n\tExternal Storage\n\tConfiguring external Storage","tags":[],"attachment":{"date":"2020-06-04T07:04:51Z","content_type":"application/pdf","author":"The Nextcloud developers","language":"en","title":"Nextcloud User Manual","content_length":96923},"provider":"files","subtags":[],"parts":{"comments":""},"links":[],"share_names":{"pboccardo":"Nextcloud Manual.pdf"},"hash":"55f080439a694e755f77b96f69d07d2e"}}]}}

here is the system info:
Centos 8
Nextcloud version: 17.07
Apache/2.4.37 (centos)
PHP 7.2.11

Thanks a lot for your suggestions in advance.

@SomwareHR
Copy link

SomwareHR commented Sep 20, 2022

Hi,
Any solutions?
It's 2022, Nextcloud snap version 24, ElasticSearch 6, failure failed with same error as tao-polito's:

$ sudo nextcloud.occ full:test

results with

license - ["group_1"] -  (result: 0, expected: ["license"]) fail
 
Error detected, unlocking process ok

In Test.php line 675:

Unexpected SearchResult: 
{"provider":{"id":"test_provider","name":"Test Provider"},
"platform":{"id":"elastic_search","name":"Elasticsearch"},
"documents":[],"info":[],
"meta":{"timedOut":false,"time":1,"count":0,"total":0,"maxScore":0}}

@disc0very
Copy link
Author

Hi, Any solutions? It's 2022, Nextcloud snap version 24, ElasticSearch 6, failure failed with same error as tao-polito's:

$ sudo nextcloud.occ full:test

results with

license - ["group_1"] -  (result: 0, expected: ["license"]) fail
 
Error detected, unlocking process ok

In Test.php line 675:

Unexpected SearchResult: 
{"provider":{"id":"test_provider","name":"Test Provider"},
"platform":{"id":"elastic_search","name":"Elasticsearch"},
"documents":[],"info":[],
"meta":{"timedOut":false,"time":1,"count":0,"total":0,"maxScore":0}}

hi, i solved it recently on a nextcloud 24 (centos 7 installation) by installing elasticsearch version 7 instead of version 6.
I also reinstalled the ingest attachment plugin for elastic search.
Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants