conzty01/RA_Scheduler

Error Seen After Users Reporting Unable to Access App

conzty01 opened this issue · 1 comments

Jan 28 07:40:19 heroku/router at=info method=GET path="/schedule/api/getSchedule?monthNum=2&year=2022&allColors=true&start=2022-02-01T00%3A00%3A00-06%3A00&end=2022-03-01T00%3A00%3A00-06%3A00" host=radsa.conztech.org request_id=68cd89c5-55fc-4a10-a582-c690e5046054 fwd="74.207.34.10" dyno=web.1 connect=0ms service=11ms status=200 bytes=168 protocol=https
 Jan 28 07:40:42 heroku/router at=info method=POST path="//schedule/api/runScheduler" host=radsa.conztech.org request_id=d61863ce-74e0-402c-8c5f-c429396bdfc1 fwd="74.207.34.10" dyno=web.1 connect=0ms service=11ms status=200 bytes=262 protocol=https
 Jan 28 07:40:42 heroku/router at=error code=H13 desc="Connection closed without response" method=GET path="//schedule/api/checkSchedulerStatus?sqid=undefined" host=radsa.conztech.org request_id=fbd40b8d-ba05-432a-bbe2-ad7da9b8943c fwd="74.207.34.10" dyno=web.1 connect=0ms service=17ms status=503 bytes=0 protocol=https
 Jan 28 07:40:42 heroku/router at=error code=H13 desc="Connection closed without response" method=GET path="/schedule/api/getSchedule?monthNum=2&year=2022&allColors=true&start=2022-02-01T00%3A00%3A00-06%3A00&end=2022-03-01T00%3A00%3A00-06%3A00" host=radsa.conztech.org request_id=19f0bcd0-d045-48ab-9d6a-75f358f265d7 fwd="74.207.34.10" dyno=web.1 connect=0ms service=13ms status=503 bytes=0 protocol=https
 Jan 28 07:40:43 heroku/router at=info method=GET path="/breaks/api/getBreakDuties?monthNum=2&year=2022&allColors=false&start=2022-02-01T00%3A00%3A00-06%3A00&end=2022-03-01T00%3A00%3A00-06%3A00" host=radsa.conztech.org request_id=a7eaf322-a97d-405b-b1c0-405f3de98380 fwd="74.207.34.10" dyno=web.1 connect=0ms service=15ms status=200 bytes=283 protocol=https
 Jan 28 07:40:43 app/web.1 [2022-01-28 15:40:42.673] WARNING in schedule: Error Parsing Request Values for Scheduler: invalid literal for int() with base 10: '02/01/2022'
 Jan 28 07:40:43 app/web.1 [2022-01-28 15:40:42.737] ERROR in app: Exception on /schedule/api/checkSchedulerStatus [GET]
 Jan 28 07:40:43 app/web.1 Traceback (most recent call last):
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2284, in wsgi_app
 Jan 28 07:40:43 app/web.1 response = self.full_dispatch_request()
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1807, in full_dispatch_request
 Jan 28 07:40:43 app/web.1 rv = self.handle_user_exception(e)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1710, in handle_user_exception
 Jan 28 07:40:43 app/web.1 reraise(exc_type, exc_value, tb)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/_compat.py", line 35, in reraise
 Jan 28 07:40:43 app/web.1 raise value
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1805, in full_dispatch_request
 Jan 28 07:40:43 app/web.1 rv = self.dispatch_request()
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1791, in dispatch_request
 Jan 28 07:40:43 app/web.1 return self.view_functions[rule.endpoint](**req.view_args)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask_login/utils.py", line 261, in decorated_view
 Jan 28 07:40:43 app/web.1 return func(*args, **kwargs)
 Jan 28 07:40:43 app/web.1 File "/app/schedule/schedule.py", line 504, in checkSchedulerStatus
 Jan 28 07:40:43 app/web.1 cur.execute("SELECT status, reason FROM scheduler_queue WHERE id = %s", (sqid,))
 Jan 28 07:40:43 app/web.1 psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer: "undefined"
 Jan 28 07:40:43 app/web.1 LINE 1: ...CT status, reason FROM scheduler_queue WHERE id = 'undefined...
 Jan 28 07:40:43 app/web.1 ^
 Jan 28 07:40:43 app/web.1 [2022-01-28 15:40:42.815] ERROR in app: Exception on /schedule/api/getSchedule [GET]
 Jan 28 07:40:43 app/web.1 Traceback (most recent call last):
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2284, in wsgi_app
 Jan 28 07:40:43 app/web.1 response = self.full_dispatch_request()
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1807, in full_dispatch_request
 Jan 28 07:40:43 app/web.1 rv = self.handle_user_exception(e)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1710, in handle_user_exception
 Jan 28 07:40:43 app/web.1 reraise(exc_type, exc_value, tb)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/_compat.py", line 35, in reraise
 Jan 28 07:40:43 app/web.1 raise value
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1805, in full_dispatch_request
 Jan 28 07:40:43 app/web.1 rv = self.dispatch_request()
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1791, in dispatch_request
 Jan 28 07:40:43 app/web.1 return self.view_functions[rule.endpoint](**req.view_args)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask_login/utils.py", line 261, in decorated_view
 Jan 28 07:40:43 app/web.1 return func(*args, **kwargs)
 Jan 28 07:40:43 app/web.1 File "/app/schedule/schedule.py", line 186, in getSchedule2
 Jan 28 07:40:43 app/web.1 authedUser = getAuth()
 Jan 28 07:40:43 app/web.1 File "/app/helperFunctions/helperFunctions.py", line 45, in getAuth
 Jan 28 07:40:43 app/web.1 cur.execute("""
 Jan 28 07:40:43 app/web.1 psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block
 Jan 28 07:40:43 app/web.1 [2022-01-28 15:40:42.830] ERROR in app: Exception on /staff/api/getStats [GET]
 Jan 28 07:40:43 app/web.1 Traceback (most recent call last):
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 2284, in wsgi_app
 Jan 28 07:40:43 app/web.1 response = self.full_dispatch_request()
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1807, in full_dispatch_request
 Jan 28 07:40:43 app/web.1 rv = self.handle_user_exception(e)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1710, in handle_user_exception
 Jan 28 07:40:43 app/web.1 reraise(exc_type, exc_value, tb)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/_compat.py", line 35, in reraise
 Jan 28 07:40:43 app/web.1 raise value
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1805, in full_dispatch_request
 Jan 28 07:40:43 app/web.1 rv = self.dispatch_request()
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask/app.py", line 1791, in dispatch_request
 Jan 28 07:40:43 app/web.1 return self.view_functions[rule.endpoint](**req.view_args)
 Jan 28 07:40:43 app/web.1 File "/app/.heroku/python/lib/python3.9/site-packages/flask_login/utils.py", line 261, in decorated_view
 Jan 28 07:40:43 app/web.1 return func(*args, **kwargs)
 Jan 28 07:40:43 app/web.1 File "/app/staff/staff.py", line 119, in getRAStats
 Jan 28 07:40:43 app/web.1 authedUser = getAuth()
 Jan 28 07:40:43 app/web.1 File "/app/helperFunctions/helperFunctions.py", line 45, in getAuth
 Jan 28 07:40:43 app/web.1 cur.execute("""
 Jan 28 07:40:43 app/web.1 psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block

This issue was the result of a bug where, when a user opens the Enter Conflicts page on 1/31 and attempts to enter conflicts for the month of February, the calendar date is miscalculated. The conflicts would be saved in the database, however the client would incorrectly query for the submitted duties which caused confusion for users. Users would then attempt to resubmit their conflicts which caused data integrity errors to result from the database. This caused all cursors to fail to execute until the end of the transaction block.

Resolution was to change the date of the calDate to be the 15th of the month instead of the current date. This ensures that the user should not normally traverse to another month that does not have the calDate's date. Ex. Jan 31 -> Feb 31