Process ended with exit code 3221225477.
-
Hello everyone. I got a very weird issue with my application that I cannot seem to solve. I have developed an GUI application using PySide6 library that we have been using for a while and it seemed to be working fine.
A few days ago, I have been given a task to setup the application on 4 different Windows PC's. 2 of them are Desktop Windows 10PC's, the other 2 are Windows 11 laptops.
I have went ahead and installed Python, PySide6 and all other dependencies that my application needs to run. The application launched and worked without any issues on 2 Desktop PC's, but the other 2 Windows 11 laptops hit me with the weirdest error code: Process ended with exit code 3221225477 when trying to launch the application.
I have traced it to a particular method in my function, see it below:
def DB_start(self,database, timeout=3): # Close the previous connection if it exists and is open print("Trying to start db") if self.mydb is not None and self.mydb.is_connected(): self.mydb.close() print("Disconnected from the previous database.") try: self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout) except mysql.connector.Error as err: print(f"mydb failed: {err}") self.mysql_enabled = False; return 0 self.mysql_enabled = True return 1
The application crashes when trying to connect to mysql DB :
self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout)
It does not even print the error from the except:
except mysql.connector.Error as err: print(f"mydb failed: {err}") self.mysql_enabled = False; return 0
In my mainwindow.py I call:
self.mysql_db = mysql_db(self) print("Mysql class object created") if self.mysql_db is not None: if (self.mysql_db.DB_start("OUR_DB") == 1): self.ui.MYSQL_status_edit.setText("Connected") self.ui.database_edit.setText("RND_Testing") self.ui.MYSQL_status_edit.setStyleSheet("color: rgb(60, 179, 113);") else: self.ui.MYSQL_status_edit.setText("Disabled") self.ui.MYSQL_status_edit.setStyleSheet("color: rgb(255, 99, 71);")
and I see the following printed in the console when launching application from Qt Creator
Mysql class object created Trying to start db Process ended with exit code 3221225477.
If I comment out the
if (self.mysql_db.DB_start("OUR_DB") == 1):
from the code, the application will launch without any issues!I have initially thought that this might have something to do with the mysql-connector-python library (https://pypi.org/project/mysql-connector-python/) that I am using, so I have created a very simple python project that simply tried to connect to our mysql database:
import mysql.connector from mysql.connector import Error class mysql_db(): def __init__(self): super().__init__() def DB_start(self,database, timeout=3): try: self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout) except mysql.connector.Error as err: print(f"mydb failed: {err}") return 0 print("Connected to DB OK") return 1 mysql_db = mysql_db() mysql_db.DB_start("OUR_DB")
and when I simply run this, I see the following in console:
Connected to DB OK
Which confirms that I can connect to the DB and is reachable from this specific laptop. But when I try to run the same functions from within my PySide6 application even though I have commented out half of the UI and the application, it will crash with the error code 3221225477.
I would really appreciate if someone could shed some light on how debug this issue, perhaps there are some good python debugging tools where I could monitor what exactly happens? Could that be related to my application or that is the problem with the laptops?
-
Hello everyone. I got a very weird issue with my application that I cannot seem to solve. I have developed an GUI application using PySide6 library that we have been using for a while and it seemed to be working fine.
A few days ago, I have been given a task to setup the application on 4 different Windows PC's. 2 of them are Desktop Windows 10PC's, the other 2 are Windows 11 laptops.
I have went ahead and installed Python, PySide6 and all other dependencies that my application needs to run. The application launched and worked without any issues on 2 Desktop PC's, but the other 2 Windows 11 laptops hit me with the weirdest error code: Process ended with exit code 3221225477 when trying to launch the application.
I have traced it to a particular method in my function, see it below:
def DB_start(self,database, timeout=3): # Close the previous connection if it exists and is open print("Trying to start db") if self.mydb is not None and self.mydb.is_connected(): self.mydb.close() print("Disconnected from the previous database.") try: self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout) except mysql.connector.Error as err: print(f"mydb failed: {err}") self.mysql_enabled = False; return 0 self.mysql_enabled = True return 1
The application crashes when trying to connect to mysql DB :
self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout)
It does not even print the error from the except:
except mysql.connector.Error as err: print(f"mydb failed: {err}") self.mysql_enabled = False; return 0
In my mainwindow.py I call:
self.mysql_db = mysql_db(self) print("Mysql class object created") if self.mysql_db is not None: if (self.mysql_db.DB_start("OUR_DB") == 1): self.ui.MYSQL_status_edit.setText("Connected") self.ui.database_edit.setText("RND_Testing") self.ui.MYSQL_status_edit.setStyleSheet("color: rgb(60, 179, 113);") else: self.ui.MYSQL_status_edit.setText("Disabled") self.ui.MYSQL_status_edit.setStyleSheet("color: rgb(255, 99, 71);")
and I see the following printed in the console when launching application from Qt Creator
Mysql class object created Trying to start db Process ended with exit code 3221225477.
If I comment out the
if (self.mysql_db.DB_start("OUR_DB") == 1):
from the code, the application will launch without any issues!I have initially thought that this might have something to do with the mysql-connector-python library (https://pypi.org/project/mysql-connector-python/) that I am using, so I have created a very simple python project that simply tried to connect to our mysql database:
import mysql.connector from mysql.connector import Error class mysql_db(): def __init__(self): super().__init__() def DB_start(self,database, timeout=3): try: self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout) except mysql.connector.Error as err: print(f"mydb failed: {err}") return 0 print("Connected to DB OK") return 1 mysql_db = mysql_db() mysql_db.DB_start("OUR_DB")
and when I simply run this, I see the following in console:
Connected to DB OK
Which confirms that I can connect to the DB and is reachable from this specific laptop. But when I try to run the same functions from within my PySide6 application even though I have commented out half of the UI and the application, it will crash with the error code 3221225477.
I would really appreciate if someone could shed some light on how debug this issue, perhaps there are some good python debugging tools where I could monitor what exactly happens? Could that be related to my application or that is the problem with the laptops?
@lukutis222 Run in debugger to see where exactly it is crasing.
Also keep in mind that mysql-connector-python library is not part of Qt. -
I have tried to run it in debugger mode, see what happens:
self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout)
method returns
CMySQLConnection(*args, **kwargs)
in pooling.py- In CMySQLConnection class init method, it tried to do:
if kwargs: try: self.connect(**kwargs) except Exception: self.close() raise
-
inside
self.connect
, it callsself._open_connection()
-
Inside
open_connection()
method, it callsself._cmysql.connect(**cnx_kwargs)
and this is where the program crashes.
So my program seem to crash at connection_cext.py line 335, when
self._cmysql.connect(**cnx_kwargs)
is called.
-
I have tried to run it in debugger mode, see what happens:
self.mydb = mysql.connector.connect(host="our_server.hostname.lt",user="root",password="password",database=database,connection_timeout = timeout)
method returns
CMySQLConnection(*args, **kwargs)
in pooling.py- In CMySQLConnection class init method, it tried to do:
if kwargs: try: self.connect(**kwargs) except Exception: self.close() raise
-
inside
self.connect
, it callsself._open_connection()
-
Inside
open_connection()
method, it callsself._cmysql.connect(**cnx_kwargs)
and this is where the program crashes.
So my program seem to crash at connection_cext.py line 335, when
self._cmysql.connect(**cnx_kwargs)
is called.
@lukutis222 said in Process ended with exit code 3221225477.:
So my program seem to crash at connection_cext.py line 335, when self._cmysql.connect
Does it crash or throw an exception?
-
@lukutis222 said in Process ended with exit code 3221225477.:
So my program seem to crash at connection_cext.py line 335, when self._cmysql.connect
Does it crash or throw an exception?
@jsulm
It crashes. No exception, that makes it so much harder to debug... -
I have updated PySide from 6.7.2 to 6.8.0.1 and the issue is fixed.
Somehow there is an issue betwenn PySide 6.7.2 and certain windows 11 machines (maybe specific windows version?)