wesselt / bunq2ynab

Upload bunq transactions to ynab
Other
78 stars 22 forks source link

Exception: Insufficient authentication on AWS #39

Closed Gekkehond closed 2 years ago

Gekkehond commented 2 years ago

I had the script running fine for a couple of days on AWS before it stopped syncing for me. When I look at the log it tells me I have Insufficient authentication. The API keys are still active on both bunq and YNAB. I am just your average savvy. No developer. So I might have missed something. But it did work.

Log:

2022-04-15T09:05:30.137+02:00   START RequestId: 490fe633-8868-4ec0-a457-c0b6cb0023de Version: $LATEST
2022-04-15T09:05:30.141+02:00   2022-04-15 07:05:30,141 | INFO | config.py:80 | read_ssm_config | Reading config from SSM
2022-04-15T09:05:30.193+02:00   2022-04-15 07:05:30,192 | INFO | lambda_function.py:41 | get_iban_from_event | Found IBAN NL**BUNQ*******491 in request body
2022-04-15T09:05:30.193+02:00   2022-04-15 07:05:30,193 | INFO | sync.py:58 | populate | Retrieving bunq accounts...
2022-04-15T09:05:30.228+02:00   2022-04-15 07:05:30,227 | ERROR | lambda_function.py:62 | lambda_handler | Exception occurred
2022-04-15T09:05:30.228+02:00   Traceback (most recent call last):
2022-04-15T09:05:30.228+02:00   File "/var/task/lambda_function.py", line 51, in lambda_handler
2022-04-15T09:05:30.228+02:00   sync.populate()
2022-04-15T09:05:30.228+02:00   File "/var/task/lib/sync.py", line 59, in populate
2022-04-15T09:05:30.228+02:00   self.bunq_accounts = list(bunq_api.get_accounts())
2022-04-15T09:05:30.228+02:00   File "/var/task/lib/bunq_api.py", line 109, in get_accounts
2022-04-15T09:05:30.228+02:00   for u in [first_value(u) for u in bunq.get("v1/user")]:
2022-04-15T09:05:30.228+02:00   File "/var/task/lib/bunq.py", line 206, in get
2022-04-15T09:05:30.228+02:00   return call('GET', method)
2022-04-15T09:05:30.228+02:00   File "/var/task/lib/bunq.py", line 197, in call
2022-04-15T09:05:30.228+02:00   raise Exception(result["Error"][0]["error_description"])
2022-04-15T09:05:30.228+02:00   Exception: Insufficient authentication.
2022-04-15T09:05:30.229+02:00   END RequestId: 490fe633-8868-4ec0-a457-c0b6cb0023de
2022-04-15T09:05:30.229+02:00   REPORT RequestId: 490fe633-8868-4ec0-a457-c0b6cb0023de Duration: 88.74 ms Billed Duration: 89 ms Memory Size: 512 MB Max Memory Used: 85 MB
wesselt commented 2 years ago

Bunq keys are valid for only half a year. How does it work when you try with a new bunq key?

Gekkehond commented 2 years ago

This worked! Although the key was just a few days old... Thank you for the quick response.