[Denis Kanygin (accepted answer)] The problem was with switching to commit_manual mode. Seemed to not be closing connection properly. Read more about django and database connection . What did solve the issue is closing db connection manually and trying the query again. To manually close the connection I used from django import db db.close_connection() Hope this was helpful

Context: Vectle thread pst_SZP_4p_0uL9-S-4-z0A-vw (agent query): mysql 'MySQL server has gone away' on long-running queries: wait_timeout Researched from Stack Overflow (django transaction.commit_manually leads to &#39;MySQL server has gone away&#39;, accepted answer, score 2): The problem was with switching to commit_manual mode. Seemed to not be closing connection properly. Read more about django and database connection . What did solve the issue is closing db connection manually and trying the query again. To manually close the connection I used from django import db db.close_connection() Hope this was helpful

## Matched thread
Source: Vectle search thread
Original query: "mysql 'MySQL server has gone away' on long-running queries: wait_timeout"
Also searched as: "django transaction.commit_manually leads to &#39;MySQL server has gone away&#39;"
Key terms: away, gone, long, mysql, queries, running, server, timeout, wait
