nextcloud / fulltextsearch_elasticsearch

🔍 Use Elasticsearch to index the content of your Nextcloud
GNU Affero General Public License v3.0
80 stars 29 forks source link

Error detecting ES by FTS 20.0.0 #127

Open Ark74 opened 3 years ago

Ark74 commented 3 years ago

Hi, happy 2021,

Today I just upgraded and found out that using,

It has issues detecting Elastic Search for some reason, the error occurs on https://github.com/nextcloud/fulltextsearch/blob/master/lib/Service/PlatformService.php which is not part of fulltextsearch_elasticsearch, @daita should I move this somewhere else?

$ php ~/occ fulltextsearch:check
Full text search 20.0.0

- Search Platform:
Elasticsearch 20.0.0 
{
    "elastic_host": [
        "http://user:********@localhost:9200"
    ],
    "elastic_index": "user-index",
    "fields_limit": "10000",
    "es_ver_below66": "0",
    "analyzer_tokenizer": "standard"
} 

- Content Providers:
Files 20.0.0
{
    "files_local": "1",
    "files_external": "0",
    "files_group_folders": "0",
    "files_encrypted": "0",
    "files_federated": "0",
    "files_size": "20",
    "files_pdf": "1",
    "files_office": "1",
    "files_image": "0",
    "files_audio": "0"
}

$ curl -XGET "$AUTH@localhost:9200/" ; \
curl -XGET "$AUTH@localhost:9200/_cat/plugins"
{
  "name" : "5c0af6d59e22",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "_p2Km8Q8QoGpyOTTGxbLWA",
  "version" : {
    "number" : "7.9.3",
    "build_flavor" : "oss",
    "build_type" : "docker",
    "build_hash" : "c4138e51121ef06a6404866cddc601906fe5c868",
    "build_date" : "2020-10-16T10:36:16.141335Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}
5c0af6d59e22 ingest-attachment 7.9.3
5c0af6d59e22 readonlyrest      1.26.0

$ 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. fail 
In PlatformService.php line 207:

  FullTextSearchPlatform OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform is not available  

fulltextsearch:test [--output [OUTPUT]] [-j|--json] [-d|--platform_delay PLATFORM_DELAY]
edocod1 commented 3 years ago

I also get this. No idea why: ES 20.0.0 and NC 20.0.7


nextcloud:/var/www/html# sudo -u www-data php nextcloud.gg/occ fulltextsearch:test -vvv

.Testing your current setup:  
Creating mocked content provider. ok  
Testing mocked provider: get indexable documents. (2 items) ok  
Loading search platform. fail 
In PlatformService.php line 207:

  [OCA\FullTextSearch\Exceptions\PlatformDoesNotExistException]                                            
  FullTextSearchPlatform OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform is not available  

Exception trace:
  at /var/www/html/nextcloud.gg/apps/fulltextsearch/lib/Service/PlatformService.php:207
 OCA\FullTextSearch\Service\PlatformService->getSelectedPlatform() at /var/www/html/nextcloud.gg/apps/fulltextsearch/lib/Service/PlatformService.php:172
 OCA\FullTextSearch\Service\PlatformService->loadPlatform() at /var/www/html/nextcloud.gg/apps/fulltextsearch/lib/Service/PlatformService.php:97
 OCA\FullTextSearch\Service\PlatformService->getPlatform() at /var/www/html/nextcloud.gg/apps/fulltextsearch/lib/Command/Test.php:296
 OCA\FullTextSearch\Command\Test->testLoadingPlatform() at /var/www/html/nextcloud.gg/apps/fulltextsearch/lib/Command/Test.php:158
 OCA\FullTextSearch\Command\Test->execute() at /var/www/html/nextcloud.gg/3rdparty/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/html/nextcloud.gg/core/Command/Base.php:169
 OC\Core\Command\Base->run() at /var/www/html/nextcloud.gg/3rdparty/symfony/console/Application.php:1000
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/nextcloud.gg/3rdparty/symfony/console/Application.php:271
 Symfony\Component\Console\Application->doRun() at /var/www/html/nextcloud.gg/3rdparty/symfony/console/Application.php:147
 Symfony\Component\Console\Application->run() at /var/www/html/nextcloud.gg/lib/private/Console/Application.php:215
 OC\Console\Application->run() at /var/www/html/nextcloud.gg/console.php:100
 require_once() at /var/www/html/nextcloud.gg/occ:11
IFM-Ulm commented 3 years ago

same here.

systemctl status elasticsearch.service ● elasticsearch.service - Elasticsearch Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/elasticsearch.service.d └─override.conf Active: active (running) since Wed 2021-03-17 15:01:56 CET; 4min 14s ago Docs: http://www.elastic.co Main PID: 16185 (java) Tasks: 56 (limit: 4915) Memory: 2.3G CGroup: /system.slice/elasticsearch.service ├─16185 /usr/bin/java -Xms2G -Xmx2G -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress └─16392 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

systemd[1]: Started Elasticsearch. elasticsearch[16185]: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME

sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:test

.Testing your current setup:
Creating mocked content provider. ok
Testing mocked provider: get indexable documents. (2 items) ok
Loading search platform. fail In PlatformService.php line 207:

FullTextSearchPlatform OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform is not available

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

IFM-Ulm commented 3 years ago

I'm a little emberassed to say but just want to add the solution here in case it helps anybody: Go to your nextcloud website, "options - full text search" . For me, it was just disabled. When I clicked the "plattform" selector and chose "Elasticsearch", it did remember my old settings and immediately, it worked.

it25fg commented 3 years ago

Hi @IFM-Ulm , somebody in https://help.nextcloud.com/t/fulltextsearch-does-not-work-after-update-to-nextcloud-20/95569/9 found out that the spelling of the platform name changed from ElasticSearch to Elasticsearch. Maybe the migration path did not consider this change.