starcraftman / cogBot

A discord bot for federals!
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Session Alive Too Long #56

Closed starcraftman closed 6 years ago

starcraftman commented 7 years ago

I think this is tied to GSheets update running while maintaining session.

Should be fixed by Issue #50 .

Sep 11 05:08:55 discord python[10200]: pymysql.err.OperationalError: (2006, "MySQL server has gone away (BrokenPip
Sep 11 05:08:55 discord python[10200]: "MySQL server has gone away (%r)" % (e,))
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: self._write_bytes(packet)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: self._execute_command(COMMAND.COM_QUERY, "ROLLBACK")
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: dbapi_connection.rollback()
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/sql
Sep 11 05:08:55 discord python[10200]: pool._dialect.do_rollback(self)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/sql
Sep 11 05:08:55 discord python[10200]: fairy._reset(pool)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/sql
Sep 11 05:08:55 discord python[10200]: Traceback (most recent call last):
Sep 11 05:08:55 discord python[10200]: During handling of the above exception, another exception occurred:
Sep 11 05:08:55 discord python[10200]: BrokenPipeError: [Errno 32] Broken pipe
Sep 11 05:08:55 discord python[10200]: self._sock.sendall(data)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: Traceback (most recent call last):
Sep 11 05:08:55 discord python[10200]: Exception during reset or similar
Sep 11 05:08:55 discord python[10200]: pymysql.err.OperationalError: (2006, "MySQL server has gone away (BrokenPip
Sep 11 05:08:55 discord python[10200]: "MySQL server has gone away (%r)" % (e,))
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: self._write_bytes(packet)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: self._execute_command(COMMAND.COM_QUERY, "ROLLBACK")
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: dbapi_connection.rollback()
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/sql
Sep 11 05:08:55 discord python[10200]: pool._dialect.do_rollback(self)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/sql
Sep 11 05:08:55 discord python[10200]: fairy._reset(pool)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/sql
Sep 11 05:08:55 discord python[10200]: Traceback (most recent call last):
Sep 11 05:08:55 discord python[10200]: During handling of the above exception, another exception occurred:
Sep 11 05:08:55 discord python[10200]: BrokenPipeError: [Errno 32] Broken pipe
Sep 11 05:08:55 discord python[10200]: self._sock.sendall(data)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/site-packages/pym
Sep 11 05:08:55 discord python[10200]: Traceback (most recent call last):
Sep 11 05:08:55 discord python[10200]: Exception during reset or similar
Sep 11 05:08:55 discord python[10200]: TypeError: list indices must be integers or slices, not NoneType
Sep 11 05:08:55 discord python[10200]: targets = [systems[current]]
Sep 11 05:08:55 discord python[10200]: File "/home/cog/live_hudson/cogdb/query.py", line 258, in fort_get_targets
Sep 11 05:08:55 discord python[10200]: new_target = cogdb.query.fort_get_targets(self.session)[0]
Sep 11 05:08:55 discord python[10200]: File "/home/cog/live_hudson/cog/actions.py", line 372, in execute
Sep 11 05:08:55 discord python[10200]: return self.gen.send(None)
Sep 11 05:08:55 discord python[10200]: File "/home/cog/.shell/pyenv/versions/3.5.3/lib/python3.5/asyncio/coroutine
starcraftman commented 6 years ago

I think I've fixed this. No longer sharing session between scanners. Each scanner fetches the data from sheet THEN makes a new internal session that exists only during parsing.

starcraftman commented 6 years ago

I haven't encountered it again. I'm closing. I believe a small fix of making new session within the scan helps.