There is already an active transaction error (500) when adding multiple documents
- 0
- Databases
- Self Hosted
I'm trying to remove this entity from web console
and after restart - first try produces this error:
[Error] Timestamp: 2023-10-03T07:36:51+00:00
[Error] Method: DELETE
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: Utopia\Database\Exception
[Error] Message: Unknown PDO Type for object
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php
[Error] Line: 1424
[Error] Timestamp: 2023-10-03T07:36:53+00:00
Full log with comment:
[2023-10-03 07:40:27 $1.0] INFO Server is shutdown now
Worker 3 started successfully
Worker 2 started successfully
Worker 4 started successfully
Worker 5 started successfully
Worker 7 started successfully
Worker 6 started successfully
Worker 8 started successfully
Worker 9 started successfully
Worker 10 started successfully
Worker 11 started successfully
Worker 12 started successfully
[Setup] - Server database init started...
[Setup] - Creating database: appwrite...
[Setup] - Server database init completed...
Server started successfully (max payload is 6,291,456 bytes)
Master pid 1, manager pid 1
Worker 1 started successfully
[Error] Timestamp: 2023-10-03T07:41:31+00:00
[Error] Method: DELETE
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: Utopia\Database\Exception
[Error] Message: Unknown PDO Type for object
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php
[Error] Line: 1424
[Error] Timestamp: 2023-10-03T07:41:50+00:00
[Error] Method: DELETE
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: PDOException
[Error] Message: There is already an active transaction
[Error] File: @swoole-src/library/core/Database/PDOProxy.php
[Error] Line: 41
so after docker compose restart, first try is to delete comment entity (unknown PDO type) and second one is after trying to delete anything else (even without relations) - there is already active transaction
tbh database is unusable
This has been an elusive bug for us. It would help if we could get reproducible steps
Ok, I will try to isolate it - because we have 100% repro situation there
if you can reproduce it with a new project, you can provide us with those exact steps and then we can try to reproduce it on our end
This time we solved it by removing relationship within this collection. I tried to reproduce it this weekend but without success.
same relationship attribute does not have this problem
Got it again, I will do a backup tonight, clean user and customer data, and I will be able to give you access to broken instance
not my thread but does that mean that the relationship attribute is buggy and was the actual issue throwing the errors? I know one can still link tables otherwise, however it's so convenient to use (makes development easier) - need to check one more time from others first
I've been trying to reproduce this bug too, do you have more than one relationship attribute, I believe this happen when you remove a parent document, having childs referenced on it. I'm not totally sure, but maybe you can share what are you doing to see if is something similar to my setup
Relationships feature is experimental
true, let's help to improve it
I isolated 100% repro database schema
add anything to collection a add anything to collection b add document to collection c with id of document from collection b (probably not related) add document to collection d that has relationship to document from c and a second relationship to document from a
then try to remove document in collection c
voila
[Error] Timestamp: 2023-10-20T23:58:30+00:00
[Error] Method: DELETE
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: Utopia\Database\Exception
[Error] Message: Unknown PDO Type for object
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php
[Error] Line: 1427
for the first try
and on every another
[Error] Timestamp: 2023-10-20T23:59:15+00:00
[Error] Method: DELETE
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: PDOException
[Error] Message: There is already an active transaction
[Error] File: @swoole-src/library/core/Database/PDOProxy.php
[Error] Line: 41
tried on the new project
Bump
This sounds the same as this issue, right? https://github.com/appwrite/appwrite/issues/5850
yes
Recommended threads
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Edit ID of an existing collection
Hi there. Is it possible to edit an ID of an existing collection? Right now it looks impossible from AppWrite cloud at least.