snowflake-connector-python: SNOW-743167: KeyError: 'message'

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    python 3.9

  2. What operating system and processor architecture are you using?

    macos arm64

  3. What are the component versions in the environment (pip freeze)?

    snowflake-connector-python==3.0.0

  4. What did you do?

conn = snowflake.connector.connect(
...
    )
cur = conn.cursor()

Wait a while and then run

cur.execute("USE DATABASE db1; CREATE TABLE foobar (ID int)")

Error:

File ~/code/myapp/.venv/lib/python3.9/site-packages/snowflake/connector/cursor.py:813, in SnowflakeCursor.execute(self, command, params, _bind_stage, timeout, _exec_async, _no_retry, _do_reset, _put_callback, _put_azure_callback, _put_callback_output_stream, _get_callback, _get_azure_callback, _get_callback_output_stream, _show_progress_bar, _statement_params, _is_internal, _describe_only, _no_results, _is_put_get, _raise_put_get_error, _force_put_overwrite, file_stream, num_statements)
    809 self._total_rowcount = (
    810     ret["data"]["total"] if "data" in ret and "total" in ret["data"] else -1
    811 )
    812 logger.debug(ret)
--> 813 err = ret["message"]
    814 code = ret.get("code", -1)
    815 if "data" in ret:

KeyError: 'message'
  1. What did you expect to see?

No error

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

Awesome. I see what’s causing the problem for your case @tekumara and I am working on a fix.

For @s-banach, @rkaufman13 could you also add debug logs similar to original post so I can find root cause for your issues too. I want to confirm if they are arising due to expiration of master token

Experiencing a similar issue, but with key ‘success’. Relevant stacktrace:

cursor.execute(\n File \"/usr/local/lib/python3.9/site-packages/snowflake/connector/cursor.py\", line 573, in execute\n if ret['success']:\nKeyError: 'success'", "level": "ERROR"