I followed the instructions here: https://dashboard.plaid.com/overview/sandbox.
I have everything setup the way it should, my .env looks like this:
PLAID_CLIENT_ID=myclientid
PLAID_SECRET=mysandboxsecret
PLAID_ENV=sandbox
PLAID_PRODUCTS=auth,transactions
PLAID_COUNTRY_CODES=US,CA
PLAID_REDIRECT_URI='http://localhost:3000/'
I did try leaving URI blank as well - made no difference.
For some reason, I continue to get this error when I visit http://localhost:3000 after running npm start
Unable to fetch link_token: please make sure your backend server is running and that your .env file has been configured correctly.
The error code, error type, and error message are all blank.
Here are the terminal outputs for ./start.sh & npm start
./start.sh
* Serving Flask app "server" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:8000/ (Press CTRL+C to quit)
127.0.0.1 - - [22/Feb/2022 20:05:45] "POST /api/info HTTP/1.1" 200 -
127.0.0.1 - - [22/Feb/2022 20:05:45] "POST /api/create_link_token HTTP/1.1" 200 -
npm start
> plaid_react_quickstart#0.1.0 start
> react-scripts start
[HPM] Proxy created: / -> http://localhost:8000
ℹ 「wds」: Project is running at http://192.168.1.45/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /Users/user/plaid/quickstart/frontend/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
Compiled with warnings.
src/dataUtilities.ts
Line 11:3: 'AssetReportGetResponse' is defined but never used #typescript-eslint/no-unused-vars
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
Does anyone familiar with Plaid API know how to fix this?
It feels like the API/quickstart process has changed a bit since those postings.
EDIT:
I re-cloned the repo and started from step 1 and re-did everything. It all works now. I traced the issue back to an extra digit at the end of my SECRET. Thank you Alex for the help, but it was all a silly mistake. Cheers!
You can always get more data about what went wrong by looking at the activity log at https://dashboard.plaid.com/activity/logs. That said, the most common causes of this issue are the following:
Specifying a REDIRECT_URI in the .env file but not adding it to "allowed redirect uris" at https://dashboard.plaid.com/team/api
Being on Windows and not cloning the repo in a manner that preserves symlinks, which you can do like this:
git clone -c core.symlinks=true https://github.com/plaid/quickstart
try this answer as well, seems like python3.9 certificates are missing for mac os
https://stackoverflow.com/a/68595419/6013354
Related
I generated python server stub from swagger-codegen at swagger editor online, and I want to run generated python server stub locally but it is not working and endpoint gave me Not Found error. I looked into swagger community, and not find single piece of issue related to this. Basically, I used openapi spec in yaml file to generate python server stub, but generated server stub can't be run locally. I don't know what is going on. Is there anyone experienced with this issue? what's the right way to generate python server stub from swagger-codegen which can be run and test locally? any idea?
openapi spec file
here is how yaml file begins:
openapi: 3.0.2
info:
title: api
description: test api
contact:
name: python server
url: /api/v1/
email: info#gmail.com
version: 1.0.0
servers:
- url: /api/v1/
description: SwaggerHub API Auto Mocking
- url: /api/v1/
description: IMM AWS Server 1
I generated python server stub by using this yaml file but generated python server stub is not working and can't run locally from python console/cmd. any idea to make this work? any possible thought?
update
here is what I tried:
venv) C:\Users\kim\photoalbum_api>python -m swagger_server
The swagger_ui directory could not be found.
Please install connexion with extra install: pip install connexion[swagger-ui]
or provide the path to your local installation by passing swagger_path=<your path>
The swagger_ui directory could not be found.
Please install connexion with extra install: pip install connexion[swagger-ui]
or provide the path to your local installation by passing swagger_path=<your path>
* Serving Flask app "__main__" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
so I did pip install connexion[swagger-ui] and try to run it locally, but endpoint always gave me this:
for reproducible purpose, I also tested this openapi spec file to generate python server stub but it is not working as well. why? any idea to make this work? thanks
new update:
even I tried with http://localhost:8080/, endpoint always give me this:
(venv) C:\Users\kim\photouser_api>python -m swagger_server
* Serving Flask app "__main__" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 198-543-983
* Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
127.0.0.1 - - [16/May/2020 12:13:51] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [16/May/2020 12:14:02] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [16/May/2020 12:14:05] "GET /api HTTP/1.1" 404 -
127.0.0.1 - - [16/May/2020 12:14:10] "GET /api/v1 HTTP/1.1" 404 -
127.0.0.1 - - [16/May/2020 12:14:14] "GET /api/v1/ HTTP/1.1" 404 -
127.0.0.1 - - [16/May/2020 12:15:14] "GET / HTTP/1.1" 404 -
To get it working in my machine, I cloned your repo openapi.yaml. Then I modified the url to /api/v1/ in your openapi.yaml, and change the connexion to 2.6.0 in your requirements.txt. I created virtualenv and I followed the instructions in the README.md to install requirements.txt, and ran it. In the browser, I type http://localhost:8080/api/v1/ui and this should show the swagger ui. I also tried the docker build instruction and this also works.
I have a flask app that runs a couple of things based on the user call. In this app, I also have one basic endpoint that just returns a string which would help me to see if the app is running or not.
#app.route("/hello")
def hello():
return "Hello World!"
Now I tried to dockerize this app using this tutorial from the official docker site. The flask app listens on the port 5000 and so I added an entry in my Dockerfile to expose the port 5000.
EXPOSE 5000
And the command that I am using in the Dockerfile to run the app is
CMD ["python","model.py"]
model.py file has the flask code that calls other functions based on the user input.
Now when I run my app after containerizing it, I see the required output on the terminal that the flask app is indeed running. This is the command that I used to run the app.
docker run -p 5000:5000 firstContainer
When I try to call the basic helloWorld method above by using the request http://localhost:5000/hello, I get an error message saying that the site is unavailable. Is there anything that I am doing wrong wrt the port mappings here? How do I fix this issue ?
EDIT: Adding more details
So I tried to go into the container to see what's happening and I was able to view the files that were available on the container and they look good. When I tried to start the app again in the container using the base command
python model.py
it returned an error saying that the port is already in use. So this should mean that the app is indeed listening on the port. I also installed curl inside the container to browse the URL and it returned the expected string when I ran it inside the container. I just don't understand how I can expose it to outside world
EDIT 2:
Container logs
* Serving Flask app "model" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
The problem is the server defaults to answer internal requests only. You have two options.
You can set the host programatically to:
0.0.0.0
Use the CMD:
flask run --host=0.0.0.0`
Tip: There is also a container running flask behind ngnix out-of-the-box.
try this :
docker run --rm -it --network=host -p 5000:5000 firstContainer
the problem is probably related to networking. so --network=host connects the container to underlying host.
I have the same issue on my Flask App in the docker container. I have used --network=host and resolved the issue.
# docker run -it -p 8080:8080 --network=host mbilgen/metacriticv3:1.0
WARNING: Published ports are discarded when using host network mode
* Serving Flask app "main" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 258-420-336
127.0.0.1 - - [12/May/2019 03:55:08] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [12/May/2019 03:55:13] "GET /games HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [12/May/2019 03:55:13] "GET /games HTTP/1.1" 200 -
I'm running the Openstack Cloud System. I installed and deployed the kilo version on the server successful, but this is only the default version of Openstack. So that, I want to have some modifies on this openstack source and add more features to it.
I started to change something with the Openstack Dashboard. However, there are some problems happened. Therefore, I have debugged this django web application. All everything I have configured is the same as the official tutorials on the openstack website (http://docs.openstack.org).
So, I have search on my server and find out 2 places that have the sources:
The first one is /usr/share/openstack-dashboard/
The second one is /usr/lib/python2.7/dist-packages/horizon/
And the config file is /etc/openstack-dashboard/local_settings.py
I set the option Debug = True in local_settings.py file.
On the server I typed these commands:
cd /usr/share/openstack-dashboard/
python manage.py runserver
Here is the output:
RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
WARNING:py.warnings:RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
WARNING:py.warnings:RemovedInDjango18Warning: XViewMiddleware has been moved to django.contrib.admindocs.middleware.
Performing system checks...
System check identified no issues (0 silenced).
August 05, 2015 - 09:28:50
Django version 1.7.6, using settings 'openstack_dashboard.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
But in the browser, it shows the error:
And then, on the console, it shows:
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[05/Aug/2015 10:21:29] "GET / HTTP/1.1" 302 0
Not Found: /horizon/auth/login/
[05/Aug/2015 10:21:29] "GET /horizon/auth/login/?next=/ HTTP/1.1" 404 4237
Not Found: /favicon.ico
[05/Aug/2015 10:21:29] "GET /favicon.ico HTTP/1.1" 404 4206
Please help me to get out of this problems. And how can to debug Openstack Django Website properly.Thank you very much !
As you run server by runserver command you should go to the root url like
127.0.0.1:8000/
not
127.0.0.1:8000/horizon
The difference is in running method.
When you installed openstack_dashboard there is apache config that listen to address http://host/horizon look in to /etc/apache2/conf/sites-available/
The directories
/usr/lib/python2.7/dist-packages/horizon/
Is like the framework for all dashboards
/usr/share/openstack-dashboard/
Is the default dashboard for openstack
/etc/openstack-dashboard/local_settings.py
The config file for dashboard. Here you can apply changes for default dash, for example attach your project that modifies or extends default dash
So, your problem will be solved if you follow that link http://127.0.0.1:8000/
For debugging use
pdb or ide with integrated debugger
Follow this link.
http://docs.openstack.org/developer/horizon/quickstart.html
Once this is done, add pdb statements to your code that you wish to debug.Go into the horizon folder and run the following command
./run_tests.sh --runserver 127.0.0.1:port_number
Instead of local host you can put in the IP address where horizon is running
I have written the OpenStack documentation for debugging dashboards using PyCharm.
(It is good for any Openstack Dashboard including Horizon)
http://docs.openstack.org/developer/mistral/developer/troubleshooting.html
I am following this tutorial to set up a Django application and serve it with Gunicorn on a Debian DigitalOcean server: http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
I have got as far as the section starting "Now that you have gunicorn, you can test whether it can serve your Django application by running the following command". Now I'm stuck.
In other words, I can successfully run the application using python manage.py runserver, but not by using gunicorn.
I've successfully accessed my app with:
$ python manage.py runserver xx.xx.xx.xx:8000
Now from the same directory, I'm trying to run:
$ gunicorn my_django.wsgi:application --bind xx.xx.xx.xx:8001
It appears to start OK, but when I go to http://xx.xx.xx.xx:8001, I see:
Bad Request (400)
I'm not sure how to debug this: there's nothing in /var/log/gunicorn/.
I have set ALLOWED_HOSTS=['xx.xx.xx.xx'] in my settings file.
UPDATE: Being an idiot: gunicorn was looking in production settings file, not local settings file. Setting the ALLOWED_HOSTS in production settings fixed it.
I'd still really like to know how to debug problems like this though.
The answer: gunicorn was looking in production settings file, not local settings file. Setting the ALLOWED_HOSTS in production settings fixed it.
I'm trying to make a web app using the Uber api (https://developer.uber.com/v1/tutorials/).
In their tutorial they link to an example application on github with instructions to get it running. (https://github.com/uber/Python-Sample-Application). When I try running the sample application I get HTTP 400 errors. An example of the output that I get on the console is shown below.
(venv)192:Python-Sample-Application jason$ python app.py
* Running on http://127.0.0.1:7000/
127.0.0.1 - - [05/Sep/2014 05:37:28] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x00\xab\x01\x00\x00\xa7\x03\x03T')
127.0.0.1 - - [05/Sep/2014 05:37:28] "??T ??p},֤,??IknL?]????????C#?J??$?#?" 400 -
127.0.0.1 - - [05/Sep/2014 05:37:28] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x00\x9b\x01\x00\x00\x97\x03\x01T')
127.0.0.1 - - [05/Sep/2014 05:37:28] "??T ???=?-???????"u?Pg,??t?sBa`?J??$?#?" 400 -
127.0.0.1 - - [05/Sep/2014 05:37:28] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x00\x00E\x01\x00\x00A\x03\x00T')
127.0.0.1 - - [05/Sep/2014 05:37:28] "EAT ??^??????<)?W?e-???\?U~?0:=?=</5" 400 -
I've pasted the instructions from the github project below.
How To Use This
Navigate over to https://developer.uber.com/, and sign up for an Uber developer account.
Register a new Uber application and make your Redirect URI http://localhost:7000/submit ensure that both the profile and history OAuth scopes are checked.
Fill in the relevant information in the config.json file in the root folder and add your client id and secret as the environment
variables UBER_CLIENT_ID and UBER_CLIENT_SECRET.
Run export UBER_CLIENT_ID="YOUR_CLIENT_ID"&&export UBER_CLIENT_SECRET="YOUR_CLIENT_SECRET"
Run pip install -r requirements.txt to install dependencies
Run python app.py
Navigate to http://localhost:7000 in your browser
On the Uber developer page I've checked all boxes for my app and set the redirect. In my config.json, I've added lines for the UBER_CLIENT_ID and UBER_CLIENT_SECRET fields. I've run the export command from step 4 and echoed both environment variables to confirm that the variables are set. I created a virtualenv to install the dependencies and then ran the pip install and python app.py instructions. I'm running OS x and have tried with both Chrome and Safari and both browsers say they fail to make a secure connection to localhost.