Error with search when uploading a document or deleteing one

Hi, I have been working with mayan for a while now, and everything is working great
The only problem I have is with the dynamic_search app, when uploading a document or deleting from trash

I havent changed the default search, so its working with whoosh…

this is the error I get:

mayan.apps.dynamic_search.tasks <112> [ERROR] “task_index_instance() line 89 Unexpected error calling task_index_instance with keyword arguments {‘app_label’: ‘documents’, ‘model_name’: ‘document’, ‘object_id’: 198, ‘exclude_app_label’: None, ‘exclude_model_name’: None, ‘exclude_kwargs’: None}.”
[2023-04-17 17:17:38,846: ERROR/ForkPoolWorker-16] Unexpected error calling task_index_instance with keyword arguments {‘app_label’: ‘documents’, ‘model_name’: ‘document’, ‘object_id’: 198, ‘exclude_app_label’: None, ‘exclude_model_name’: None, ‘exclude_kwargs’: None}.
[2023-04-17 17:17:38,853: ERROR/ForkPoolWorker-16] Task mayan.apps.dynamic_search.tasks.task_index_instance[0a2bc2bc-26e8-4acc-bf9e-e59757ba2870] raised unexpected: DynamicSearchException(“Unexpected error calling task_index_instance with keyword arguments {‘app_label’: ‘documents’, ‘model_name’: ‘document’, ‘object_id’: 198, ‘exclude_app_label’: None, ‘exclude_model_name’: None, ‘exclude_kwargs’: None}.”)
Traceback (most recent call last):
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/connection.py”, line 174, in _new_conn
conn = connection.create_connection(
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/util/connection.py”, line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File “/usr/lib/python3.9/socket.py”, line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/mayan-edms/lib/python3.9/site-packages/elasticsearch/connection/http_urllib3.py”, line 255, in perform_request
response = self.pool.urlopen(
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 787, in urlopen
retries = retries.increment(
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/util/retry.py”, line 525, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/packages/six.py”, line 770, in reraise
raise value
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 703, in urlopen
httplib_response = self._make_request(
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/connectionpool.py”, line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/connection.py”, line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File “/usr/lib/python3.9/http/client.py”, line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/lib/python3.9/http/client.py”, line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/lib/python3.9/http/client.py”, line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/lib/python3.9/http/client.py”, line 1010, in _send_output
self.send(msg)
File “/usr/lib/python3.9/http/client.py”, line 950, in send
self.connect()
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/connection.py”, line 205, in connect
conn = self._new_conn()
File “/opt/mayan-edms/lib/python3.9/site-packages/urllib3/connection.py”, line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f9c84168dc0>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/dynamic_search/tasks.py”, line 69, in task_index_instance
SearchBackend.get_instance().index_instance(
File “/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/dynamic_search/backends/elasticsearch.py”, line 421, in index_instance
self._get_client().index(
File “/opt/mayan-edms/lib/python3.9/site-packages/elasticsearch/client/utils.py”, line 347, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
File “/opt/mayan-edms/lib/python3.9/site-packages/elasticsearch/client/init.py”, line 413, in index
return self.transport.perform_request(
File “/opt/mayan-edms/lib/python3.9/site-packages/elasticsearch/transport.py”, line 417, in perform_request
self._do_verify_elasticsearch(headers=headers, timeout=timeout)
File “/opt/mayan-edms/lib/python3.9/site-packages/elasticsearch/transport.py”, line 606, in _do_verify_elasticsearch
raise error
File “/opt/mayan-edms/lib/python3.9/site-packages/elasticsearch/transport.py”, line 569, in _do_verify_elasticsearch
_, info_headers, info_response = conn.perform_request(
File “/opt/mayan-edms/lib/python3.9/site-packages/elasticsearch/connection/http_urllib3.py”, line 280, in perform_request
raise ConnectionError(“N/A”, str(e), e)
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f9c84168dc0>: Failed to establish a new connection: [Errno -2] Name or service not known) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f9c84168dc0>: Failed to establish a new connection: [Errno -2] Name or service not known)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/opt/mayan-edms/lib/python3.9/site-packages/celery/app/trace.py”, line 451, in trace_task
R = retval = fun(*args, **kwargs)
File “/opt/mayan-edms/lib/python3.9/site-packages/celery/app/trace.py”, line 734, in protected_call
return self.run(*args, **kwargs)
File “/opt/mayan-edms/lib/python3.9/site-packages/mayan/apps/dynamic_search/tasks.py”, line 90, in task_index_instance
raise DynamicSearchException(error_message) from exception
mayan.apps.dynamic_search.exceptions.DynamicSearchException: Unexpected error calling task_index_instance with keyword arguments {‘app_label’: ‘documents’, ‘model_name’: ‘document’, ‘object_id’: 198, ‘exclude_app_label’: None, ‘exclude_model_name’: None, ‘exclude_kwargs’: None}.

elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f9c84168dc0>: Failed to establish a new connection: [Errno -2] Name or service not known) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f9c84168dc0>: Failed to establish a new connection: [Errno -2] Name or service not known)

This is networking issue and not a code issue. Double check any search related change you’ve made.

Mmm I just added a few attributes to the Document model, as well as to the Document Serializer…
Could that be it? I didn´t touch anything regarding searching

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.