Resolve Connection Error on Records Upsert
TLDR Jainil faced consistent connection errors while upserting records. Jason identified an OOM issue, suggesting a capacity upgrade. Auto-scaling was discussed and the upgrade implementation process, which was in progress, was clarified.

Aug 21, 2023 (1 month ago)
Jainil
08:31 PMConnectionError: ('Connection aborted.', BadStatusLine('HTTP/1.1 0 \r\n'))
Jainil
08:31 PM/app/huxley/core/typesense/typesense.py in import_records(collection_id, records, action)
40 resp = collection.documents.import_(
41 records,
---> 42 {"action": action},
43 )
44 failures = list(filter(lambda x: x["success"] is False, resp))
/usr/local/lib/python3.7/site-packages/typesense/documents.py in import_(self, documents, params, batch_size)
76
77 docs_import = '\n'.join(document_strs)
---> 78 api_response = (self._endpoint_path('import'), docs_import, params, as_json=False)
79 res_obj_strs = api_response.split('\n')
80
/usr/local/lib/python3.7/site-packages/typesense/api_call.py in post(self, endpoint, body, params, as_json)
144 return self.make_request(, endpoint, as_json,
145 params=params, data=body,
--> 146 timeout=self.config.connection_timeout_seconds)
147
148 def put(self, endpoint, body, params=None):
/usr/local/lib/python3.7/site-packages/typesense/api_call.py in make_request(self, fn, endpoint, as_json, **kwargs)
128
129 logger.debug('No retries left. Raising last exception: {}'.format(last_exception))
--> 130 raise last_exception
131
132 def set_node_healthcheck(self, node, is_healthy):
/usr/local/lib/python3.7/site-packages/typesense/api_call.py in make_request(self, fn, endpoint, as_json, **kwargs)
99 kwargs['data'] = json.dumps(kwargs['data'])
100
--> 101 r = fn(url, headers={ApiCall.API_KEY_HEADER_NAME: self.config.api_key}, **kwargs)
102
103 # Treat any status code > 0 and < 500 to be an indication that node is healthy
/usr/local/lib/python3.7/site-packages/requests/api.py in post(url, data, json, **kwargs)
113 """
114
--> 115 return request("post", url, data=data, json=json, **kwargs)
116
117
/usr/local/lib/python3.7/site-packages/requests/api.py in request(method, url, **kwargs)
57 # cases, and look like a memory leak in others.
58 with sessions.Session() as session:
---> 59 return session.request(method=method, url=url, **kwargs)
60
61
/usr/local/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
585 }
586 send_kwargs.update(settings)
--> 587 resp = self.send(prep, **send_kwargs)
588
589 return resp
/usr/local/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
699
700 # Send the request
--> 701 r = adapter.send(request, **kwargs)
702
703 # Total elapsed time of the request (approximately)
/usr/local/lib/python3.7/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
545
546 except (ProtocolError, OSError) as err:
--> 547 raise ConnectionError(err, request=request)
548
549 except MaxRetryError as e:
ConnectionError: ('Connection aborted.', BadStatusLine('HTTP/1.1 0 \r\n'))
Jainil
08:31 PMJainil
08:36 PMJainil
08:58 PMJason
09:16 PMJason
09:16 PMJainil
09:21 PMWe have auto upgrade capacity enabled, any idea why it wasn't handled automatically?
Jason
09:23 PMJason
09:23 PM
Jainil
09:23 PMTypesense
Indexed 2764 threads (79% resolved)
Similar Threads
Large JSONL Documents Import Issue & Resolution
Suraj was having trouble loading large JSONL documents into Typesense server. After several discussions and attempts, it was discovered that the issue was due to data quality. Once the team extracted the data again, the upload process worked smoothly.

Typesense Error in Unit Testing for Python
Mehdi was encountering errors while running unit tests for Typesense functionalities in Python. Through discussion with Kishore Nallan, they recognized resource constraints might be causing the issue during JSONL file import. As suggested by Kishore Nallan, adding a short sleep after the import resolved the problem.
Troubleshooting Typesense Docsearch Scraper Setup Issue
Vinicius experienced issues setting up typesense-docsearch-scraper locally. Jason identified a misconfiguration with the Typesense server after checking the .env file, and recommended using ngrok or port forwarding for development purposes. Vinicius successfully resolved the issue with port forwarding.


Handling Kinesis Stream Event Batching with Typesense
Dui had questions about how to handle Kinesis stream events with Typesense. Kishore Nallan suggested using upsert mode for creation/update and differentiating with logical deletion. After various discussions including identifying and resolving a bug, they finalized to introduce an `emplace` action in Typesense v0.23.


Troubleshooting Stalled Writes in TypeSense Instance
Robert was experiencing typesense instances getting stuck after trying to import documents. Kishore Nallan provided suggestions and added specific logs to diagnose the issue. The two identified queries causing troubles but the issues had not been fully resolved yet.

