Failed to parse response from streaming client
See original GitHub issueCode Sample
ingestion_properties = IngestionProperties(
database="MyDB",
table="MyTable",
dataFormat=DataFormat.MULTIJSON,
reportLevel=ReportLevel.FailuresAndSuccesses,
ingestionMappingReference="TestMapping"
)
data = [{}, {}, ..., {}] # list of dicts
stream = BytesIO("\n".join([json.dumps(d) for d in data]).encode("utf-8"))
client.ingest_from_stream(stream, ingestion_properties=ingestion_properties)
Problem description
Ingestion is failing for some reason but why is hard to debug since the response coming from the API is not able to be parsed as a JSON.
Traceback
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\azure\kusto\ingest\_streaming_ingest_client.py", line 112, in ingest_from_stream
mapping_name=ingestion_properties.ingestion_mapping_reference,
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\azure\kusto\data\request.py", line 434, in execute_streaming_ingest
self._execute(endpoint, database, None, stream, KustoClient._streaming_ingest_default_timeout, properties)
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\azure\kusto\data\request.py", line 478, in _execute
raise KustoServiceError([response.json()], response)
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\json\__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Output of pip freeze
adal==1.2.2 astroid==2.3.2 attrs==19.3.0 azure-common==1.1.23 azure-core==1.0.0 azure-functions==1.0.5 azure-kusto-data==0.0.38 azure-kusto-ingest==0.0.38 azure-storage-blob==2.1.0 azure-storage-common==2.1.0 azure-storage-queue==2.1.0 backcall==0.1.0 bleach==3.1.0 certifi==2019.9.11 cffi==1.13.1 chardet==3.0.4 colorama==0.4.1 cryptography==2.8 cycler==0.10.0 decorator==4.4.0 defusedxml==0.6.0 entrypoints==0.3 fastavro==0.22.7 filelock==3.0.12 idna==2.8 importlib-metadata==0.23 ipykernel==5.1.3 ipython==7.8.0 ipython-genutils==0.2.0 ipywidgets==7.5.1 isodate==0.6.0 isort==4.3.21 jedi==0.15.1 Jinja2==2.10.3 jsonschema==3.1.1 jupyter==1.0.0 jupyter-client==5.3.4 jupyter-console==6.0.0 jupyter-core==4.6.0 jupyterthemes==0.20.0 kiwisolver==1.1.0 lazy-object-proxy==1.4.2 lesscpy==0.13.0 MarkupSafe==1.1.1 matplotlib==3.1.1 mccabe==0.6.1 memory-profiler==0.55.0 mistune==0.8.4 more-itertools==7.2.0 msrest==0.6.10 nbconvert==5.6.0 nbformat==4.4.0 notebook==6.0.1 numpy==1.17.3 oauthlib==3.1.0 packaging==19.2 pandocfilters==1.4.2 parso==0.5.1 pickleshare==0.7.5 pipenv==2018.11.26 pluggy==0.13.0 ply==3.11 prometheus-client==0.7.1 prompt-toolkit==2.0.10 psutil==5.6.3 psycopg2==2.8.4 py==1.8.0 pycparser==2.19 Pygments==2.4.2 PyJWT==1.7.1 pylint==2.4.3 pyparsing==2.4.2 pyrsistent==0.15.4 python-dateutil==2.8.0 pywin32==225 pywinpty==0.5.5 pyzmq==18.1.0 qtconsole==4.5.5 requests==2.22.0 requests-oauthlib==1.2.0 Send2Trash==1.5.0 six==1.12.0 terminado==0.8.2 testpath==0.4.2 toml==0.10.0 tornado==6.0.3 tox==3.14.0 traitlets==4.3.3 typed-ast==1.4.0 urllib3==1.25.6 virtualenv==16.7.5 virtualenv-clone==0.5.3 wcwidth==0.1.7 webencodings==0.5.1 widgetsnbextension==3.5.1 wrapt==1.11.2 zipp==0.6.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top GitHub Comments
Hi @cjbackman,
You can mail me at aryehezk@microsoft.com. Please attach your cluster details and code sample which generates the error.
Thanks, Ariel
For the record:
<cluster_name>.<region>
and notingest-<cluster_name>.<region>
as the ingest_client use.To learn more about streaming ingest and how to enable it, see the docs