Skip to content
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

wit.wit.WitError: Wit responded with status: 400 (Bad Request) #120

Closed
sajalkatare opened this issue Dec 21, 2018 · 8 comments
Closed

wit.wit.WitError: Wit responded with status: 400 (Bad Request) #120

sajalkatare opened this issue Dec 21, 2018 · 8 comments

Comments

@sajalkatare
Copy link

Hi
I am making chatbot with pymessenger and Wit.ai. With the same code it was working fine but next day, I am getting
wit.wit.WitError: Wit responded with status: 400 (Bad Request)
Error for same thing.

I am not able to see my message on wit app logs.

Can some one please help. I am new to this.

@patapizza
Copy link
Member

Hi @sajalkatare,

400s are client-side errors. Are you sure nothing has changed on your end? Can you share an example of failing request?

@sajalkatare
Copy link
Author

@patapizza

I created all the files again and my code ran for 2 hours fine, and after that same issue I am facing. Please find more error part below:

wit.wit.WitError: Wit responded with status: 400 (Bad Request)
{'object': 'page', 'entry': [{'id': '2206311142940418', 'time': 1545638246832, 'messaging': [{'sender': {'id': '2206311142940418'}, 'recipient': {'id': '2348820981854726'}, 'timestamp': 1545637880362, 'message': {'is_echo': True, 'app_id': 743614985972642, 'mid': 'xoWtE-_2Yu-6pa2tREcniaA1yshz3q60Glv7JhSHXbGfI83AwpXAvKu_AiTyiXKITlmJ51E3hbKlmk_hqgyxMg', 'seq': 82715, 'text': 'We have many petrol pump in Bangalore. You can find the location here https://www.google.com/search?rlz=1C1GCEB_enIN812IN812&q=hp+petrol+pump+in+bangalore&npsic=0&rflfq=1&rlha=0&rllag=12970170,77666446,1870&tbm=lcl&ved=2ahUKEwj_67yRta7fAhUJTN8KHVhMDKMQtgN6BAgEEAQ&tbs=lrf:!2m1!1e3!2m1!1e16!3sIAE,lf:1,lf_ui:4&rldoc=1#rlfi=hd:;si:;mv:!1m2!1d13.016912!2d77.7249923!2m2!1d12.9087929!2d77.58675269999999;tbs:lrf:!2m1!1e3!2m1!1e16!3sIAE,lf:1,lf_ui:4'}}]}]}
127.0.0.1 - - [24/Dec/2018 13:27:29] "POST / HTTP/1.1" 500 -
Traceback (most recent call last):
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask_compat.py", line 35, in reraise
raise value
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask_compat.py", line 35, in reraise
raise value
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\sajal.katare\myvenv\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "C:\Users\sajal.katare\Desktop\FbBots_1223\app1223.py", line 53, in webhook
entity, value = wit_response(messaging_text)
File "C:\Users\sajal.katare\Desktop\FbBots_1223\utils.py", line 9, in wit_response
resp = client.message(message_text)
File "C:\Users\sajal.katare\myvenv\lib\site-packages\wit\wit.py", line 68, in message
resp = req(self.logger, self.access_token, 'GET', '/message', params)
File "C:\Users\sajal.katare\myvenv\lib\site-packages\wit\wit.py", line 41, in req
' (' + rsp.reason + ')')
wit.wit.WitError: Wit responded with status: 400 (Bad Request)

Kindly help.

@sajalkatare
Copy link
Author

Also The error from Ngrok:

ngrok by @inconshreveable (Ctrl+C to quit)

Session Status online
Session Expires 7 hours, 55 minutes
Version 2.2.8
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://897045ec.ngrok.io -> localhost:5000
Forwarding https://897045ec.ngrok.io -> localhost:5000

Connections ttl opn rt1 rt5 p50 p90
2 0 0.01 0.00 1.10 1.88

HTTP Requests

POST / 500 INTERNAL SERVER ERROR
GET / 200 OK

@patapizza
Copy link
Member

What is your Wit app id?

@sajalkatare
Copy link
Author

Issue resolved. Some mistake from my end. Closing the issue now.

@Bhanvi1600
Copy link

Hey i am also making a facebook messenger bot and experienced the same problem. How did you resolve it?

@trungtruc123
Copy link

i have problem similar you @sajalkatare , you can tutorial me fix bug in ?

@harshitmehta
Copy link

Hi @sajalkatare, could you let us know what the problem was? I'm facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants