1

I used to use Snowflake Connector in Python and MFA with Duo Mobile and push notifications without any problems. But after changing my smartphone to a new one, I can only use SMS and call authentification with Duo Mobile.

So now, in order to use Snowflake Connector with SMS authentification (which provides a passcode), I add the "passcode" parameter as I found on Python Connector API

I use the second parameter "passcode": Passcode parameters

This results in an error:

Error connection BDD Snowflake 250001 (08001) ... Incorrect passcode was specified.

Is it normal that I have to provide a passcode via the connector even if I have not received an SMS? (The passcode in parameter is the last one I received...)

I haven't found a solution to access Snowflake with Python, so if any one has an idea, that would be great.

7
  • 1
    You are adding passcode on top of the password parameter, right? Both need to be present. Also, the error code for Incorrect passcode was specified should be 390127 and not the one you get. Are you able to generate the connector log and provide a snippet from there? Commented Nov 4, 2021 at 10:06
  • Yeah I use both passcode and password parameters. self.connection = snowflake.connector.connect(user=user, password=password, account=account, role=role, warehouse=warehouse, database=database, passcode=passcode) I have not been able to use "logging" library as in your link, but I use this one "utils.utils_log". ERROR: 250001 (08001): Failed to connect to DB: xxxx.snowflakecomputing.com:XX. Incorrect passcode was specified. Commented Nov 4, 2021 at 12:00
  • I see indeed the error is mapped to that error code in the latest releases of Python connector. Are you able to login to Snowflake UI using that SMS code? Commented Nov 4, 2021 at 13:18
  • I am able to login to Snowflake using browser. After I entered login and password, I choose to receive a passcode via SMS (older passcodes are invalids). I received an SMS with new passcode which is working. Commented Nov 4, 2021 at 16:03
  • I tried something and it partially works. I asked a passcode via SMS via browser after login, and didn't using it for the browser but instead use it for my Python script and it's working. So the problem seems to be that I need to receive a new passcode via SMS when I'm using my Python script with the API. For the moment, I can only enter passcode in parameter. Someone knows how to do it? Commented Nov 4, 2021 at 16:04

1 Answer 1

0

You will always need to enter a valid passcode when using your Python script with the API. Otherwise, it will not work. Regarding the DUO Mobile push that stopped working on the new phone, please raise a Snowflake Support ticket to get the new phone re-enrol with the DUO push.

Sign up to request clarification or add additional context in comments.

2 Comments

I tried with my administrator to re-enrol the new phone but without success... He already had the problem with another person with last android phone. For now I will use Snowflake on web browser to ask the passcode and then use it with Python Thanks for your answer!
There is a fix that recently got deployed by Snowflake. You need to contact the Snowflake Support team to get them to enable the fix for your Snowflake account. Once enabled, you will be able to re-enroll the new phone with DUO App.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.