appwrite: π Bug Report: [1.4.X - 1.5.X] Function throws MySQL server has gone away
π Reproduction steps
Sometimes, when I try to call a function from Appwrite, I got the error :
flutter: AppwriteException: general_unknown, Server Error (500)
When I try to check on Appwrite, the function was not called at all, there is no failing execution in the execution listβ¦
I looked into docker logs appwrite right after this issue & get this strange log:
[Error] Timestamp: 2024-04-07T09:12:42+00:00
[Error] Method: POST
[Error] URL: /v1/functions/:functionId/executions
[Error] Type: PDOException
[Error] Message: MySQL server has gone away
[Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php
[Error] Line: 62
I ran docker logs appwrite-mariadb and I get:
[...]
2024-04-07 2:56:25 133 [Warning] Aborted connection 133 to db: 'appwrite' user: 'user' host: '172.20.0.14' (Got timeout reading communication packets)
2024-04-07 2:57:41 134 [Warning] Aborted connection 134 to db: 'appwrite' user: 'user' host: '172.20.0.14' (Got timeout reading communication packets)
2024-04-07 3:35:37 135 [Warning] Aborted connection 135 to db: 'appwrite' user: 'user' host: '172.20.0.14' (Got timeout reading communication packets)
2024-04-07 3:36:04 128 [Warning] Aborted connection 128 to db: 'appwrite' user: 'user' host: '172.20.0.11' (Got timeout reading communication packets)
2024-04-07 3:36:04 131 [Warning] Aborted connection 131 to db: 'appwrite' user: 'user' host: '172.20.0.12' (Got timeout reading communication packets)
2024-04-07 6:00:03 129 [Warning] Aborted connection 129 to db: 'appwrite' user: 'user' host: '172.20.0.14' (Got timeout reading communication packets)
π Expected behavior
It should execute all functions without error
π Actual Behavior
Sometimes function throw error 500
π² Appwrite version
Version 1.4.x
π» Operating system
Linux
π§± Your Environment
I use an Hetzner instance
π Have you spent some time to check if this issue has been raised before?
- I checked and didnβt find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (1 by maintainers)
I updated my instance to
version 1.5.4and since then I havenβt had any recurrence. However, Iβll have to test it further, as I havenβt had time to use appwrite much. But this is already very encouraging π@istornz Thank you for this valuable information. π
@Emilien-Lambert, after conducting some investigations, I believe thereβs a bug related to 1.4.X statistics.
Why?
Appwrite 1.5.X completely overhauls the statistics system. I upgraded my instance to 1.5.4 yesterday, and so far, it appears to be much improved. I havenβt encountered this error since the upgrade (wish me lucks :p).
As a temporary workaround, consider the following:
_APP_USAGE_STATSto false (not tested, but it should works?).Please note that this is purely speculative on my part. π
Any advice of Appwrite team like @stnguyen90 or @Meldiron would be great π