snowflakedb / snowflakedb/snowflake-connector-python

SNOW-3984430: Missing retries for OAuth authentication

Open
#3,003 1 comment 0 reactions 1 assignee View on GitHub

@sfc-gh-snow-drivers-warsaw-dl is already working on this.

Since Aug 22, 2026.

bug status-triage_done
Dominant language
Python
Stars
730
Forks
574
Avg merge
5h 45m
Merged PRs (30d)
16

Description

Python version

3.14

Operating system and processor architecture

linux-64

Installed packages
does not matter
What did you do?

Using SnowflakeConnection with authenticator=OAUTH_CLIENT_CREDENTIALS does not retry (temporary) failures in the HTTP requests that obtain the access token from the configured oauth_token_request_url.

Such retries do exist in nearby code paths; see retry loop in SnowflakeConnection._authenticate, e.g. here:
https://github.com/snowflakedb/snowflake-connector-python/blob/869bcf91d08f69e29c34550a04a59baaa1b1279c/src/snowflake/connector/connection.py#L2083-L2092

So I think this is a bug. This call to auth_instance.prepare which does the request should also be covered in a retry loop:
https://github.com/snowflakedb/snowflake-connector-python/blob/869bcf91d08f69e29c34550a04a59baaa1b1279c/src/snowflake/connector/connection.py#L2048

What did you expect to see?

Retries in case of temporary failures.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.