Steffo99 / greed

Customizable, multilanguage Telegram shop bot with Payments support
GNU Affero General Public License v3.0
527 stars 261 forks source link

[via email] Error when making the payment Steffo99/greed #121

Closed Steffo99 closed 3 years ago

Steffo99 commented 3 years ago

From: samuel ramirez jsramirezch@outlook.com

2021-05-06 12:46:54 | Worker 1775961268 | worker | Exception in <Worker 177= 5961268>: (sqlite3.IntegrityError) NOT NULL constraint failed: orderitems.o= rder_id [SQL: INSERT INTO orderitems (product_id, order_id) VALUES (?, ?)] [parameters: (1, None)] (Background on this error at: http://sqlalche.me/e/14/gkpj) Traceback (most recent call last): File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\base.py", line 1763, in _execute_context self.dialect.do_execute( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\default.py", line 717, in do_execute cursor.execute(statement, parameters) sqlite3.IntegrityError: NOT NULL constraint failed: orderitems.order_id

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Users\jsram\greed\worker.py", line 211, in run self.admin_menu() File "C:\Users\jsram\greed\worker.py", line 926, in __admin_menu self.user_menu() File "C:\Users\jsram\greed\worker.py", line 468, in user_menu self.__order_menu() File "C:\Users\jsram\greed\worker.py", line 663, in order_menu self.__order_transaction(order=3Dorder, value=3D-int(self.get_cart_va= lue(cart))) File "C:\Users\jsram\greed\worker.py", line 689, in order_transaction self.session.commit() File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\session.py", line 1428, in commit self._transaction.commit(_to_root=3Dself.future) File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\session.py", line 826, in commit self._prepare_impl() File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\session.py", line 805, in _prepare_impl self.session.flush() File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\session.py", line 3260, in flush self._flush(objects) File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\session.py", line 3400, in _flush transaction.rollback(_captureexception=3DTrue) File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\util\langhelpers.py", line 70, in exit compat.raise( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\util\compat.py", line 211, in raise_ raise exception File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\session.py", line 3360, in _flush flush_context.execute() File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\unitofwork.py", line 453, in execute rec.execute(self) File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\unitofwork.py", line 627, in execute util.preloaded.orm_persistence.save_obj( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\persistence.py", line 242, in save_obj _emit_insert_statements( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\orm\persistence.py", line 1219, in _emit_insert_statements result =3D connection._execute_20( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\base.py", line 1578, in _execute_20 return meth(self, args_10style, kwargs_10style, execution_options) File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\sql\elements.py", line 320, in _execute_on_connection return connection._execute_clauseelement( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\base.py", line 1447, in _execute_clauseelement ret =3D self._execute_context( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\base.py", line 1806, in _execute_context self._handle_dbapi_exception( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\base.py", line 1987, in _handle_dbapiexception util.raise( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\util\compat.py", line 211, in raise_ raise exception File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\base.py", line 1763, in _execute_context self.dialect.do_execute( File "C:\Users\jsram\AppData\Local\Programs\Python\Python39\lib\site-pack= ages\sqlalchemy\engine\default.py", line 717, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint= failed: orderitems.order_id [SQL: INSERT INTO orderitems (product_id, order_id) VALUES (?, ?)] [parameters: (1, None)] (Background on this error at: http://sqlalche.me/e/14/gkpj) Enviado desde Correohttps://go.microsoft.com/fwlink/?LinkId=3D550986 para= Windows 10

Steffo99 commented 3 years ago

This bug was introduced in 262eea2b38a6d826208c2abb8f622f2bb6cef4d1 .

@valentino-sm, can you please fix it? :)

valentino-sm commented 3 years ago

Looks like I'm making all worse =D I can't reproduce exception now Looks similar what 6a70a45211c7f2a9e71afd79f8ddd597d1297a5f fixes

Steffo99 commented 3 years ago

This should be fixed.