{"action":"created","issue":{"url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/367","repository_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi","labels_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/367/comments","events_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/367/events","html_url":"https://github.com/GrahamDumpleton/mod_wsgi/issues/367","id":373782050,"node_id":"MDU6SXNzdWUzNzM3ODIwNTA=","number":367,"title":"Error 10053: MySQL server has gone away - occurs after running for app. 12 hours","user":{"login":"mbsEU","id":44457853,"node_id":"MDQ6VXNlcjQ0NDU3ODUz","avatar_url":"https://avatars1.githubusercontent.com/u/44457853?v=4","gravatar_id":"","url":"https://api.github.com/users/mbsEU","html_url":"https://github.com/mbsEU","followers_url":"https://api.github.com/users/mbsEU/followers","following_url":"https://api.github.com/users/mbsEU/following{/other_user}","gists_url":"https://api.github.com/users/mbsEU/gists{/gist_id}","starred_url":"https://api.github.com/users/mbsEU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbsEU/subscriptions","organizations_url":"https://api.github.com/users/mbsEU/orgs","repos_url":"https://api.github.com/users/mbsEU/repos","events_url":"https://api.github.com/users/mbsEU/events{/privacy}","received_events_url":"https://api.github.com/users/mbsEU/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-25T05:44:05Z","updated_at":"2018-10-26T05:14:32Z","closed_at":"2018-10-26T05:14:32Z","author_association":"NONE","body":"I have server running an api which is working fine when I restart the apache service.\r\nBut it stops to work after approximately 12 hours and reports an internal error.\r\n\r\nI have not been able to interpret what is causing the fault.\r\n\r\n**System**\r\nWindows 7\r\nWampserver64\r\n- Apache 2.4.33\r\n- MariaDB 10.2.14\r\nPython 3.6\r\n\r\n**Error log from apache2:**\r\n\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] ERROR in app: Exception on /product_structure/JBU [GET]\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] Traceback (most recent call last):\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\pymysql\\\\connections.py\", line 708, in _write_bytes\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  self._sock.sendall(data)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] \\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] During handling of the above exception, another exception occurred:\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] \\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] Traceback (most recent call last):\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\flask\\\\app.py\", line 2292, in wsgi_app\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  response = self.full_dispatch_request()\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\flask\\\\app.py\", line 1815, in full_dispatch_request\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  rv = self.handle_user_exception(e)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\flask\\\\app.py\", line 1718, in handle_user_exception\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  reraise(exc_type, exc_value, tb)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\flask\\\\_compat.py\", line 35, in reraise\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  raise value\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\flask\\\\app.py\", line 1813, in full_dispatch_request\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  rv = self.dispatch_request()\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\flask\\\\app.py\", line 1799, in dispatch_request\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  return self.view_functions[rule.endpoint](**req.view_args)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:/websites/api\\\\api.py\", line 29, in product_structure\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  cursor_product_structure_select.execute(sql_product_structure_select, f_product_code)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\pymysql\\\\cursors.py\", line 170, in execute\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  result = self._query(query)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\pymysql\\\\cursors.py\", line 328, in _query\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  conn.query(q)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\pymysql\\\\connections.py\", line 515, in query\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  self._execute_command(COMMAND.COM_QUERY, sql)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\pymysql\\\\connections.py\", line 766, in _execute_command\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  self._write_bytes(packet)\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] File \"c:\\\\anaconda3\\\\envs\\\\webapi\\\\lib\\\\site-packages\\\\pymysql\\\\connections.py\", line 713, in _write_bytes\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080]  \"MySQL server has gone away (%r)\" % (e,))\\r\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] pymysql.err.OperationalError: (2006, \"MySQL server has gone away (ConnectionAbortedError(10053, 'An established connection was aborted by the software in your host machine', None, 10053, None))\")\r\n> [Thu Oct 25 07:28:48.858023 2018] [wsgi:error] [pid 3476:tid 1080] \\r"},"comment":{"url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/comments/433288853","html_url":"https://github.com/GrahamDumpleton/mod_wsgi/issues/367#issuecomment-433288853","issue_url":"https://api.github.com/repos/GrahamDumpleton/mod_wsgi/issues/367","id":433288853,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMzI4ODg1Mw==","user":{"login":"mbsEU","id":44457853,"node_id":"MDQ6VXNlcjQ0NDU3ODUz","avatar_url":"https://avatars1.githubusercontent.com/u/44457853?v=4","gravatar_id":"","url":"https://api.github.com/users/mbsEU","html_url":"https://github.com/mbsEU","followers_url":"https://api.github.com/users/mbsEU/followers","following_url":"https://api.github.com/users/mbsEU/following{/other_user}","gists_url":"https://api.github.com/users/mbsEU/gists{/gist_id}","starred_url":"https://api.github.com/users/mbsEU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbsEU/subscriptions","organizations_url":"https://api.github.com/users/mbsEU/orgs","repos_url":"https://api.github.com/users/mbsEU/repos","events_url":"https://api.github.com/users/mbsEU/events{/privacy}","received_events_url":"https://api.github.com/users/mbsEU/received_events","type":"User","site_admin":false},"created_at":"2018-10-26T05:14:32Z","updated_at":"2018-10-26T05:14:32Z","author_association":"NONE","body":"I had declared the connection as a global which I was then using in my functions.\r\nIt was my initial though that the whole of the py-file was opened every time a call was made, but that is not the case.\r\nI have change the functions so that I connect every time from within my functions.\r\nThat did the trick."}}
{"actor":{"display_login":"mbsEU"}}