Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-704218: OperationalError: 250001: Could not connect to Snowflake backend after 0 attempt(s).Aborting #1364

Closed
KevnBlack opened this issue Dec 2, 2022 · 12 comments

Comments

@KevnBlack
Copy link

KevnBlack commented Dec 2, 2022

  1. What version of Python are you using?

    Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]

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

    Windows-10-10.0.22621-SP0 AMD64

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

aiohttp                       3.8.1
aiosignal                     1.2.0Note: you may need to restart the kernel to use updated packages.
alabaster                     0.7.12

anaconda-client               1.9.0
anaconda-navigator            2.3.1
anaconda-project              0.10.2
anyio                         3.5.0
appdirs                       1.4.4
argon2-cffi                   21.3.0
argon2-cffi-bindings          21.2.0
arrow                         1.2.2
asn1crypto                    1.5.1
astroid                       2.6.6
astropy                       5.0.4
asttokens                     2.0.5
async-timeout                 4.0.1
atomicwrites                  1.4.0
attrs                         21.4.0
Automat                       20.2.0
autopep8                      1.6.0
Babel                         2.9.1
backcall                      0.2.0
backports.functools-lru-cache 1.6.4
backports.tempfile            1.0
backports.weakref             1.0.post1
bcrypt                        3.2.0
beautifulsoup4                4.11.1
binaryornot                   0.4.4
bitarray                      2.4.1
bkcharts                      0.2
black                         19.10b0
bleach                        4.1.0
bokeh                         2.4.2
boto3                         1.21.32
botocore                      1.24.32
Bottleneck                    1.3.4
brotlipy                      0.7.0
bs4                           0.0.1
cachetools                    4.2.2
certifi                       2022.9.24
cffi                          1.15.1
chardet                       4.0.0
charset-normalizer            2.1.1
click                         8.0.4
cloudpickle                   2.0.0
clyent                        1.2.2
colorama                      0.4.4
colorcet                      2.0.6
comtypes                      1.1.10
conda                         22.9.0
conda-build                   3.21.8
conda-content-trust           0+unknown
conda-pack                    0.6.0
conda-package-handling        1.8.1
conda-repo-cli                1.0.4
conda-token                   0.3.0
conda-verify                  3.4.2
constantly                    15.1.0
cookiecutter                  1.7.3
cryptography                  38.0.4
cssselect                     1.1.0
cycler                        0.11.0
Cython                        0.29.28
cytoolz                       0.11.0
daal4py                       2021.5.0
dask                          2022.2.1
datashader                    0.13.0
datashape                     0.5.4
debugpy                       1.5.1
decorator                     5.1.1
defusedxml                    0.7.1
diff-match-patch              20200713
distributed                   2022.2.1
docutils                      0.17.1
entrypoints                   0.4
et-xmlfile                    1.1.0
executing                     0.8.3
fastjsonschema                2.15.1
filelock                      3.8.0
flake8                        3.9.2
Flask                         1.1.2
fonttools                     4.25.0
frozenlist                    1.2.0
fsspec                        2022.2.0
future                        0.18.2
gensim                        4.1.2
glob2                         0.7
google-api-core               1.25.1
google-auth                   1.33.0
google-cloud-core             1.7.1
google-cloud-storage          1.31.0
google-crc32c                 1.1.2
google-resumable-media        1.3.1
googleapis-common-protos      1.53.0
greenlet                      1.1.1
grpcio                        1.42.0
h5py                          3.6.0
HeapDict                      1.0.1
holoviews                     1.14.8
html5lib                      1.1
hvplot                        0.7.3
hyperlink                     21.0.0
ibm-db                        3.1.3
idna                          3.4
imagecodecs                   2021.8.26
imageio                       2.9.0
imagesize                     1.3.0
importlib-metadata            4.11.3
incremental                   21.3.0
inflection                    0.5.1
iniconfig                     1.1.1
intake                        0.6.5
intervaltree                  3.1.0
ipykernel                     6.9.1
ipython                       8.2.0
ipython-genutils              0.2.0
ipywidgets                    7.6.5
isort                         5.9.3
itemadapter                   0.3.0
itemloaders                   1.0.4
itsdangerous                  2.0.1
jdcal                         1.4.1
jedi                          0.18.1
Jinja2                        2.11.3
jinja2-time                   0.2.0
jmespath                      0.10.0
joblib                        1.1.0
json5                         0.9.6
jsonschema                    4.4.0
jupyter                       1.0.0
jupyter-client                6.1.12
jupyter-console               6.4.0
jupyter-core                  4.9.2
jupyter-server                1.13.5
jupyterlab                    3.3.2
jupyterlab-pygments           0.1.2
jupyterlab-server             2.10.3
jupyterlab-widgets            1.0.0
keyring                       23.4.0
kiwisolver                    1.3.2
lazy-object-proxy             1.6.0
libarchive-c                  2.9
llvmlite                      0.38.0
locket                        0.2.1
lxml                          4.8.0
Markdown                      3.3.4
MarkupSafe                    2.0.1
matplotlib                    3.5.1
matplotlib-inline             0.1.2
mccabe                        0.6.1
menuinst                      1.4.18
mistune                       0.8.4
mkl-fft                       1.3.1
mkl-random                    1.2.2
mkl-service                   2.4.0
mock                          4.0.3
mpmath                        1.2.1
msgpack                       1.0.2
multidict                     5.1.0
multipledispatch              0.6.0
munkres                       1.1.4
mypy-extensions               0.4.3
natsort                       8.2.0
navigator-updater             0.2.1
nbclassic                     0.3.5
nbclient                      0.5.13
nbconvert                     6.4.4
nbformat                      5.3.0
nest-asyncio                  1.5.5
networkx                      2.7.1
nltk                          3.7
nose                          1.3.7
notebook                      6.4.8
numba                         0.55.1
numexpr                       2.8.1
numpy                         1.21.5
numpydoc                      1.2
olefile                       0.46
openpyxl                      3.0.9
oscrypto                      1.3.0
packaging                     21.3
pandas                        1.4.2
pandocfilters                 1.5.0
panel                         0.13.0
param                         1.12.0
paramiko                      2.8.1
parsel                        1.6.0
parso                         0.8.3
partd                         1.2.0
pathspec                      0.7.0
patsy                         0.5.2
pep8                          1.7.1
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.0.1
pip                           21.2.4
pkginfo                       1.8.2
plotly                        5.6.0
pluggy                        1.0.0
poyo                          0.5.0
prometheus-client             0.13.1
prompt-toolkit                3.0.20
Protego                       0.1.16
protobuf                      3.19.1
psutil                        5.8.0
ptyprocess                    0.7.0
pure-eval                     0.2.2
py                            1.11.0
pyarrow                       8.0.0
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pycodestyle                   2.7.0
pycosat                       0.6.3
pycparser                     2.21
pycryptodomex                 3.16.0
pyct                          0.4.6
pycurl                        7.44.1
pydantic                      1.10.2
PyDispatcher                  2.0.5
pydocstyle                    6.1.1
pyerfa                        2.0.0
pyflakes                      2.3.1
Pygments                      2.11.2
PyHamcrest                    2.0.2
PyJWT                         2.6.0
pylint                        2.9.6
pyls-spyder                   0.4.0
PyNaCl                        1.4.0
pyodbc                        4.0.32
pyOpenSSL                     22.1.0
pyparsing                     3.0.4
pyqtdarktheme                 1.2.1
pyreadline                    2.1
pyrsistent                    0.18.0
PySocks                       1.7.1
pytest                        7.1.1
python-dateutil               2.8.2
python-lsp-black              1.0.0
python-lsp-jsonrpc            1.0.0
python-lsp-server             1.2.4
python-slugify                5.0.2
python-snappy                 0.6.0
pytz                          2022.6
pyviz-comms                   2.0.2
PyWavelets                    1.3.0
pywin32                       302
pywin32-ctypes                0.2.0
pywinpty                      2.0.2
PyYAML                        6.0
pyzmq                         22.3.0
QDarkStyle                    3.0.2
qstylizer                     0.1.10
qt-material                   2.12
QtAwesome                     1.0.3
qtconsole                     5.3.0
QtPy                          2.0.1
queuelib                      1.5.0
redshift-connector            2.0.909
regex                         2022.3.15
requests                      2.28.1
requests-file                 1.5.1
rope                          0.22.0
rsa                           4.7.2
Rtree                         0.9.7
ruamel-yaml-conda             0.15.100
s3transfer                    0.5.0
scikit-image                  0.19.2
scikit-learn                  1.0.2
scikit-learn-intelex          2021.20220215.102710
scipy                         1.7.3
scramp                        1.4.1
Scrapy                        2.6.1
seaborn                       0.11.2
Send2Trash                    1.8.0
sentry-sdk                    1.9.10
service-identity              18.1.0
setuptools                    61.2.0
sip                           4.19.13
six                           1.16.0
smart-open                    5.1.0
sniffio                       1.2.0
snowballstemmer               2.2.0
snowflake-connector-python    2.8.3
sortedcollections             2.1.0
sortedcontainers              2.4.0
soupsieve                     2.3.1
Sphinx                        4.4.0
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
spyder                        5.1.5
spyder-kernels                2.1.3
SQLAlchemy                    1.4.32
stack-data                    0.2.0
statsmodels                   0.13.2
sympy                         1.10.1
tables                        3.6.1
tabulate                      0.8.9
TBB                           0.2
tblib                         1.7.0
tenacity                      8.0.1
terminado                     0.13.1
testpath                      0.5.0
text-unidecode                1.3
textdistance                  4.2.1
threadpoolctl                 2.2.0
three-merge                   0.1.1
tifffile                      2021.7.2
tinycss                       0.4
tldextract                    3.2.0
toml                          0.10.2
tomli                         1.2.2
toolz                         0.11.2
tornado                       6.1
tqdm                          4.64.0
traitlets                     5.1.1
Twisted                       22.2.0
twisted-iocpsupport           1.0.2
typed-ast                     1.4.3
typing_extensions             4.4.0
ujson                         5.1.0
Unidecode                     1.2.0
urllib3                       1.26.13
w3lib                         1.21.0
watchdog                      2.1.6
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              0.58.0
Werkzeug                      2.0.3
wheel                         0.37.1
widgetsnbextension            3.5.2
win-inet-pton                 1.1.0
win-unicode-console           0.5
wincertstore                  0.2
wrapt                         1.12.1
xarray                        0.20.1
xlrd                          2.0.1
XlsxWriter                    3.0.3
xlwings                       0.24.9
yapf                          0.31.0
yarl                          1.6.3
zict                          2.0.0
zipp                          3.7.0
zope.interface                5.4.0
  1. What did you do?
import snowflake.connector

# Gets the version
ctx = snowflake.connector.connect(
    user='kblackMB2',
    password=**************,
    account='VQFSBGN.KE53115'
    )
cs = ctx.cursor()
try:
    cs.execute("SELECT current_version()")
    one_row = cs.fetchone()
    print(one_row[0])
finally:
    cs.close()
ctx.close()
  1. What did you expect to see?

    A successful query execution that returns the current version of Snowflake, which should be 6.39.0.

  2. Can you set logging to DEBUG and collect the logs?
    Log attached due to GitHub character limit.
    snowflake_log.txt

@github-actions github-actions bot changed the title OperationalError: 250001: Could not connect to Snowflake backend after 0 attempt(s).Aborting SNOW-704218: OperationalError: 250001: Could not connect to Snowflake backend after 0 attempt(s).Aborting Dec 2, 2022
@sfc-gh-stan
Copy link
Contributor

Hi @KevnBlack , looks like the client is unable to connect to Snowflake due to mismatched certificate hostname:

Hit non-retryable SSL error, HTTPSConnectionPool(host='vqfsbgn.ke53115.snowflakecomputing.com', port=443): Max retries exceeded with url: /session/v1/login-request?request_id=fa39bdd6-d904-4f80-9960-a0e4075a9513&request_guid=80478788-ced2-4439-a410-8e37a5129e63 (Caused by SSLError(CertificateError("hostname 'vqfsbgn.ke53115.snowflakecomputing.com' doesn't match either of '*.prod3.us-west-2.snowflakecomputing.com', '*.us-west-2.snowflakecomputing.com', '*.global.snowflakecomputing.com', '*.snowflakecomputing.com', '*.prod3.us-west-2.aws.snowflakecomputing.com'")))

Could you please double check if you are specifying the correct account?

@KevnBlack
Copy link
Author

@sfc-gh-stan I believe so, when copying the account identifier from app.snowflake.com, it pastes "VQFSBGN.KE53115"
image

@sfc-gh-stan
Copy link
Contributor

You locator is OF79063, could you please try OF79063.snowflakecomputing.com?

@KevnBlack
Copy link
Author

Using that as the account returns the same 250001 error unfortunately.

@sfc-gh-stan
Copy link
Contributor

Hi @KevnBlack , 250001 is a general error code, is the underlying error still SSLError(CertificateError("hostname ...? Also, is VQFSBGN the organization name and KE53115 the account name? If so, could you please try VQFSBGN-KE53115?

@KevnBlack
Copy link
Author

@sfc-gh-stan Hey that worked! Turns out you needed a "-" instead of a "." like what some people have suggested online. Thanks Sophie, successfully returned 6.39.0.

@ZahraMalwi
Copy link

Hello @sfc-gh-stan I am facing the same error and I am using the correct orgname-accountname in my conf file. I read that it might be an OCSP issue and so I used -o insecure_mode=True to surpass that but I still get "250003: 250003: Failed to get the response" , which is followed by "250001: 250001: Could not connect to Snowflake backend after 0 attempt(s)". I really need to get past this, please help.

@iamanimesh11
Copy link

same issue with me ZahraMalwi . got any solution???

@wesmadrigal
Copy link

@sfc-gh-stan thanks for the answer! It's funny that the copy identifier button on Snowflake UI gives a '.' separated string instead of a hyphen separated one...

@ksingh225
Copy link

Sorry not clear @sfc-gh-stan , Can you please give steps to find copy identifier on Snowflake UI . I am also getting same issue

@sfc-gh-dszmolka
Copy link
Contributor

sfc-gh-dszmolka commented Aug 23, 2024

hi folks, so a little recap.
250001: 250001: Could not connect to Snowflake backend after 0 attempt(s)" means "well i could not connect to Snowflake for some reason"

This is not really helpful in itself :) that's why we frequently recommend to enable debug level logs, repeat the connection attempt, then look into the debug logs. It usually provides vast amount of details to at least start the investigation.

If you're not comfortable doing to yourself, and of course sharing it here for the public to see, you can always open a Snowflake Support case to work with a support engineer 1:1. You can do so from the GUI without logging into anywhere.

Also there's no guarantee anyone will look at a Closed issue from two years back, i'm afraid. So if you have an issue which you feel it's coming from the PythonConnector (this library), and not some network connectivity or misconfiguration issue, please open a new Issue. Thank you !

What is your account identifier: go to GUI -> click on your username bottom-left -> click Account -> mouseover your account name, another frame opens -> in this new frame, click on 'Copy account identifier' -> ⚠️ replace the . with - in the copied identifier ⚠️

image

Example: it will copy MYORG.MYACCOUNT after clicking the button. The correct format is MYORG-MYACCOUNT.
(also use this in your PythonConnector connection string. With the . it will surely fail to connect.)

Read more about how Snowflake account identifiers are constructed.

Hope this helps.

@pedrojrv
Copy link

pedrojrv commented Oct 4, 2024

Same as above.

I got the same stacktrace and same error with ssl certificate verify failed.

For me it was nothing related to SSL. When you copy your account from snowflake it introduces a dot (e.g., FDA3FS.AFDSA), I had to insert a dash instead (e.g., FDA3FS-AFDSA). Afterwards, we use private links in our org so we literally had to add privatelink so at the end, this is what worked for me (e.g., FDA3FS-AFDSA.privatelink)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants