Back

Failed to create connection: SQLSTATE[HY000] [1040] Too many connections after upgrading to 1.4.0

  • 0
  • Self Hosted
WasklyWabbit#1
30 Aug, 2023, 18:10

Get this error when attempting to log in at WebUI after migration; {"message":"Error: Error handler had an error: Failed to create connection: SQLSTATE[HY000] [1040] Too many connections","code":500,"file":"usrsrccodevendorutopia-phpframeworksrcApp.php","line":551,"trace":[{"file":"usrsrccodevendorutopia-phpframeworksrcApp.php","line":673,"function":"execute","class":"UtopiaApp","type":"->","args":[{},{},{}]},{"file":"usrsrccodeapphttp.php","line":258,"function":"run","class":"UtopiaApp","type":"->","args":[{},{}]}],"version":"1.4.0"}

One error was displayed during installation (Google analytics is blocked across entire network) Running "docker compose up -d --remove-orphans --renew-anon-volumes"

[Error] Google Analytics Error: [Error] Type: Exception [Error] Message: Failed to connect to www.google-analytics.com port 443 after 1 ms: Couldn't connect to server [Error] File: /usr/src/code/vendor/utopia-php/analytics/src/Analytics/Adapter.php [Error] Line: 180

Appwrite installed successfully

TL;DR
After upgrading to version 1.4.1 of the app, the issue was resolved. However, a new error "Error handler had an error: Pool 'console' is empty" occurred. This was resolved by updating the `_APP_DOMAIN_FUNCTIONS` variable in the `.env` file to include the correct domain. The app was running without any issues except for the functions Tab in the console, which still showed a 500 error. To resolve the issue, the following steps were taken: 1. Go to the `appwrite/` directory. 2. Execute the command `docker exec -it appwrite-redis redis-cli`.
Binyamin
30 Aug, 2023, 18:12

Follow this

Drake
30 Aug, 2023, 18:14

Failed to create connection: SQLSTATE[HY000] [1040] Too many connections after upgrading to 1.4.0

WasklyWabbit#1
30 Aug, 2023, 18:17

Partially solved - now stuck on 500 error

Binyamin
30 Aug, 2023, 18:20

For that part check this

WasklyWabbit#1
30 Aug, 2023, 18:26

Made change to maria conf, additional error now thrown by service worker, but still 500

WasklyWabbit#1
30 Aug, 2023, 18:27

(i also took down and restarted the whole stack)

WasklyWabbit#1
30 Aug, 2023, 18:32

Also tried on 127.0.0.1 - which did bring up the login prompt - but get 500 when trying to display dashboard

Binyamin
30 Aug, 2023, 18:32

What are the logs from the main Appwrite

Binyamin
30 Aug, 2023, 18:32
TypeScript
docker logs appwrite
WasklyWabbit#1
30 Aug, 2023, 18:35
Binyamin
30 Aug, 2023, 18:36

You'll need to clear the redis cache

Binyamin
30 Aug, 2023, 18:36

Like so

WasklyWabbit#1
30 Aug, 2023, 18:39

Different errors, still 500

Binyamin
30 Aug, 2023, 18:41

Can you try in incognito?

WasklyWabbit#1
30 Aug, 2023, 18:41

It's just a gash local install, so I can just wipe it - unless you want to investigate cause further?

Binyamin
30 Aug, 2023, 18:41

What's easy for you

WasklyWabbit#1
30 Aug, 2023, 18:41

Incognito gives same problem

WasklyWabbit#1
30 Aug, 2023, 18:41

I will just wipe it

itai
30 Aug, 2023, 19:07

I did the following and it works for me

cd appwrite/ docker exec -it appwrite-redis redis-cli flushall exit docker compose up -d --remove-orphans --renew-anon-volumes docker compose exec appwrite migrate

itai
30 Aug, 2023, 19:07

thanks @Binyamin

Binyamin
30 Aug, 2023, 19:08

<:appwriteupvote:899677724615016528>

itai
30 Aug, 2023, 19:20

it works and then it fail with another error Error: Error handler had an error: Pool 'console' is empty . I notice in the new .env file we have _APP_DOMAIN_FUNCTIONS= but it was empty, so I updated it to: _APP_DOMAIN_FUNCTIONS=localhost and now the app is running except for the functions Tab in the console, still shows 500

WasklyWabbit#1
31 Aug, 2023, 06:45

@Binyamin I didnt get round to wiping local install last night, then spotted that 1.4.1 was out, did a local migration to 1.4.1, and it came up without any 500s. Many thnaks

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more