Comments (13)
I added a code path to catch that error and return an empty dict
instead. Typically this happens when you have an empty (or supposedly empty) file that json can't quite parse.
from ynam.
Pulled fresh from git and tried again, getting unauthorized errors now. Not sure if my credentials are being passed properly. They are accurate and Mint has no issues accessing my info:
C:\Users\Administrator>ynam --quickstart
Mint username: <my username>
Error reading C:\Users\Administrator\.ynamrc; assuming it to be empty
Mint password: <my password>
Mint mfa seed (optional):
YNAB API key: <api token>
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\ynab_api.py", line 653, in _decode
return answer['data']
KeyError: 'data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\ynam-script.py", line 33, in <module>
sys.exit(load_entry_point('ynam==0.3.3.post1', 'console_scripts', 'ynam')())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\main.py", line 20, in main
handleArgs()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\main.py", line 48, in handleArgs
sys.exit(run())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\quickstart.py", line 43, in run
updateStash('ynab_budget_id', usersChoice(ynapi.get_budgets())['id'])
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\ynab_api.py", line 78, in get_budgets
return _decode(self._get(url='/budgets'))['budgets']
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\ynab_api.py", line 655, in _decode
raise Exception(answer['error'])
Exception: {'id': '401', 'name': 'unauthorized', 'detail': 'Unauthorized'}
C:\Users\Administrator>ynam --update-mint-auth
DevTools listening on ws://127.0.0.1:49702/devtools/browser/c29894a5-40b0-425b-88a0-259df571863d
[1220/194739.035:INFO:CONSOLE(1)] "analytics performance metrics [object Object]", source: https://mint.intuit.com/handlebars/common_3.0.1296/common/cms/js/csa-init.js (1)
[1220/194739.054:INFO:CONSOLE(1)] "analytics performance metrics [object Object]", source: https://mint.intuit.com/handlebars/common_3.0.1296/common/cms/js/csa-init.js (1)
[1220/194741.290:INFO:CONSOLE(1)] "All core plugins started...", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/5400.js (1)
[1220/194741.296:INFO:CONSOLE(1)] "Plugins registered...", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/5400.js (1)
[1220/194741.297:INFO:CONSOLE(1)] "Application before-ready completed...", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/5400.js (1)
[1220/194741.299:INFO:CONSOLE(1)] "Application ready...", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/5400.js (1)
[1220/194741.300:INFO:CONSOLE(1)] "default delegate action handler [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/9446.js (1)
[1220/194741.336:INFO:CONSOLE(1)] "Shell - successfully initialized RUM module [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/222.js (1)
[1220/194741.355:INFO:CONSOLE(1)] "@ids-ts/theme is being deprecated. Please use @design-systems/theme instead.", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/624.js (1)
[1220/194741.363:INFO:CONSOLE(1)] "widget-request-start [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/222.js (1)
[1220/194741.364:INFO:CONSOLE(1)] "widget-load-start [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/222.js (1)
[1220/194741.397:INFO:CONSOLE(2)] "Unsatisfied version 3.5.2 of shared singleton module @design-systems/theme (required =3.4.10)", source: https://plugin.intuitcdn.net/identity-authn-core-ui/remoteEntry.e7bf1f46c3caad04c37c.js (2)
[1220/194741.447:INFO:CONSOLE(2)] "Unsatisfied version 7.12.0 of shared singleton module @appfabric/web-shell-core/widgets/BaseWidget (required =7.2.1)", source: https://plugin.intuitcdn.net/identity-authn-core-ui/remoteEntry.e7bf1f46c3caad04c37c.js (2)
[1220/194741.764:INFO:CONSOLE(1)] "widget-load-end [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/222.js (1)
[1220/194741.861:INFO:CONSOLE(1)] "widget-mount [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/222.js (1)
[1220/194741.863:INFO:CONSOLE(1)] "widget-first-display [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/222.js (1)
[1220/194741.864:INFO:CONSOLE(1)] "widget-ready [object Object]", source: https://plugin.intuitcdn.net/web-shell/3.308.0/integration/222.js (1)
[1220/194742.025:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194742.567:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194752.096:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194752.656:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194802.168:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194802.725:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194812.238:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194812.798:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194822.315:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194822.866:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194832.390:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
[1220/194832.943:ERROR:stun_port.cc(99)] Binding error response: class=4 number=1 reason=Unauthorized
Message:
Stacktrace:
Backtrace:
(No symbol) [0x00AAF243]
(No symbol) [0x00A37FD1]
(No symbol) [0x0092D04D]
(No symbol) [0x0095C0B0]
(No symbol) [0x0095C22B]
(No symbol) [0x0098E612]
(No symbol) [0x009785D4]
(No symbol) [0x0098C9EB]
(No symbol) [0x00978386]
(No symbol) [0x0095163C]
(No symbol) [0x0095269D]
GetHandleVerifier [0x00D49A22+2655074]
GetHandleVerifier [0x00D3CA24+2601828]
GetHandleVerifier [0x00B58C0A+619850]
GetHandleVerifier [0x00B57830+614768]
(No symbol) [0x00A405FC]
(No symbol) [0x00A45968]
(No symbol) [0x00A45A55]
(No symbol) [0x00A5051B]
BaseThreadInitThunk [0x7712FA29+25]
RtlGetAppContainerNamedObjectPath [0x77CD7BBE+286]
RtlGetAppContainerNamedObjectPath [0x77CD7B8E+238]
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 368, in sign_in
handle_same_page_username_password(driver, email, password)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 457, in handle_same_page_username_password
email_input = driver.find_element(By.ID, "ius-userid")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 856, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="ius-userid"]"}
(Session info: headless chrome=108.0.5359.125)
Stacktrace:
Backtrace:
(No symbol) [0x00AAF243]
(No symbol) [0x00A37FD1]
(No symbol) [0x0092D04D]
(No symbol) [0x0095C0B0]
(No symbol) [0x0095C22B]
(No symbol) [0x0098E612]
(No symbol) [0x009785D4]
(No symbol) [0x0098C9EB]
(No symbol) [0x00978386]
(No symbol) [0x0095163C]
(No symbol) [0x0095269D]
GetHandleVerifier [0x00D49A22+2655074]
GetHandleVerifier [0x00D3CA24+2601828]
GetHandleVerifier [0x00B58C0A+619850]
GetHandleVerifier [0x00B57830+614768]
(No symbol) [0x00A405FC]
(No symbol) [0x00A45968]
(No symbol) [0x00A45A55]
(No symbol) [0x00A5051B]
BaseThreadInitThunk [0x7712FA29+25]
RtlGetAppContainerNamedObjectPath [0x77CD7BBE+286]
RtlGetAppContainerNamedObjectPath [0x77CD7B8E+238]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\browser.py", line 115, in login_and_get_token
self.status_message = sign_in(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 375, in sign_in
handle_different_page_username_password(driver, email)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 471, in handle_different_page_username_password
email_input = WebDriverWait(driver, 20).until(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\support\wait.py", line 90, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
Backtrace:
(No symbol) [0x00AAF243]
(No symbol) [0x00A37FD1]
(No symbol) [0x0092D04D]
(No symbol) [0x0095C0B0]
(No symbol) [0x0095C22B]
(No symbol) [0x0098E612]
(No symbol) [0x009785D4]
(No symbol) [0x0098C9EB]
(No symbol) [0x00978386]
(No symbol) [0x0095163C]
(No symbol) [0x0095269D]
GetHandleVerifier [0x00D49A22+2655074]
GetHandleVerifier [0x00D3CA24+2601828]
GetHandleVerifier [0x00B58C0A+619850]
GetHandleVerifier [0x00B57830+614768]
(No symbol) [0x00A405FC]
(No symbol) [0x00A45968]
(No symbol) [0x00A45A55]
(No symbol) [0x00A5051B]
BaseThreadInitThunk [0x7712FA29+25]
RtlGetAppContainerNamedObjectPath [0x77CD7BBE+286]
RtlGetAppContainerNamedObjectPath [0x77CD7B8E+238]
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 368, in sign_in
handle_same_page_username_password(driver, email, password)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 457, in handle_same_page_username_password
email_input = driver.find_element(By.ID, "ius-userid")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 856, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="ius-userid"]"}
(Session info: headless chrome=108.0.5359.125)
Stacktrace:
Backtrace:
(No symbol) [0x00AAF243]
(No symbol) [0x00A37FD1]
(No symbol) [0x0092D04D]
(No symbol) [0x0095C0B0]
(No symbol) [0x0095C22B]
(No symbol) [0x0098E612]
(No symbol) [0x009785D4]
(No symbol) [0x0098C9EB]
(No symbol) [0x00978386]
(No symbol) [0x0095163C]
(No symbol) [0x0095269D]
GetHandleVerifier [0x00D49A22+2655074]
GetHandleVerifier [0x00D3CA24+2601828]
GetHandleVerifier [0x00B58C0A+619850]
GetHandleVerifier [0x00B57830+614768]
(No symbol) [0x00A405FC]
(No symbol) [0x00A45968]
(No symbol) [0x00A45A55]
(No symbol) [0x00A5051B]
BaseThreadInitThunk [0x7712FA29+25]
RtlGetAppContainerNamedObjectPath [0x77CD7BBE+286]
RtlGetAppContainerNamedObjectPath [0x77CD7B8E+238]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\browser.py", line 115, in login_and_get_token
self.status_message = sign_in(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 375, in sign_in
handle_different_page_username_password(driver, email)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\signIn.py", line 471, in handle_different_page_username_password
email_input = WebDriverWait(driver, 20).until(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\support\wait.py", line 90, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
Backtrace:
(No symbol) [0x00AAF243]
(No symbol) [0x00A37FD1]
(No symbol) [0x0092D04D]
(No symbol) [0x0095C0B0]
(No symbol) [0x0095C22B]
(No symbol) [0x0098E612]
(No symbol) [0x009785D4]
(No symbol) [0x0098C9EB]
(No symbol) [0x00978386]
(No symbol) [0x0095163C]
(No symbol) [0x0095269D]
GetHandleVerifier [0x00D49A22+2655074]
GetHandleVerifier [0x00D3CA24+2601828]
GetHandleVerifier [0x00B58C0A+619850]
GetHandleVerifier [0x00B57830+614768]
(No symbol) [0x00A405FC]
(No symbol) [0x00A45968]
(No symbol) [0x00A45A55]
(No symbol) [0x00A5051B]
BaseThreadInitThunk [0x7712FA29+25]
RtlGetAppContainerNamedObjectPath [0x77CD7BBE+286]
RtlGetAppContainerNamedObjectPath [0x77CD7B8E+238]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\ynam-script.py", line 33, in <module>
sys.exit(load_entry_point('ynam==0.3.3.post1', 'console_scripts', 'ynam')())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\main.py", line 20, in main
handleArgs()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\main.py", line 53, in handleArgs
sys.exit(mapi.updateAuth())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\mint_api.py", line 65, in updateAuth
bowser = self.browser(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\browser.py", line 55, in __init__
self.login_and_get_token(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\mintapi\browser.py", line 136, 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%3A%2F%2Fmint.intuit.com%2Foverview.event%3Futm_medium%3Ddirect%26cta%3Dnav_login_dropdown%26ivid%3D41ab7ede-0eb2-437f-b476-466d2efa4d78
from ynam.
Try running with --graphics
, or -x
for short. Then you'll be able to see where the signin is failing
from ynam.
The script successfully enters the username, but appears to be entering a very long string (possibly the YNAB API key, not the correct password) into the password field, which then fails.
EDIT: When I swap the ynab api key with my password, it gets to the next field. So that must be the hangup
from ynam.
If it's inputting the wrong password, then you need to rerun quickstart and give it the right password. (Note that you can leave the other fields blank and it won't overwrite the data.)
As a sanity check, you can use the --blab
flag to check what values you have saved.
from ynam.
The log in info is being passed to the script accurately, as confirmed by --blab
:
Secrets(ynab_api_key='<my api key>', ynab_account_id=None, ynab_budget_id=None, mint_username='<my username>', mint_password='\x16', mint_mfa_seed=None)
I am deleting all of the .ynam* files between attempts so that --quickstart
gets a fresh start.
from ynam.
EDIT: When I swap the ynab api key with my password, it gets to the next field. So that must be the hangup
so it's working now?
from ynam.
EDIT: When I swap the ynab api key with my password, it gets to the next field. So that must be the hangup
so it's working now?
Sorry I wasn't clear before -- no, same behavior. The script is being passed accurate data, it's just using it in the wrong places. Not user error... this time!
from ynam.
It shouldn't be possible for ynam to mismatch values like you're describing. Not sure about a Windows equivalent, but in unix terms
$ cat ~/.ynamrc
{
"ynab_api_key": "long key",
"mint_username": "[email protected]",
"mint_password": "password",
"ynab_budget_id": "some id",
"ynab_account_id": "other id",
"mint_mfa_seed": "maybe a seed"
}
visually check to make sure the values there are what you expect.
When that data is passed to mint for authentication in src/ynam/mint_api.py
def updateAuth(self):
bowser = self.browser(
email=stash.mint_username,
password=stash.mint_password,
mfa_method='soft-token',
mfa_token=stash.mint_mfa_seed,
use_chromedriver_on_path=arg('use_chromedriver_on_path'),
headless=arg('headless'),
wait_for_sync=False,
wait_for_sync_timeout=10,
)
it's passed as "mint_password"
from ynam.
I figured it out! Well part of it.
Turns out the log in portion was using whatever was most recent in the OS clipboard for the password, which was the YNAB API key. If I have the Mint password queued in the clipboard, it is able to log in properly.
from ynam.
If I keep my Mint password in the clipboard and run ynam
with or without -x
, I now get the following error:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\ynab_api.py", line 653, in _decode
return answer['data']
KeyError: 'data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\ynam-script.py", line 33, in <module>
sys.exit(load_entry_point('ynam==0.3.3.post1', 'console_scripts', 'ynam')())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\main.py", line 33, in main
for y in ynapi.get_account_transactions(stash.ynab_account_id)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\ynab_api.py", line 468, in get_account_transactions
for xt in _decode(result)['transactions']
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\ynam\ynab_api.py", line 655, in _decode
raise Exception(answer['error'])
Exception: {'id': '404.2', 'name': 'resource_not_found', 'detail': 'Resource not found'}
from ynam.
I'm getting the same errors as above, however, if I then run ynam --account-id {account-id} then it runs successfully. If I had to guess, I'd say there's something wrong with the budget id value that is getting passed to ynab.get_accounts call or the url is being malformed in the request to get the list of accounts. My workaround was to do the following:
curl -H curl -H "Authorization: Bearer <ynab_api_key>" https://api.youneedabudget.com/v1/budgets//accounts -- both the budget id and api key can be found in the .ynamrc file that was created when you got the error.
and find the apple card account id in the json that is returned. At that point you can either run:
ynam --account-id
or add the line:
"ynab_account_id": "" to the .ynamrc file after the line with "ynab_budget_id" (don't forget to add a comma to the preceeding line)
from ynam.
Thank you both for your help. The issue seems to be with creating new .ynamrc
files, so I probably wouldn't have found this without your help.
from ynam.
Related Issues (20)
- Cannot import RESTClient HOT 6
- Budget selection showing incorrect accounts HOT 1
- Inconsistentcy with automation HOT 1
- Issue with ynam quick start HOT 5
- Docker image on arm? HOT 5
- Fresh install of YNAM cannot import RESTClient HOT 2
- Docker quickstart works, importing of transactions errors out HOT 13
- Exits on run in docker HOT 10
- Similar / Some transactions not importing HOT 2
- TypeError: MintTransaction.__init__() missing 1 required positional argument: 'id' HOT 7
- Error when running ynam --quickstart HOT 4
- ynam all of a sudden not working HOT 3
- Thank you
- Stuck on Mint authentication HOT 2
- ynam - version of chrome newer HOT 5
- Crash during ynam --quickstart HOT 2
- KeyError: 'fiData' HOT 2
- Mint is being killed HOT 3
- YNAB Now Supports Apple Card HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ynam.