I have already made several attempts to fix the issue to no avail, including :-
This error is occuring both on local and staging environments.
In order to debug this further, I create a custom exception handler and logged the error as well as the last 3 SQL queries executed (which I got using connection.queries[-3:]).
The result is given below:
'EXCEPTION': InterfaceError(0, ''), 'LAST_QUERIES': [{'sql': 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', 'time': '0.000'}, {'sql': None, 'time': '0.000'}]Notice that for the second query, the value of 'sql' is coming as None. Is Django trying to execute a null query? Could this be the cause of the strange, intermittent errors? Is this a bug inside Django or have I configured something incorrectly?
