Back

[SOLVED] Internal Server 500 Error from Appwrite console

  • 1
  • Self Hosted
  • Web
Binyamin
20 Jul, 2023, 18:30

Run

TypeScript
docker logs appwrite

And share the last lines

TL;DR
The user was experiencing a 500 Internal Server Error from the Appwrite console. It was suggested to restart the Appwrite infrastructure by running `docker compose down && docker compose up -d`. Another solution was to reinstall everything, as there may have been issues connecting to the database. The user also tried restarting the database specifically by running `docker restart appwrite-mariadb`. However, the user still encountered the 500 error and received multiple error messages in the logs. The possible cause was that Appwrite was unable to connect to the database. It was recommended to check the docker logs for the `appwrite` container by running `docker
Luke Berry
20 Jul, 2023, 18:32

[Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php [Error] Line: 64 [Error] Timestamp: 2023-07-20T18:21:17+00:00 [Error] Method: GET [Error] URL: /v1/projects/:projectId/platforms [Error] Type: PDOException [Error] Message: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name does not resolve [Error] File: @swoole-src/library/core/Database/PDOPool.php [Error] Line: 35

Luke Berry
20 Jul, 2023, 18:33

There's the last several lines, but there's 50+ lines of errors

Binyamin
20 Jul, 2023, 18:34

It seems like Appwrite wasn't able to connect to the Database. First try to restart your Appwrite infrastructure by running this command in the same folder as your docker-compose.yml file is

TypeScript
docker compose down && docker compose up -d
Luke Berry
20 Jul, 2023, 18:36

Okay did that..

Luke Berry
20 Jul, 2023, 18:40

I ran the docker logs command again and there is many less error messages, but still about 20 lines of errors

Binyamin
20 Jul, 2023, 18:43

You still get the 500 error?

Binyamin
20 Jul, 2023, 18:43

What other errros?

Luke Berry
20 Jul, 2023, 18:43

[Error] Timestamp: 2023-07-20T18:36:40+00:00 [Error] Method: GET [Error] URL: /v1/functions [Error] Type: PDOException [Error] Message: SQLSTATE[HY000] [2002] Connection refused [Error] File: @swoole-src/library/core/Database/PDOPool.php [Error] Line: 35 [Error] Timestamp: 2023-07-20T18:36:49+00:00 [Error] Method: GET [Error] URL: /v1/databases [Error] Type: PDOException [Error] Message: MySQL server has gone away [Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php [Error] Line: 64 [Error] Timestamp: 2023-07-20T18:36:49+00:00 [Error] Method: GET [Error] URL: /v1/databases [Error] Type: PDOException [Error] Message: SQLSTATE[HY000] [2002] Connection refused [Error] File: @swoole-src/library/core/Database/PDOPool.php [Error] Line: 35 [Error] Timestamp: 2023-07-20T18:36:50+00:00 [Error] Method: GET [Error] URL: /v1/functions [Error] Type: PDOException [Error] Message: MySQL server has gone away [Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php [Error] Line: 64 [Error] Timestamp: 2023-07-20T18:36:51+00:00 [Error] Method: GET [Error] URL: /v1/functions [Error] Type: PDOException [Error] Message: MySQL server has gone away [Error] File: @swoole-src/library/core/Database/PDOStatementProxy.php [Error] Line: 64

Luke Berry
20 Jul, 2023, 18:44

that's the full log that was returned from the command

Binyamin
20 Jul, 2023, 18:53

What is the output of docker ps -a

Luke Berry
20 Jul, 2023, 18:54

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2892a52c94e7 appwrite/appwrite:1.3.7 "worker-functions" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-functions 0f6abb114c19 appwrite/appwrite:1.3.7 "executor" 18 minutes ago Up 18 minutes 80/tcp appwrite-executor c9f1d42338a2 traefik:2.7 "/entrypoint.sh --pr…" 18 minutes ago Up 18 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp appwrite-traefik 4f60269aa4da appwrite/appwrite:1.3.7 "worker-certificates" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-certificates dc7e444c3a01 appwrite/appwrite:1.3.7 "maintenance" 18 minutes ago Up 18 minutes 80/tcp appwrite-maintenance 61a56decf12a appwrite/appwrite:1.3.7 "docker-php-entrypoi…" 18 minutes ago Up 18 minutes 80/tcp appwrite 9ff9f5cd75fe appwrite/appwrite:1.3.7 "worker-builds" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-builds ece6e3de8efd appwrite/appwrite:1.3.7 "usage" 18 minutes ago Up 18 minutes

Luke Berry
20 Jul, 2023, 18:55

80/tcp appwrite-usage 3743561d3433 appwrite/appwrite:1.3.7 "worker-databases" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-databases f2bd8928a6f9 appwrite/appwrite:1.3.7 "worker-deletes" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-deletes acd54c984197 appwrite/appwrite:1.3.7 "worker-messaging" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-messaging 4d1099b5d083 appwrite/appwrite:1.3.7 "worker-mails" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-mails 3c922b046a7b appwrite/appwrite:1.3.7 "worker-audits" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-audits 497f782c03ba appwrite/appwrite:1.3.7 "worker-webhooks" 18 minutes ago Up 18 minutes 80/tcp appwrite-worker-webhooks bbed07daf107 appwrite/appwrite:1.3.7 "realtime" 18 minutes ago Up 18 minutes 80/tcp appwrite-realtime 46f4a18840e5 appwrite/appwrite:1.3.7 "schedule" 18 minutes ago Up 18 minutes 80/tcp appwrite-schedule b4b09a75b214 mariadb:10.7 "docker-entrypoint.s…" 18 minutes ago Up 17 minutes

Luke Berry
20 Jul, 2023, 18:55

3306/tcp appwrite-mariadb 7ffa468ee450 appwrite/telegraf:1.4.0 "/entrypoint.sh tele…" 18 minutes ago Up 18 minutes 8092/udp, 8125/udp, 8094/tcp appwrite-telegraf 7a9604ead52d redis:7.0.4-alpine "docker-entrypoint.s…" 18 minutes ago Up 18 minutes 6379/tcp appwrite-redis 24854c5fbb93 appwrite/influxdb:1.5.0 "/entrypoint.sh infl…" 18 minutes ago Up 18 minutes 8086/tcp appwrite-influxdb

Binyamin
20 Jul, 2023, 18:56

Try restarting just the db

TypeScript
docker restart appwrite-mariadb
Luke Berry
20 Jul, 2023, 18:57

still getting the 500 error on the console

Binyamin
20 Jul, 2023, 18:58

Somehow Appwrite is unanble to connect to the database, maybe you had a different database before that uses that volume.

Someone had the same issue as your ysterday https://discord.com/channels/564160730845151244/1130856927748948029/1131209903210500106

Binyamin
20 Jul, 2023, 18:58

The sulotion was to reinstall everything

Luke Berry
20 Jul, 2023, 18:59

Okay I'll take a look at that, sounds good. Thanks for your help!!

Binyamin
20 Jul, 2023, 18:59

If you don't have any important data you can reset the environment

Luke Berry
20 Jul, 2023, 18:59

Yea no important data, no problem

Binyamin
20 Jul, 2023, 19:00

So you can try to run

TypeScript
docker compose down -v && docker compose up -d
Binyamin
20 Jul, 2023, 19:00

The -v will remove all volumes

Luke Berry
20 Jul, 2023, 19:03

It worked!! Thanks for your help.

Drake
22 Jul, 2023, 20:54

[SOLVED] Internal Server 500 Error from Appwrite console

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