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