-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
[Fixed, Please upgrade via pip and delete any saved sessions] get_transactions failure with HTTP 403 #129
Comments
I'm having the same issue, but not just with get_transactions - seems like any request to the API is failing with the same HTTP response |
Thanks for reporting this! Was able to reproduce as well. There are, from what I can tell, two things happening simultaneously that cause the errors to happen. The Causes and FixesMonarch may have invalidated old tokens You can remove the old session via a simple Then, on your next use of the API, perform a login and save the new session. New HTTP headers are needed To get your install working again
|
Leaving this open for a bit, while folks pick up the upgraded package. |
I tried the steps listed and when forcing a new login, i get the following. Anyone else seeing this? File "C:\Python310\lib\site-packages\monarchmoney\monarchmoney.py", line 123, in login |
@codemonkey-design You'll need to post more of the HTTP error. I was able to resolve following @hammem's recommendation. |
I am getting a similar issue when trying to use the interactive login. I have updated to the latest version.
|
Thanks, @zacrevermann ! Please also confirm you've deleted any saved sessions, as |
Hi @hammem yes, confirming I called |
Thanks again, @zacrevermann ! Are you running this in a Jupyter notebook environment by chance? I just did a repro in Google Colab and get the same error. But, when I run in a brand new venv locally, no errors. I suspect there's something off / different. |
@hammem I am running in a Google Colab on a hosted runtime. |
@hammem I'm getting a similar result. Works from python command line, but not from Jupyterlab. I can login from either, but graphql calls are rejected when run from Jupyterlab. Details: I'm running Jupyterlab locally on a laptop (not on any cloud virtual machine or data center machine). I installed When I run from the python command line via Windows cmd.exe, everything works fine. I logged in and made a successful call to |
@zacrevermann can you verify on the monarch website that you have MFA enabled? @hammem if i remove this from the header, i'm able to get past the 404 error but now I'm stuck at the 403 error. This is running it from the command line with interactive login. removed: |
@codemonkey-design confirming I have MFA enabled on my monarch account. |
Hi @hammem, thanks for an amazing repo, it's super useful. I started getting the 403 error as well. After upgrading to 0.1.15, it started working. However, after a day or so, I started getting |
I suspect you might be right, @goldan a bit of a bummer, but can probably validate by looking at the Web UX more closely for a token refresh call? |
ok, i finally tracked this down. i don't think monarch likes me trying to make those calls thru my vpn. they are blocking it now. i reran the script from a clean dev environment and was able to get logged in successfully. |
Just wanted to add that I had the same issue where I would get a "HTTP 404" if I was trying to login when on a VPN (specifically I was using Mullvad VPN) and things worked fine when I was off of the VPN. I'll also note that after I logged in and saved my session I was able to do everything else while on the VPN, so it seems only the login isn't allowed on a VPN. |
I just submitted a support ticket with monarch. Let's see what they have to say. |
@codemonkey-design Any word from Monarch? How supportive/not supportive were they? I'd expect them to basically say "don't try that" but would love to hear your experience. |
Yes, this is the response I got. It looks like it's being blocked due to security, on their end: "web application firewall (WAF) may be blocking your GraphQL API requests when you're using a VPN. " |
just started happening this morning. i'm on the latest package from today.
During handling of the above exception, another exception occurred:
File "C:\Python310\Lib\site-packages\gql\transport\aiohttp.py", line 319, in raise_response_error
resp.raise_for_status()
File "C:\Python310\Lib\site-packages\aiohttp\client_reqrep.py", line 1161, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url='https://api.monarchmoney.com/graphql'
The above exception was the direct cause of the following exception:
File "C:\Python310\Lib\site-packages\gql\transport\aiohttp.py", line 321, in raise_response_error
raise TransportServerError(str(e), e.status) from e
File "C:\Python310\Lib\site-packages\gql\transport\aiohttp.py", line 338, in execute
await raise_response_error(resp, "Not a JSON answer")
File "C:\Python310\Lib\site-packages\gql\client.py", line 1537, in _execute
result = await self.transport.execute(
File "C:\Python310\Lib\site-packages\gql\client.py", line 1628, in execute
result = await self._execute(
File "C:\Python310\Lib\site-packages\gql\client.py", line 367, in execute_async
return await session.execute(
File "C:\Python310\Lib\site-packages\monarchmoney\monarchmoney.py", line 2766, in gql_call
return await self._get_graphql_client().execute_async(
File "C:\Python310\Lib\site-packages\monarchmoney\monarchmoney.py", line 1553, in get_transactions
return await self.gql_call(
File "D:\Budget\monarch-api\monarch-api.py", line 33, in get_transaction_data
monarch_data = await monarch.get_transactions(start_date=start_date, end_date=end_date, limit=TRANSACTION_LIMIT)
The text was updated successfully, but these errors were encountered: