Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Bug: Unicode in xblocks causes errors sending to Clickhouse #22

Closed
bmtcril opened this issue Aug 3, 2023 · 0 comments · Fixed by #23
Closed

Bug: Unicode in xblocks causes errors sending to Clickhouse #22

bmtcril opened this issue Aug 3, 2023 · 0 comments · Fixed by #23

Comments

@bmtcril
Copy link
Contributor

bmtcril commented Aug 3, 2023

2023-08-03 08:56:17 Traceback (most recent call last):
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/celery/app/trace.py", line 451, in trace_task
2023-08-03 08:56:17     R = retval = fun(*args, **kwargs)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/celery/app/trace.py", line 734, in __protected_call__
2023-08-03 08:56:17     return self.run(*args, **kwargs)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/edx_django_utils/monitoring/internal/code_owner/utils.py", line 193, in new_function
2023-08-03 08:56:17     return wrapped_function(*args, **kwargs)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/event_sink_clickhouse/tasks.py", line 30, in dump_course_to_clickhouse
2023-08-03 08:56:17     sink.dump(course_key)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/event_sink_clickhouse/sinks/course_published.py", line 321, in dump
2023-08-03 08:56:17     self._send_xblocks(serialized_blocks)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/event_sink_clickhouse/sinks/course_published.py", line 278, in _send_xblocks
2023-08-03 08:56:17     self._send_clickhouse_request(request, expected_insert_rows=len(serialized_xblocks))
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/event_sink_clickhouse/sinks/base_sink.py", line 42, in _send_clickhouse_request
2023-08-03 08:56:17     response = session.send(prepared_request, timeout=self.ch_timeout_secs)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/requests/sessions.py", line 701, in send
2023-08-03 08:56:17     r = adapter.send(request, **kwargs)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/requests/adapters.py", line 489, in send
2023-08-03 08:56:17     resp = conn.urlopen(
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
2023-08-03 08:56:17     httplib_response = self._make_request(
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 398, in _make_request
2023-08-03 08:56:17     conn.request(method, url, **httplib_request_kw)
2023-08-03 08:56:17   File "/openedx/venv/lib/python3.8/site-packages/urllib3/connection.py", line 244, in request
2023-08-03 08:56:17     super(HTTPConnection, self).request(method, url, body=body, headers=headers)
2023-08-03 08:56:17   File "/opt/pyenv/versions/3.8.15/lib/python3.8/http/client.py", line 1256, in request
2023-08-03 08:56:17     self._send_request(method, url, body, headers, encode_chunked)
2023-08-03 08:56:17   File "/opt/pyenv/versions/3.8.15/lib/python3.8/http/client.py", line 1301, in _send_request
2023-08-03 08:56:17     body = _encode(body, 'body')
2023-08-03 08:56:17   File "/opt/pyenv/versions/3.8.15/lib/python3.8/http/client.py", line 164, in _encode
2023-08-03 08:56:17     raise UnicodeEncodeError(
2023-08-03 08:56:17 UnicodeEncodeError: 'latin-1' codec can't encode character '\u2022' in position 27805: Body ('•') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant