Internal Server Error after a few minutes of app running smoothly

110 views
Skip to first unread message

BU Coaching

unread,
Jul 8, 2019, 9:34:38 AM7/8/19
to Google App Engine
Hi there,

I'm running an sms chatbot using Python, Twilio and IBM Watson. After I launch it on GAE, it runs fine for a few minutes, then suddenly stops responding. When I visit the page, it throws an Internal Server Error. Any ideas why this is happening? My app.yaml file has a default_expiration of 1 day and 23 hours, so I don't think that's the issue. Here are the logs:


2019-07-06 08:34:55 default[20190706t180659]  "GET /sms HTTP/1.1" 500
2019-07-06 08:34:55 default[20190706t180659]  [2019-07-06 08:34:55,204] ERROR in app: Exception on /sms [GET]
2019-07-06 08:34:55 default[20190706t180659]  Traceback (most recent call last):    File "/env/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app      response = self.full_dispatch_request()    File "/env/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request      rv = self.handle_user_exception(e)    File "/env/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception      reraise(exc_type, exc_value, tb)    File "/env/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise      raise value    File "/env/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request      rv = self.dispatch_request()    File "/env/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request      return self.view_functions[rule.endpoint](**req.view_args)    File "/srv/main.py", line 81, in incoming_sms      r = Watson(b)    File "/srv/main.py", line 42, in Watson      input = message_input    File "/srv/ibm_watson/assistant_v2.py", line 244, in message      accept_json=True)    File "/srv/ibm_cloud_sdk_core/base_service.py", line 358, in request      raise ApiException(response.status_code, error_message, http_response=response)  ibm_cloud_sdk_core.api_exception.ApiException: Error: NotFound: session id 2900da9f-dd77-480a-a939-1a5b060b3f82 for agent instance 6656a86c-ad0e-4463-8344-5f7fdcb4a6fe, Code: 404 , X-global-transaction-id: 62a3d6c769187f0c2bfb3cabe994ed32



Harmit Rishi (Cloud Platform Support)

unread,
Jul 9, 2019, 1:49:23 PM7/9/19
to google-a...@googlegroups.com
Hello, 

Thank you for using Google Groups!

Indeed 500 HTTP errors normally indicate a internal server issue. However, after cleaning up the stacktrace you have provided, I noticed that there was a error code of 404 being returned by the IBM SDK that you are using. Specifically, the following error message can be observed: 

ibm_cloud_sdk_core.api_exception.ApiException: Error: NotFound: session id: ... for agent instance ....., Code: 404 , X-global-transaction-id: ....

You may feel free to investigate the source of this 404 not found error within your code. Additionally, let me know if the 500 issue persists after resolving the 404 one.

Look forward to hearing from you.
Reply all
Reply to author
Forward
0 new messages