microsoft / jupyter-Kqlmagic

Extension (Magic) to Jupyter notebook and Jupyter lab, that enable notebook experience working with Kusto, ApplicationInsights, and LogAnalytics data.
Other
85 stars 31 forks source link

Kqlmagic bug report #4837d071-e5e7-4dc5-af3a-19d185dc78ba #81

Closed slowlyswimming closed 2 years ago

slowlyswimming commented 2 years ago

Please copy the bug report from the notebook and paste it to the template below

BEFORE YOU SUBMIT IT, MAKE SURE THAT ANY SENSITIVE INFORMATION IS OBFUSCATED

Query from certain table of my database failed with following error: ChunkedEncodingError: ("Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)", ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

{
    "Kqlmagic_last_execution": {
        "args": {
            "cell": "",
            "line": "",
            "override_connection": null,
            "override_options": null,
            "override_query_properties": null,
            "override_result_set": null,
            "override_vars": null
        },
        "connection": "",
        "error": "(\"Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)\", ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))",
        "log": [
            "Kqlmagic_core::execute - input: ",
            "Kqlmagic_core::execute - parsed_queries: [{'connection_string': '', 'query': '', 'options': {'auto_dataframe': False, 'short_errors': True, 'feedback': True, 'show_conn_info': 'current', 'columns_to_local_vars': False, 'show_query_time': True, 'show_query': False, 'show_query_link': False, 'query_link_destination': 'Kusto.WebExplorer', 'enable_suppress_result': True, 'plotly_fs_includejs': False, 'popup_window': False, 'auto_limit': 0, 'display_limit': None, 'timeout': 1800, 'prettytable_style': 'DEFAULT', 'last_raw_result_var': '_kql_raw_result_', 'table_package': 'prettytable', 'plot_package': 'plotly', 'dsn_filename': 'odbc.ini', 'validate_connection_string': True, 'auto_popup_schema': True, 'json_display': 'formatted', 'schema_json_display': 'auto', 'palette_desaturation': 1.0, 'params_dict': None, 'palette_name': 'tab10', 'cache': None, 'use_cache': None, 'temp_folder_name': 'temp_files', 'cache_folder_name': 'cache_files', 'export_folder_name': 'exported_files', 'add_kql_ref_to_help': True, 'add_schema_to_help': True, 'notebook_app': 'azuremljupyternotebook', 'debug': False, 'check_magic_version': True, 'show_what_new': True, 'show_init_banner': True, 'warn_missing_dependencies': True, 'warn_missing_env_variables': True, 'allow_single_line_cell': True, 'allow_py_comments_before_cell': True, 'kqlmagic_kernel': False, 'extras_require': 'default', 'test_notebook_app': 'none', 'cloud': 'public', 'enable_sso': False, 'sso_db_gc_interval': 168, 'try_azcli_login': False, 'try_azcli_login_by_profile': False, 'try_vscode_login': False, 'try_azcli_login_subscription': None, 'try_token': None, 'try_msi': None, 'request_id_tag': None, 'request_app_tag': None, 'request_user_tag': None, 'request_cache_max_age': 0, 'device_code_login_notification': 'auto', 'device_code_notification_email': '', 'save_as': None, 'save_to': None, 'query_properties': {}, 'palette_colors': 10, 'palette_reverse': False, 'popup_schema': False, 'display_id': False, 'display_handlers': {'acquire_token': None, 'conn_info': None, 'table_or_chart': None, 'feedback_info': None}, 'popup_interaction': 'auto', 'temp_files_server': 'auto', 'temp_files_server_address': None, 'kernel_location': 'remote', 'kernel_id': 'fe56cb3f-f93a-4e63-99b0-df2467e6c795', 'notebook_service_address': None, 'dynamic_to_dataframe': 'object', 'temp_folder_location': 'starting_dir', 'plotly_layout': None, 'auth_token_warnings': False, 'enable_curly_brackets_params': False, 'nop': False, 'assign_var': None, 'cursor_var': None, 'is_magic': True, 'code_auth_interactive_mode': 'device_code'}, 'command': {}, 'last_query': True}]",
            "Account(s) exists in cache, probably with token too. Let's try.",
            "Account(s) exists in cache, probably with token too. Let's try.",
            "KustoClient::execute - POST request - url: https://KUSTO_DB/v2/rest/query, headers: {'Accept': 'application/json', 'Accept-Encoding': 'gzip,deflate', 'Content-Type': 'application/json; charset=utf-8', 'x-ms-client-version': 'Kqlmagic.Python.Client:0.1.114.post3', 'x-ms-client-request-id': 'Kqlmagic.execute;c1dd8a82-e964-4b43-9316-19feb187c1b4/466169e9-b351-4fb1-9dee-b27c86cd6f18/AzureDataExplorer', 'x-ms-app': 'Kqlmagic;azuremljupyternotebook', 'Authorization': '...', 'Fed': 'True', 'Cache-Control': 'no-cache'}, payload: {'db': 'DB_NAME', 'csl': 'QUERY_SCRIPT'}, timeout: 1800",
            "Kqlmagic_core::execute - failed - command: None param: None"
        ],
        "query": {
            "request": {
                "endpoint": "https://KUSTO_DB/v2/rest/query",
                "headers": {
                    "Accept": "application/json",
                    "Accept-Encoding": "gzip,deflate",
                    "Authorization": "...",
                    "Cache-Control": "no-cache",
                    "Content-Type": "application/json; charset=utf-8",
                    "Fed": "True",
                    "x-ms-app": "Kqlmagic;azuremljupyternotebook",
                    "x-ms-client-request-id": "Kqlmagic.execute;c1dd8a82-e964-4b43-9316-19feb187c1b4/466169e9-b351-4fb1-9dee-b27c86cd6f18/AzureDataExplorer",
                    "x-ms-client-version": "Kqlmagic.Python.Client:0.1.114.post3"
                },
                "timeout": 1800
            }
        },
        "traceback": [
            "Traceback (most recent call last):",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\urllib3\\response.py\", line 436, in _error_catcher",
            "    yield",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\urllib3\\response.py\", line 763, in read_chunked",
            "    self._update_chunk_length()",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\urllib3\\response.py\", line 693, in _update_chunk_length",
            "    line = self._fp.fp.readline()",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\socket.py\", line 669, in readinto",
            "    return self._sock.recv_into(b)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\ssl.py\", line 1241, in recv_into",
            "    return self.read(nbytes, buffer)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\ssl.py\", line 1099, in read",
            "    return self._sslobj.read(len, buffer)",
            "ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host",
            "",
            "During handling of the above exception, another exception occurred:",
            "",
            "Traceback (most recent call last):",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\requests\\models.py\", line 751, in generate",
            "    for chunk in self.raw.stream(chunk_size, decode_content=True):",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\urllib3\\response.py\", line 571, in stream",
            "    for line in self.read_chunked(amt, decode_content=decode_content):",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\urllib3\\response.py\", line 792, in read_chunked",
            "    self._original_response.close()",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\contextlib.py\", line 131, in __exit__",
            "    self.gen.throw(type, value, traceback)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\urllib3\\response.py\", line 454, in _error_catcher",
            "    raise ProtocolError(\"Connection broken: %r\" % e, e)",
            "urllib3.exceptions.ProtocolError: (\"Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)\", ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))",
            "",
            "During handling of the above exception, another exception occurred:",
            "",
            "Traceback (most recent call last):",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\Kqlmagic\\kql_magic_core.py\", line 1349, in _execute_query",
            "    raise e",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\Kqlmagic\\kql_magic_core.py\", line 1339, in _execute_query",
            "    raw_query_result = engine.execute(parametrized_query, user_ns, **options)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\Kqlmagic\\kql_engine.py\", line 221, in execute",
            "    response = self.client_execute(query, user_namespace, database, **options)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\Kqlmagic\\kql_engine.py\", line 216, in client_execute",
            "    return client.execute(database or self.get_client_database_name(), query, accept_partial_results=False, **options)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\Kqlmagic\\kusto_client.py\", line 284, in execute",
            "    response = requests.post(endpoint, headers=request_headers, json=request_payload, timeout=options.get(\"timeout\"))",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\requests\\api.py\", line 119, in post",
            "    return request('post', url, data=data, json=json, **kwargs)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\requests\\api.py\", line 61, in request",
            "    return session.request(method=method, url=url, **kwargs)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\requests\\sessions.py\", line 530, in request",
            "    resp = self.send(prep, **send_kwargs)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\requests\\sessions.py\", line 685, in send",
            "    r.content",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\requests\\models.py\", line 829, in content",
            "    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\requests\\models.py\", line 754, in generate",
            "    raise ChunkedEncodingError(e)",
            "requests.exceptions.ChunkedEncodingError: (\"Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)\", ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))",
            "",
            "During handling of the above exception, another exception occurred:",
            "",
            "Traceback (most recent call last):",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\Kqlmagic\\kql_magic_core.py\", line 840, in execute",
            "    result = self._execute_query(parsed, user_ns, result_set=override_result_set, override_vars=override_vars)",
            "  File \"C:\\Users\\USER_NAME_HIDDEN\\Anaconda3\\lib\\site-packages\\Kqlmagic\\kql_magic_core.py\", line 1476, in _execute_query",
            "    raise ShortError(e, messages)",
            "Kqlmagic.kql_magic_core.ShortError: (\"Connection broken: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)\", ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))"
        ]
    },
    "kqlmagic": {
        "version": "0.1.114.post3"
    },
    "kqlmagic_connections:": {

    },
    "kqlmagic_default_env": {},
    "kqlmagic_default_options": {
        "add_kql_ref_to_help": true,
        "add_schema_to_help": true,
        "allow_py_comments_before_cell": true,
        "allow_single_line_cell": true,
        "assign_var": null,
        "auth_token_warnings": false,
        "auto_dataframe": false,
        "auto_limit": 0,
        "auto_popup_schema": true,
        "cache": null,
        "cache_folder_name": "cache_files",
        "check_magic_version": true,
        "cloud": "public",
        "code_auth_interactive_mode": "device_code",
        "columns_to_local_vars": false,
        "cursor_var": null,
        "debug": false,
        "device_code_login_notification": "auto",
        "device_code_notification_email": "",
        "display_limit": null,
        "dsn_filename": "odbc.ini",
        "dynamic_to_dataframe": "object",
        "enable_curly_brackets_params": false,
        "enable_sso": false,
        "enable_suppress_result": true,
        "export_folder_name": "exported_files",
        "extras_require": "default",
        "feedback": true,
        "is_magic": true,
        "json_display": "formatted",
        "kernel_id": "fe56cb3f-f93a-4e63-99b0-df2467e6c795",
        "kernel_location": "remote",
        "kqlmagic_kernel": false,
        "last_raw_result_var": "_kql_raw_result_",
        "notebook_app": "azuremljupyternotebook",
        "notebook_service_address": null,
        "palette_colors": 10,
        "palette_desaturation": 1.0,
        "palette_name": "tab10",
        "plot_package": "plotly",
        "plotly_config": null,
        "plotly_fs_includejs": false,
        "plotly_layout": null,
        "popup_interaction": "auto",
        "prettytable_style": "DEFAULT",
        "query_link_destination": "Kusto.WebExplorer",
        "request_app_tag": null,
        "request_cache_max_age": 0,
        "request_id_tag": null,
        "request_user_tag": null,
        "schema_json_display": "auto",
        "short_errors": true,
        "show_conn_info": "current",
        "show_init_banner": true,
        "show_query": false,
        "show_query_link": false,
        "show_query_time": true,
        "show_what_new": true,
        "sso_db_gc_interval": 168,
        "table_package": "prettytable",
        "temp_files_server": "auto",
        "temp_files_server_address": null,
        "temp_folder_location": "starting_dir",
        "temp_folder_name": "temp_files",
        "test_notebook_app": "none",
        "timeout": 1800,
        "try_azcli_login": false,
        "try_azcli_login_by_profile": false,
        "try_azcli_login_subscription": null,
        "try_kqlmaic_sso": false,
        "try_msi": null,
        "try_token": null,
        "try_vscode_login": false,
        "use_cache": null,
        "validate_connection_string": true,
        "warn_missing_dependencies": true,
        "warn_missing_env_variables": true
    },
    "packages": {
        "azure-common": "1.1.26",
        "azure-identity": "1.7.1",
        "beautifulsoup4": "4.9.3",
        "cryptography": "3.1.1",
        "flask": "1.1.2",
        "ipykernel": "5.3.4",
        "ipython": "7.19.0",
        "ipywidgets": "7.5.1",
        "isodate": "0.6.0",
        "lxml": "4.6.1",
        "markdown": "3.3.6",
        "matplotlib": "3.5.0",
        "msal": "1.16.0",
        "msal_extensions": "0.3.0",
        "msrestazure": "0.6.4",
        "pandas": "1.1.3",
        "password_strength": "0.0.3.post2",
        "plotly": "5.4.0",
        "prettytable": "2.4.0",
        "psutil": "5.7.2",
        "pygments": "2.7.2",
        "pyperclip": "1.8.2",
        "python-dateutil": "2.8.1",
        "requests": "2.24.0",
        "setuptools": "50.3.1.post20201107",
        "traitlets": "5.0.5"
    },
    "platform": {
        "release": "10",
        "system": "Windows"
    },
    "python": {
        "name": "CPython",
        "version": "3.8.5"
    }
}
mbnshtck commented 2 years ago

probably due to server timeout