snowskeleton / ynam

Mint-to-YNAB translator
Apache License 2.0
38 stars 0 forks source link

Stuck on Mint authentication #39

Open BagMan9 opened 1 year ago

BagMan9 commented 1 year ago

Running in docker, quickstart goes smoothly, but when it's time to actually run it, it does nothing and spits out an error of

mintapi:Not on Account Selection Screen
mintapi:Not on MFA screen

(MFA error paraphrased) and errors out. I'm not quite sure what I'm doing wrong. The YNAB connection is fine, again the quickstart went smoothly.

For mint, I'm entering my email (which I have triple-checked is my account ID), and copy-pasting my password. Lastly, for the MFA token, I am pasting it in as all 32 characters with no spaces (I initially was doing direct copy-paste from the website but that was pasting it as

XXXX
XXXX
...

so I thought that was the culprit, but it was not. Am I entering the MFA key wrong or is there something else?

BagMan9 commented 1 year ago

Here is the full output log, just tried it again with spaces between each group of 4 characters and same issue:

INFO:mintapi:Not on Account Selection Screen
INFO:mintapi:Not on Secondary MFA Password Screen
INFO:mintapi:Not on Account Selection Screen
INFO:mintapi:Not on Secondary MFA Password Screen
INFO:mintapi:Not on Account Selection Screen
INFO:mintapi:Not on Secondary MFA Password Screen
ERROR:mintapi:Login to Mint failed due to timeout in the Multifactor Method Loop
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 24, in main
    mint_transactions = mint_api.get_transactions(start_date=arg('days'))
  File "/usr/local/lib/python3.8/dist-packages/ynam/mint_api.py", line 49, in get_transactions
    client.authorize(self.cookies(), self.key())
  File "/usr/local/lib/python3.8/dist-packages/ynam/mint_api.py", line 63, in cookies
    return ast.literal_eval(file.read())
  File "/usr/lib/python3.8/ast.py", line 59, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib/python3.8/ast.py", line 47, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 0

    ^
SyntaxError: unexpected EOF while parsing

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/mintapi/signIn.py", line 411, in sign_in
    WebDriverWait(driver, 5).until(
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/support/wait.py", line 95, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/mintapi/browser.py", line 118, in login_and_get_token
    self.status_message = sign_in(
  File "/usr/local/lib/python3.8/dist-packages/mintapi/signIn.py", line 417, in sign_in
    raise RuntimeError(
RuntimeError: Login to Mint failed due to timeout in the Multifactor Method Loop
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 24, in main
    mint_transactions = mint_api.get_transactions(start_date=arg('days'))
  File "/usr/local/lib/python3.8/dist-packages/ynam/mint_api.py", line 49, in get_transactions
    client.authorize(self.cookies(), self.key())
  File "/usr/local/lib/python3.8/dist-packages/ynam/mint_api.py", line 63, in cookies
    return ast.literal_eval(file.read())
  File "/usr/lib/python3.8/ast.py", line 59, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib/python3.8/ast.py", line 47, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 0

    ^
SyntaxError: unexpected EOF while parsing

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/mintapi/signIn.py", line 411, in sign_in
    WebDriverWait(driver, 5).until(
  File "/usr/local/lib/python3.8/dist-packages/selenium/webdriver/support/wait.py", line 95, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/mintapi/browser.py", line 118, in login_and_get_token
    self.status_message = sign_in(
  File "/usr/local/lib/python3.8/dist-packages/mintapi/signIn.py", line 417, in sign_in
    raise RuntimeError(
RuntimeError: Login to Mint failed due to timeout in the Multifactor Method Loop

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/ynam", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/ynam/main.py", line 26, in main
    mint_api.updateAuth()
  File "/usr/local/lib/python3.8/dist-packages/ynam/mint_api.py", line 71, in updateAuth
    browser = self.browser(
  File "/usr/local/lib/python3.8/dist-packages/mintapi/browser.py", line 57, in __init__
    self.login_and_get_token(
  File "/usr/local/lib/python3.8/dist-packages/mintapi/browser.py", line 141, in login_and_get_token
    raise Exception(msg) from e
Exception: Could not sign in to Mint. Current page: https://accounts.intuit.com/index.html?offering_id=Intuit.ifs.mint&namespace_id=50000026&redirect_url=https://mint.intuit.com/overview.event?cta%3Dnav_login_dropdown%26ivid%3De69d87cf-7ce6-4827-ac17-16165bfa501c

** Press ANY KEY to close this window ** 
snowskeleton commented 1 year ago

You seem to be doing everything correctly (if only code would accept seemingly correct :) ). Have you tried running it outside docker and without the --headless option? You may gain some insight by seeing how it breaks in the browser when it's trying to sign in.