Elastic search not working


#1

Hi,
I installed seafile server 6.1.4. I have found that my fulltext search stops working. I get the following message in web.
Sorry, but the requested page is unavailable due to a server hiccup.
Now i try it to rebuild it.
change from root to seafile user…
su - seafile -s /bin/bash
cd /opt/seafile/seafile-pro-server-6.1.4/
./pro/pro.py search –clear

Then i got error. How can i fix it? How can i rebuild full text search?
Please help.

Stefan

Delete search index, this may take a while…

[07/29/2017 17:20:45] storage: using filesystem storage backend
[07/29/2017 17:20:45] index office pdf: True
Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/opt/seafile/seafile-pro-server-6.1.4/pro/python/seafes/update_repos.py”, line 173, in
main()
File “/opt/seafile/seafile-pro-server-6.1.4/pro/python/seafes/update_repos.py”, line 117, in main
args.func()
File “/opt/seafile/seafile-pro-server-6.1.4/pro/python/seafes/update_repos.py”, line 75, in delete_indices
if es.indices.exists(idx):
File “/opt/seafile/seafile-pro-server-6.1.4/pro/python/elasticsearch-2.4.1-py2.6.egg/elasticsearch/client/utils.py”, line 69, in _wrapped
return func(*args, params=params, **kwargs)
File “/opt/seafile/seafile-pro-server-6.1.4/pro/python/elasticsearch-2.4.1-py2.6.egg/elasticsearch/client/indices.py”, line 225, in exists
params=params)
File “/opt/seafile/seafile-pro-server-6.1.4/pro/python/elasticsearch-2.4.1-py2.6.egg/elasticsearch/transport.py”, line 327, in perform_request
status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
File “/opt/seafile/seafile-pro-server-6.1.4/pro/python/elasticsearch-2.4.1-py2.6.egg/elasticsearch/connection/http_urllib3.py”, line 106, in perform_request
raise ConnectionError(‘N/A’, str(e), e)
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x22a0ad0>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x22a0ad0>: Failed to establish a new connection: [Errno 111] Connection refused)


#2

That suggests the local elasticsearch server is not running.

  • Can you check logs/controller.log and logs/elasticsearch.log?
  • D you have enough RAM on your server?
  • What is the java version installed?

#3

Hi,

Ram shoulde be OK…here are some logs.

logs/controller
elasticsearch.pid
[07/29/17 19:20:12] seafile-controller.c(581): failed to read pidfile
/opt/seafile/pids/elasticsearch.pid: Success
[07/29/17 19:20:22] seafile-controller.c(131): bad pidfile format: /opt/seafile/pids/elasticsearch.pid
[07/29/17 19:20:22] seafile-controller.c(581): failed to read pidfile
/opt/seafile/pids/elasticsearch.pid: Success

logs/elasticsearch
[2017-06-20 02:00:04,233][INFO ][node ] [Phyla-Vell] stopping …
[2017-06-20 02:00:04,284][INFO ][node ] [Phyla-Vell] stopped
[2017-06-20 02:00:04,284][INFO ][node ] [Phyla-Vell] closing …
[2017-06-20 02:00:04,290][INFO ][node ] [Phyla-Vell] closed
[2017-06-20 02:01:58,470][INFO ][node ] [Iron Monger] version[1.4.0], pid[2971],
build[bc94bd8/2014-11-05T14:26:12Z]
[2017-06-20 02:01:58,511][INFO ][node ] [Iron Monger] initializing …
[2017-06-20 02:01:59,271][INFO ][plugins ] [Iron Monger] loaded [analysis-ik,
transport-thrift], sites []
[2017-06-20 02:02:05,991][INFO ][node ] [Iron Monger] initialized
[2017-06-20 02:02:05,992][INFO ][node ] [Iron Monger] starting …
[2017-06-20 02:02:06,004][INFO ][thrift ] [Iron Monger] bound on port [9500]
[2017-06-20 02:02:06,007][INFO ][transport ] [Iron Monger] bound_address {local[1]},
publish_address {local[1]}
[2017-06-20 02:02:06,051][INFO ][discovery ] [Iron Monger]
elasticsearch/S9ba2C1sSOuH9JWGxl_1NQ
[2017-06-20 02:02:06,053][INFO ][cluster.service ] [Iron Monger] master {new [Iron
Monger][S9ba2C1sSOuH9JWGxl_1NQ][my.ddns.net][local[1]]{local=true}}, removed {[Iron
Monger][cCdDfL3vS1CaPOmAyn3T_A][my.ddns.net][local[1]]{local=true},}, reason: local-disco-
initial_connect(master)
[2017-06-20 02:02:06,237][INFO ][http ] [Iron Monger] bound_address
{inet[/127.0.0.1:9200]}, publish_address {inet[/127.0.0.1:9200]}
[2017-06-20 02:02:06,237][INFO ][node ] [Iron Monger] started
[2017-06-20 02:02:08,046][INFO ][ik-analyzer ] [Dict Loading]ik/custom/mydict.dic
[2017-06-20 02:02:08,063][INFO ][ik-analyzer ] [Dict Loading]ik/custom/sougou.dic
[2017-06-20 02:02:08,411][INFO ][ik-analyzer ] [Dict Loading]ik/custom/ext_stopword.dic
[2017-06-20 02:02:09,637][INFO ][gateway ] [Iron Monger] recovered [2] indices into cluster_state

Java
openjdk version “1.8.0_141”

Ram
total used free shared buff/cache available
Mem: 11848336 3150648 5916632 35652 2781056 8192560
Swap: 5767164 0 5767164


#4

Hi,
Someone has an idea?
Premission problem? how can i rebuild elastic search?
Many thanks in advance
Stefan


#5

Hi,
I check it on seafile demo…and the diffrenz is that in the url if e.g search for test—>&search_repo=fe0ff9be-5f3f-44eb-9ee6-61251c9585a1 is missing. How can i rebuild this part?
Many thanks
Stefan


#6

I have same problem with search. I tried also clear, but got almost same error

$ pro/pro.py search --clear
Delete seafile search index ([y]/n)? y

Delete search index, this may take a while…

[08/03/2017 14:34:49] storage: using filesystem storage backend
[08/03/2017 14:34:49] index office pdf: True
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/opt/seafile/seafile-pro-server-6.1.3/pro/python/seafes/update_repos.py” , line 173, in
main()
File “/opt/seafile/seafile-pro-server-6.1.3/pro/python/seafes/update_repos.py” , line 117, in main
args.func()
File “/opt/seafile/seafile-pro-server-6.1.3/pro/python/seafes/update_repos.py” , line 75, in delete_indices
if es.indices.exists(idx):
File “/opt/seafile/seafile-pro-server-6.1.3/pro/python/elasticsearch-2.4.1-py2 .7.egg/elasticsearch/client/utils.py”, line 69, in _wrapped
File “/opt/seafile/seafile-pro-server-6.1.3/pro/python/elasticsearch-2.4.1-py2 .7.egg/elasticsearch/client/indices.py”, line 225, in exists
File “/opt/seafile/seafile-pro-server-6.1.3/pro/python/elasticsearch-2.4.1-py2 .7.egg/elasticsearch/transport.py”, line 327, in perform_request
File “/opt/seafile/seafile-pro-server-6.1.3/pro/python/elasticsearch-2.4.1-py2 .7.egg/elasticsearch/connection/http_urllib3.py”, line 106, in perform_request
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HT TPConnection object at 0x7f17a022b0d0>: Failed to establish a new connection: [E rrno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection. HTTPConnection object at 0x7f17a022b0d0>: Failed to establish a new connection: [Errno 111] Connection refused)

In log it says

[08/03/17 14:35:49] seafile-controller.c(615): elasticsearch need restart…
[08/03/17 14:35:49] seafile-controller.c(87): spawn_process: /opt/seafile/seafile-pro-server-6.1.3/pro/elasticsearch/bin/elasticsearch -Des.path.logs=/opt/seafile/logs -Des.path.data=/opt/seafile/pro-data/search/data -Des.network.host=127.0.0.1 -Des.insecure.allow.root=true -p /opt/seafile/pids/elasticsearch.pid
[08/03/17 14:35:49] seafile-controller.c(102): spawned /opt/seafile/seafile-pro-server-6.1.3/pro/elasticsearch/bin/elasticsearch, pid 3669
[08/03/17 14:35:59] seafile-controller.c(578): pid file /opt/seafile/pids/elasticsearch.pid does not exist

So looks like mine elasticsearch is running, but it says need to restart…

I have Ubuntu 16.04 LTS, Seafile Pro 6.1.4 and Java is openjdk version “1.8.0_131”. Server has 32GB ram, so it should be enought :slight_smile:


#7

Hi there,

I ran into similar problem once. Try stopping Seafile and Seahub and check afterwards if Elasticsearch is still running and kill it. Also delete the pid file which is mentioned in the logs that can’t be accessed.
Restart Seafile and check if everything comes back up.

Kind regards,
Kenneth


#8

Hi,

If I stop seafile, elasticsearch is not running and pids folder is empty. When I start seafile and seahub those start but I don’t see elasticsearch starting/running and no pid file.


#9

Hi, this is how I solved the issue on my end.
on tail -f /opt/seafile/elasticsearch.log i get tons of errors:

[2017-10-05 07:58:36,724][INFO ][ik-analyzer              ] [Dict Loading] custom/ext_stopword.dic
[2017-10-05 07:58:37,603][ERROR][bootstrap                ] Guice Exception: java.nio.file.FileAlreadyExistsException: /opt/seafile/pro-data/search/data/elasticsearch/nodes/0/__es__.tmp

But this was actionable; i just did rm /opt/seafile/pro-data/search/data/elasticsearch/nodes/0/__es__.tmp ; systemctl restart seafile-server and search seemed to work again.


#10

This post was flagged by the community and is temporarily hidden.