plaid / quickstart

Get up and running with Plaid Link and the API in minutes
https://plaid.com/docs/quickstart
MIT License
602 stars 644 forks source link

"Internal error occurred" without Logs for Docker Compose #362

Closed tnightengale closed 2 years ago

tnightengale commented 2 years ago

Overview

I am trying to get the quickstart working for development mode using docker compose flow.

Unfortunately, I keep getting a nebulous "Internal error occurred" without any details exposed in the logs. Here's a quick Loom of the issue:

Screen Shot 2022-06-10 at 12 39 12 PM

Can someone chime in why this error is not reflected in the logs by default, or with other guidance as to what is going wrong. I also hear random hints of rate-limiting being an issue. If that's the case, how would I check that?

Other Details

My ./quickstart/.env file, with ### redacted secrets:

# Get your Plaid API keys from the dashboard: https://dashboard.plaid.com/account/keys
PLAID_CLIENT_ID=##########
PLAID_SECRET=###########
# Use 'sandbox' to test with fake credentials in Plaid's Sandbox environment
# Use 'development' to test with real credentials while developing
# Use 'production' to go live with real users
PLAID_ENV=development
# PLAID_PRODUCTS is a comma-separated list of products to use when
# initializing Link, e.g. PLAID_PRODUCTS=auth,transactions.
# see https://plaid.com/docs/api/tokens/#link-token-create-request-products for a complete list.
# Only institutions that support ALL listed products will be displayed in Link.
# If you don't see the institution you want in Link, remove any products you aren't using.
# Important: When moving to Production, make sure to update this list with only the products
# you plan to use. Otherwise, you may be billed for unneeded products.
# NOTE: Income_verification has to be used seperately from all other products due to the specific 
# flow.
PLAID_PRODUCTS=auth,transactions
# PLAID_COUNTRY_CODES is a comma-separated list of countries to use when
# initializing Link, e.g. PLAID_COUNTRY_CODES=US,CA.
# see https://plaid.com/docs/api/tokens/#link-token-create-request-country-codes for a complete list
PLAID_COUNTRY_CODES=US,CA
# Only required for OAuth:
# For sandbox, set PLAID_REDIRECT_URI to 'http://localhost:3000/'
# The OAuth redirect flow requires an endpoint on the developer's website
# that the bank website should redirect to. You will need to configure
# this redirect URI for your client ID through the Plaid developer dashboard
# at https://dashboard.plaid.com/team/api.
# For development or production, you will need to use an https:// url
# Instructions to create a self-signed certificate for localhost can be found at https://github.com/plaid/quickstart/blob/master/README.md#testing-oauth
# If you are not set up to use localhost with https:// on your system, you will be unable to test OAuth in development or production.
# In this case you can leave the PLAID_REDIRECT_URI blank.
PLAID_REDIRECT_URI=https://localhost:3000/

Screenshot of my redirect profile settings:

Screen Shot 2022-06-10 at 12 45 49 PM

And I added the certs as specified, while also changing the default language to python in the makefile:

Screen Shot 2022-06-10 at 12 47 01 PM

Docker Desktop version:

Screen Shot 2022-06-10 at 12 48 47 PM
phoenixy1 commented 2 years ago

Thanks for the post! A few thoughts: 1) Link errors will sometimes show more details in the console log -- can you check the console log in the browser and see if anything shows up there? 2) In general rate limit errors typically occur in the Quickstart due to mixing credentials and environments (especially using Sandbox credentials against a production environment). Make sure you are using the credential set that matches your real environment (user_good / pass_good for Sandbox, live creds for production/development). 3) If you are unable to find logs locally, you can also check the dashboard at dashboard.plaid.com to look for any server-side error messages there. 4) Your environment shows you're using production -- it's unclear if you've already gotten Sandbox working, I recommend trying to get things working in Sandbox before trying production. Have you applied for and received production access approval from Plaid? If not, Production API calls won't work for your client_id. In addition, Production is more restrictive than Sandbox (for example, using certain banks in production requires submitting additional security questionnaires). This may be why Capital One didn't work for you, for example -- Capital One is an OAuth integration and requires OAuth approval.

tnightengale commented 2 years ago

@phoenixy1 Thanks for the quick response!

To touch on your points: 1) I have checked the console logs in the browser: they don't supply more information. 2) I am using the credentials I have been provided for the "development" environment from the Plaid console. 3) Thank you for the tip to check dashboard.plaid.com! 4) I have already gotten sandbox working fine; no troubles there. You keep using the term "production", but I am looking to use the "development" environment discussed in the Plaid documention. I've applied for "development" access already. I assume it was approved because I have development keys? See here:

Screen Shot 2022-06-10 at 4 38 44 PM

Can I assume these keys are valid?

tnightengale commented 2 years ago

@phoenixy1 moreover, are you able to launch the quickstart in docker compose, and retrieve an access_token/create an item at a real instituition? Can you verify that this even works? I haven't seen anyone online demonstrating doing this sucessfully with this quickstart.

tnightengale commented 2 years ago

It seems like rate limiting is the problem. Perhaps you could add logging for this by default.

Screen Shot 2022-06-10 at 4 51 01 PM
phoenixy1 commented 2 years ago

Ah yes. You start out with five development Items and then you need to apply for development access to get more. People are confused by this all the time. We've made some UI changes to make this better but I think there are other things we can do. I'll follow up with the team on that.

tnightengale commented 2 years ago

@phoenixy1 To clarify, are you saying that even though I have a "development" credential, I am not approved to use the "development" environment? Or that I have simply used up all 5 of the complimentary items that come with the "development" environment? How could it be the case that they are used up on failed requests to Link, where no account_token was returned or item created?

phoenixy1 commented 2 years ago

@tnightengale the error indicates that you have used up all 5 of the default Items that come with the environment. You can get another 95 Items for free, but you have to fill out this form to do so: https://dashboard.plaid.com/overview/development.

From the logs you posted it looks like this limit is enforced at the Link layer, blocking you from obtaining a public_token, rather than exclusively at the token exchange layer.