0

The following piece of code throws an "Unkown error" exception when inserting into the database. The MariaDB error logs do not show anything. My versions are: Python 3.10, MariaDb 10.3.

import sys
import mariadb

def execute(sql, args=[], fetch=False, fail=True):
    out = False
    conn = pool.get_connection()
    cursor = conn.cursor(dictionary=True)
    try:
           cursor.execute(sql, args)
    except mariadb.Error as e:
            print("Mariadb: " + str(e))
    except BaseException as e:
            print("Base: " + str(e))
    except Exception as e:
            print("Exception: " + str(e))

Any ideas how to solve this? The error seems to occur quite randomly.

Restarted the MariaDB server, investigated the specific insert instances.

  • Since we don't have a crystal ball, please also provide the version of MariaDB Connector/Python, the SQL statement and parameters. – Georg Richter Mar 15 '23 at 22:29

0 Answers0