nextcloud / fulltextsearch_elasticsearch

🔍 Use Elasticsearch to index the content of your Nextcloud
https://apps.nextcloud.com/apps/fulltextsearch_elasticsearch
GNU Affero General Public License v3.0
81 stars 30 forks source link

Error "No alive nodes found in your cluster" #99

Open DrPoldo opened 4 years ago

DrPoldo commented 4 years ago

Hi, when i run: sudo -u www-data ./occ fulltextsearch:index

I'm having the following error:

In StaticNoPingConnectionPool.php line 50:
No alive nodes found in your cluster

I'm new to nextcloud, docker and elasticsearch so it could easily be a my mistake but after various research i still haven't found any solution.

I'm currently running nextcloud 18.0.2.2 in a docker container thanks to nextcloudpi 1.23.1 The host os is raspbian buster with ip 192.168.1.118 and elasticsearch is running on it on the 9200 port. Elastisearch version is 6.6.2 (i also tested the 7.4.0 resulting with the same error) and is runnig without any security authentication. The content of elaticsearch.yml:

path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 192.168.1.118
http.port: 9200
xpack.ml.enabled: false
bootstrap.system_call_filter: false
xpack.security.enabled: false

I've tested the connecetion from the nextcloud container with: curl 192.168.1.118:9200 and the result seems ok:

{
  "name" : "wW8ACP9",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "42NHCan_QMyfiolE2YTHrw",
  "version" : {
    "number" : "6.6.2",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "3bd3e59",
    "build_date" : "2019-03-06T15:16:26.864148Z",
    "build_snapshot" : false,
    "lucene_version" : "7.6.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

This is the output of sudo -u www-data ./occ fulltextsearch:check:

Full text search 1.4.1

- Search Platform:
Elasticsearch 1.5.1
{
    "elastic_host": [
        "http://192.169.1.118:9200"
    ],
    "elastic_index": "nc_index",
    "fields_limit": "10000",
    "es_ver_below66": "0",
    "analyzer_tokenizer": "standard"
}

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

Elasticsearch log doesn't show any error:

[2020-04-06T17:40:07,582][INFO ][o.e.e.NodeEnvironment    ] [wW8ACP9] using [1] data paths, mounts [[/ (/dev/root)]], net usable_space [51.2gb], net total_space [58.2gb], types [ext4]
[2020-04-06T17:40:07,589][INFO ][o.e.e.NodeEnvironment    ] [wW8ACP9] heap size [1017.6mb], compressed ordinary object pointers [unknown]
[2020-04-06T17:40:07,606][INFO ][o.e.n.Node               ] [wW8ACP9] node name derived from node ID [wW8ACP9KQqeb8k8oHN9X-w]; set [node.name] to override
[2020-04-06T17:40:07,606][INFO ][o.e.n.Node               ] [wW8ACP9] version[6.6.2], pid[14383], build[default/deb/3bd3e59/2019-03-06T15:16:26.864148Z], OS[Linux/4.19.97-v7l+/arm], JVM[Raspbian/OpenJDK Server VM/11.0.6/11.0.6+10-post-Raspbian-1deb10u1]
[2020-04-06T17:40:07,607][INFO ][o.e.n.Node               ] [wW8ACP9] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-3981873721581653729, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=deb]
[2020-04-06T17:40:15,753][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [aggs-matrix-stats]
[2020-04-06T17:40:15,754][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [analysis-common]
[2020-04-06T17:40:15,754][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [ingest-common]
[2020-04-06T17:40:15,754][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [lang-expression]
[2020-04-06T17:40:15,754][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [lang-mustache]
[2020-04-06T17:40:15,754][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [lang-painless]
[2020-04-06T17:40:15,755][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [mapper-extras]
[2020-04-06T17:40:15,755][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [parent-join]
[2020-04-06T17:40:15,755][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [percolator]
[2020-04-06T17:40:15,755][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [rank-eval]
[2020-04-06T17:40:15,755][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [reindex]
[2020-04-06T17:40:15,755][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [repository-url]
[2020-04-06T17:40:15,756][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [transport-netty4]
[2020-04-06T17:40:15,756][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [tribe]
[2020-04-06T17:40:15,756][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-ccr]
[2020-04-06T17:40:15,756][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-core]
[2020-04-06T17:40:15,757][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-deprecation]
[2020-04-06T17:40:15,757][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-graph]
[2020-04-06T17:40:15,757][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-ilm]
[2020-04-06T17:40:15,757][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-logstash]
[2020-04-06T17:40:15,757][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-ml]
[2020-04-06T17:40:15,757][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-monitoring]
[2020-04-06T17:40:15,758][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-rollup]
[2020-04-06T17:40:15,758][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-security]
[2020-04-06T17:40:15,758][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-sql]
[2020-04-06T17:40:15,758][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-upgrade]
[2020-04-06T17:40:15,758][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded module [x-pack-watcher]
[2020-04-06T17:40:15,759][INFO ][o.e.p.PluginsService     ] [wW8ACP9] loaded plugin [ingest-attachment]
[2020-04-06T17:40:33,450][INFO ][o.e.d.DiscoveryModule    ] [wW8ACP9] using discovery type [zen] and host providers [settings]
[2020-04-06T17:40:35,568][INFO ][o.e.n.Node               ] [wW8ACP9] initialized
[2020-04-06T17:40:35,568][INFO ][o.e.n.Node               ] [wW8ACP9] starting ...
[2020-04-06T17:40:36,126][INFO ][o.e.t.TransportService   ] [wW8ACP9] publish_address {192.168.1.118:9300}, bound_addresses {192.168.1.118:9300}
[2020-04-06T17:40:36,225][INFO ][o.e.b.BootstrapChecks    ] [wW8ACP9] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2020-04-06T17:40:39,406][INFO ][o.e.c.s.MasterService    ] [wW8ACP9] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {wW8ACP9}{wW8ACP9KQqeb8k8oHN9X-w}{4Y4peOTLS8e6hfNgyIQL9g}{192.168.1.118}{192.168.1.118:9300}{xpack.installed=true}
[2020-04-06T17:40:39,431][INFO ][o.e.c.s.ClusterApplierService] [wW8ACP9] new_master {wW8ACP9}{wW8ACP9KQqeb8k8oHN9X-w}{4Y4peOTLS8e6hfNgyIQL9g}{192.168.1.118}{192.168.1.118:9300}{xpack.installed=true}, reason: apply cluster state (from master [master {wW8ACP9}{wW8ACP9KQqeb8k8oHN9X-w}{4Y4peOTLS8e6hfNgyIQL9g}{192.168.1.118}{192.168.1.118:9300}{xpack.installed=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2020-04-06T17:40:39,606][INFO ][o.e.h.n.Netty4HttpServerTransport] [wW8ACP9] publish_address {192.168.1.118:9200}, bound_addresses {192.168.1.118:9200}
[2020-04-06T17:40:39,607][INFO ][o.e.n.Node               ] [wW8ACP9] started
[2020-04-06T17:40:40,816][INFO ][o.e.l.LicenseService     ] [wW8ACP9] license [4e201ad4-4049-4d49-a080-25d5ac850d8c] mode [basic] - valid
[2020-04-06T17:40:40,858][INFO ][o.e.g.GatewayService     ] [wW8ACP9] recovered [0] indices into cluster_state
ohthehugemanatee commented 3 years ago

I just solved this for myself - I had elasticsearch set up on my local kubernetes cluster, following their recommended instructions... which automatically sets up SSL/TLS with a self-signed certificate. The PHP elasticsearch library refuses to connect if the certificate authority doesn't validate.

Your options are: add the issuing root certificate to the nextcloud system's certificate store, or disable SSL/TLS on elasticsearch. Obviously only do the latter if you're in a protected network environment, and even then think about it carefully first.