Search function in seafile doesnt work

Hi,

There is no response when entering a text in the search bar, also, getting the error in the seahub log as below, Anyone can advice on this?

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f364932e630>: Failed to establish a new connection: [Errno 111] Connection refused
2022-03-02 08:12:45,582 [WARNING] elasticsearch:97 log_request_fail HEAD http://127.0.0.1:9200/repofiles [status:N/A request:0.001s]
Traceback (most recent call last):
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 170, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/util/connection.py”, line 96, in create_connection
raise err
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/util/connection.py”, line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/seafile/seafile-pro-server-7.1.22/pro/python/elasticsearch/connection/http_urllib3.py”, line 114, in perform_request
response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connectionpool.py”, line 756, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/util/retry.py”, line 507, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/packages/six.py”, line 770, in reraise
raise value
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connectionpool.py”, line 706, in urlopen
chunked=chunked,
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connectionpool.py”, line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File “/usr/lib/python3.6/http/client.py”, line 1281, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1327, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1276, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1042, in _send_output
self.send(msg)
File “/usr/lib/python3.6/http/client.py”, line 980, in send
self.connect()
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 200, in connect
conn = self._new_conn()
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 182, in _new_conn
self, “Failed to establish a new connection: %s” % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f3648c685f8>: Failed to establish a new connection: [Errno 111] Connection refused
2022-03-02 08:12:45,583 [WARNING] elasticsearch:97 log_request_fail HEAD http://127.0.0.1:9200/repofiles [status:N/A request:0.001s]
Traceback (most recent call last):
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 170, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/util/connection.py”, line 96, in create_connection
raise err
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/util/connection.py”, line 86, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/seafile/seafile-pro-server-7.1.22/pro/python/elasticsearch/connection/http_urllib3.py”, line 114, in perform_request
response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connectionpool.py”, line 756, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/util/retry.py”, line 507, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/packages/six.py”, line 770, in reraise
raise value
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connectionpool.py”, line 706, in urlopen
chunked=chunked,
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connectionpool.py”, line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File “/usr/lib/python3.6/http/client.py”, line 1281, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1327, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1276, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/lib/python3.6/http/client.py”, line 1042, in _send_output
self.send(msg)
File “/usr/lib/python3.6/http/client.py”, line 980, in send
self.connect()
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 200, in connect
conn = self._new_conn()
File “/opt/seafile/seafile-pro-server-7.1.22/seahub/thirdpart/urllib3/connection.py”, line 182, in _new_conn
self, “Failed to establish a new connection: %s” % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f3648c68e80>: Failed to establish a new connection: [Errno 111] Connection refused
2022-03-02 08:12:45,584 [ERROR] seahub.api2.views:581 get ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f3648c68e80>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f3648c68e80>: Failed to establish a new connection: [Errno 111] Connection refused)

Your elasticsearch instance isn’t responding. Depending on how you’ve installed seafile (Docker ?), you need to check if it’s running and if seafile points on the correct address/port (in seafevents.conf)

Hi dani, I am having a similar issue (File search not working, elasticsearch wont index after deploying Seafile 9.0.7 docker) and I was wondering if you could expand on your answer. How do I get seafevents.conf to point to elasticsearch? My seafile PE is running in a docker, and my seafevents.conf only has:

[AUDIT]
enabled = true

[INDEX FILES]
enabled = true
interval = 10m
highlight = fvh

I would appreciate your help.

Something like this

[INDEX FILES]
enabled = true
interval = 10m
index_office_pdf = true
external_es_server = true
es_host = elasticsearch.example.org
es_port = 9200