Remote end close connection without responce

Hi,
I can’t localize the problem as an error is referred to urllib3 1.26.2 (python3.8 on debian 10 or mac 10.15.7). Code is crashed when doing a request or sometimes during a call of writing method with valid and correct jsons (see console output at the end of the post). But the crash is not persistent/reproducible - it happens each time for different requests and on different lists of jsons (randomly). I did check the query on which crash happened and it is valid for UI Influxdb script editor. Could you point me out how to fix it or in what way to dig?

Sending request
from(bucket: “bucket”)
|> range(start: -10d)
|> filter(fn: (r) => r._measurement == “set”)
|> filter(fn: (r) => r._field == “int1” or r._field == “int2”)
Got following exception:
Traceback (most recent call last):
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 699, in urlopen
httplib_response = self._make_request(
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 445, in _make_request
six.raise_from(e, None)
File “”, line 3, in raise_from
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 440, in _make_request
httplib_response = conn.getresponse()
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”, line 1347, in getresponse
response.begin()
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”, line 307, in begin
version, status, reason = self._read_status()
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”, line 276, in _read_status
raise RemoteDisconnected(“Remote end closed connection without”
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Users/b/Documents/Projects/jsonTimeSeriesGraphana/test_uploader/docker-container/get_json_from_cos_upload_to_influx.py”, line 575, in
influx.update_by_stats(cos_obj, int(args.update_interval))
File “/Users/b/Documents/Projects/jsonTimeSeriesGraphana/test_uploader/docker-container/get_json_from_cos_upload_to_influx.py”, line 552, in update_by_stats
self.update_from_stats(cos_instance, stats_filenames,
File “/Users/b/Documents/Projects/jsonTimeSeriesGraphana/test_uploader/docker-container/get_json_from_cos_upload_to_influx.py”, line 450, in update_from_stats
list_of_json = self.collect_missing(ptype, target_code, time_interval_from_now, stats, product_json)
File “/Users/b/Documents/Projects/jsonTimeSeriesGraphana/test_uploader/docker-container/get_json_from_cos_upload_to_influx.py”, line 507, in collect_missing
is_pcode_in_db = self.is_pcode_in(record_type, target_code, time_interval_from_now)
File “/Users/b/Documents/Projects/jsonTimeSeriesGraphana/test_uploader/docker-container/get_json_from_cos_upload_to_influx.py”, line 487, in is_pcode_in
tables = list(self.client_influxdb.query_api().query(query, org=self.org))
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/client/query_api.py”, line 76, in query
response = self._query_api.post_query(org=org, query=self._create_query(query, self.default_dialect),
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/service/query_service.py”, line 260, in post_query
(data) = self.post_query_with_http_info(**kwargs) # noqa: E501
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/service/query_service.py”, line 340, in post_query_with_http_info
return self.api_client.call_api(
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/api_client.py”, line 340, in call_api
return self.__call_api(resource_path, method,
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/api_client.py”, line 170, in __call_api
response_data = self.request(
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/api_client.py”, line 385, in request
return self.rest_client.POST(url,
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/rest.py”, line 302, in POST
return self.request(“POST”, url,
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/influxdb_client/rest.py”, line 181, in request
r = self.pool_manager.request(
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/request.py”, line 78, in request
return self.request_encode_body(
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/request.py”, line 170, in request_encode_body
return self.urlopen(method, url, **extra_kw)
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/poolmanager.py”, line 375, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File “/Users/bskip/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 755, in urlopen
retries = retries.increment(
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/util/retry.py”, line 506, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/packages/six.py”, line 734, in reraise
raise value.with_traceback(tb)
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 699, in urlopen
httplib_response = self._make_request(
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 445, in _make_request
six.raise_from(e, None)
File “”, line 3, in raise_from
File “/Users/b/PycharmProjects/pyJsonInfluxDbClient/venv/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 440, in _make_request
httplib_response = conn.getresponse()
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”, line 1347, in getresponse
response.begin()
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”, line 307, in begin
version, status, reason = self._read_status()
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py”, line 276, in _read_status
raise RemoteDisconnected(“Remote end closed connection without”
urllib3.exceptions.ProtocolError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’))

========================= error write method
raise ApiException(http_resp=r)
influxdb_client.rest.ApiException: (500)
Reason: Internal Server Error
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Mon, 23 Nov 2020 11:18:47 GMT’, ‘Content-Type’: ‘application/json; charset=utf-8’, ‘Content-Length’: ‘160’, ‘Connection’: ‘keep-alive’, ‘X-Platform-Error-Code’: ‘internal error’})
HTTP response body: {“code”:“internal error”,“message”:“unexpected error writing points to database: partial write: series type mismatch: already Integer but got String dropped=3”}

Hi @sboris,

the problem is in mismatch types of your data.

How your data to write looks like?

Regards

1 Like

Hi @bednar,
I saw mismatch error message, but I have no mismatch in my json. My fields are only integer and the error message looks strange. That is the problem.
{
“measurement”: str(measurement),
“time”: str(date_isoformat),
“tags”: {
“code”: int(code),
“name”: str(name)
},
“fields”: {
“field1”: 0,
“field2”: 0,
“field3”: 0,
“field4”: 0,
“field5”: int(value1),
“field6”: int(value2)
}
}

It could be caused by existing data. Do you already have data in your measurement?

Also, the tags value should be string, use: “code”: str(code),

The exception occurs in both cases: writing to empty bucket for the first time and during appending to existing bucket.

Also, the tags value should be string, use: “code”: str(code),

Will try.
Thank you.

InfluxDBClient("http://localhost:8086", token="my-token", debug=True)

Could you share a debug output of client?

influxdb_issue.txt (137.5 KB)
The output is for the case of filling missing time entries in datasets…

Thanks for debug output, but there is no issue like:

{“code”:“internal error”,“message”:“unexpected error writing points to database: partial write: series type mismatch: already Integer but got String dropped=3”}

The exception Remote end closed connection without response looks like a network problem.

Regards

1 Like

The case is reproducible locally on MacOS and in the cloud k8s pod docker container on debian 10. Networks are completely different, except the route to influxdb. Any ideas?

BR

Do you use the latest RC? How much data do you need writes?

Check this Hardware sizing guidelines - Hardware sizing guidelines | InfluxDB OSS 1.8 Documentation

Could you share how your code looks like?

2 Likes