Back

[SOLVED] Migration error

  • 0
  • Self Hosted
  • General
DPC2709
6 Sep, 2023, 20:12

Hello everyone, I upgrade from 1.3.8 to 1.4.1, and when I tried to migrate the data this error shows.

Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again

TL;DR
The user encountered a migration error after upgrading from version 1.3.8 to 1.4.1 of the app. They received the error message "Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again." They tried restarting Docker and checking the credentials in MariaDB, but the error persisted. The user was advised to run the migrate command before using appwrite after upgrading. The issue was resolved by running the migrate command successfully.
DPC2709
6 Sep, 2023, 20:13

I tried to open the dashboard and this error appear on the web: // 20230906160747 // my url here

{ "message": "Error: Server Error", "code": 500, "version": "1.4.1" }

Drake
6 Sep, 2023, 22:06

you need to run the migrate command before using appwrite after upgrading

Drake
6 Sep, 2023, 22:06

try to restart things:

TypeScript
docker compose down
docker compose up -d --remove-orphans
DPC2709
6 Sep, 2023, 22:19

I tried. But the error is the same. I checked the credentials in mariadb and it is ok

Drake
6 Sep, 2023, 22:39

how about docker compose restart appwrite ?

DPC2709
6 Sep, 2023, 22:51

Same. The website isn’t loading and docker doctor said:

DPC2709
6 Sep, 2023, 22:51

👩‍⚕️ Running Appwrite Doctor for version 1.4.1 ...

[Settings] 🟢 Hostname has a public suffix () 🟢 CNAME target has a public suffix () 🟢 Using a unique secret key for encryption 🟢 App environment is set for production 🟢 Abuse protection is enabled 🟢 Console access limits are enabled 🔴 HTTPS force option is disabled 🔴 Logging adapter is disabled

[Connectivity] 🔴 Console.DB.(console)...........................disconnected 🔴 Projects.DB.(database_db_main).................disconnected 🟢 Cache(cache_redis_main)...........................connected 🟢 Queue(queue)......................................connected 🟢 PubSub(pubsub)....................................connected 🔴 SMTP...........................................disconnected

[Volumes] 🟢 Uploads Volume is readable 🟢 Uploads Volume is writeable 🟢 Cache Volume is readable 🟢 Cache Volume is writeable 🟢 Config Volume is readable 🟢 Config Volume is writeable 🟢 Certs Volume is readable 🟢 Certs Volume is writeable

[Disk Space] 🟢 Uploads Volume has 90.01GB free space (13.38% used) 🟢 Cache Volume has 90.01GB free space (13.38% used) 🟢 Config Volume has 90.01GB free space (13.38% used) 🟢 Certs Volume has 90.01GB free space (13.38% used)

Failed to check for a newer version

Drake
6 Sep, 2023, 23:42

how did you check? did you change the default credentials?

DPC2709
6 Sep, 2023, 23:44

I run the bash of the MariaDB container, check user permissions in the DB, and the password

DPC2709
6 Sep, 2023, 23:45

I made a rollback in the server right now. So, I'm gonna try to upgrade from 1.3.8 to 1.4.1 again

Drake
6 Sep, 2023, 23:45

i wonder if it's a docker network problem...

DPC2709
7 Sep, 2023, 00:15

It is weird. I made the upgrade but this time I didn't anything. When the upgrade finished, I ran the docket compse down and then docker compose up -d --remove-orphans But the website has error 500

Drake
7 Sep, 2023, 00:16

you ran the migrate command successfully?

DPC2709
7 Sep, 2023, 00:16

No, only restart docker after upgrade

Drake
7 Sep, 2023, 00:17

ya you can't use appwrite without running the migrate command

DPC2709
7 Sep, 2023, 00:19

I get the same error

DPC2709
7 Sep, 2023, 00:19

appwrite# docker compose exec appwrite migrate Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again

Drake
7 Sep, 2023, 00:19

would you please run docker network inspect appwrite and share the output

DPC2709
7 Sep, 2023, 00:21

Ok, I sent the result to DM

DPC2709
7 Sep, 2023, 00:27

I have this error from the appwrite log

DPC2709
7 Sep, 2023, 00:27

fatal error: Uncaught Exception: Failed to connect to database: Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again in /usr/src/code/app/http.php:82 Stack trace: #0 {main} thrown in /usr/src/code/app/http.php on line 82 [2023-09-07 00:25:34 *31.0] ERROR php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Uncaught Exception: Failed to connect to database: Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again in /usr/src/code/app/http.php:82 Stack trace: #0 {main} thrown in /usr/src/code/app/http.php on line 82 Database not ready. Retrying connection (10)... Database not ready. Retrying connection (1)... [Error] Type: Utopia\Exception [Error] Message: Error handler had an error: Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again [Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php [Error] Line: 551 Database not ready. Retrying connection (2)... [Error] Type: Utopia\Exception [Error] Message: Error handler had an error: Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again [Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php [Error] Line: 551 [Error] Type: Utopia\Exception [Error] Message: Error handler had an error: Failed to create connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again [Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php [Error] Line: 551 Database not ready. Retrying connection (3)...

DPC2709
9 Sep, 2023, 19:37

[Solved] Migration error

DPC2709
9 Sep, 2023, 19:37

[SOLVED] Migration error

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