appwrite: πŸ› Bug Report: Appwrite manual installation throwing "Failed to connect to database" error

πŸ‘Ÿ Reproduction steps

Hello, I’m having some trouble with the manual installation steps on Ubuntu22.04. I’ve made my changes in the .env file and ran docker compose up -d --remove-orphans. After that, judging from the output, everything looks fine. But when I look in the Appwrite container logs I find a database connection error and appwrite also doesnt start properly. I checked in the mariadb container, the credentials I set in the .env file are valid and I can connect to the database.

πŸ‘ Expected behavior

It should install with docker-compose properly with all the changes from the .env file and be reachable over the configured domain.

πŸ‘Ž Actual Behavior

Database connection not working. Appwrite container logs showing error:

Database not ready. Retrying connection (1)...
Database not ready. Retrying connection (2)...
Database not ready. Retrying connection (3)...
Database not ready. Retrying connection (4)...
Database not ready. Retrying connection (5)...
Database not ready. Retrying connection (6)...
Database not ready. Retrying connection (7)...
Database not ready. Retrying connection (8)...
Database not ready. Retrying connection (9)...
Database not ready. Retrying connection (10)...

Fatal error: Uncaught Exception: Failed to connect to database: Failed to create connection: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct? in /usr/src/code/app/http.php:82
Stack trace:
#0 {main}
  thrown in /usr/src/code/app/http.php on line 82
[2023-11-01 23:19:49 *97.0]	ERROR	php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Uncaught Exception: Failed to connect to database: Failed to create connection: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct? in /usr/src/code/app/http.php:82
Stack trace:
#0 {main}
  thrown in /usr/src/code/app/http.php on line 82

Checked mariadb container, shows no error. Verified database credentials from .env file are working with mariadb container.

🎲 Appwrite version

Version 1.4.x

πŸ’» Operating system

Linux

🧱 Your Environment

I use a Hetzner Cloud server (CPX21) with Ubuntu 22.04 and am trying to install AppWrite 1.4.8. I always create a separate user for all the docker stuff and run the docker compose command with this user.

πŸ‘€ 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?

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

After doing some trial and error I think the problem was that I set the _APP_REDIS_USER & _APP_REDIS_PASS vars.

Ahh yes. That is probably related to https://github.com/appwrite/appwrite/issues/3309. The library we are/were using doesn’t support passing a user and password. We are moving off of that library, though, so, hopefully, we can get the related issue fixed in the near future.

For now, I’m going to close this as resolved. Thanks for your patience!

@stnguyen90

How did you do that?

I did the wipe using the command you mentioned in your previous post docker compose down -v.

How did you verify that?

I did a docker exec into the appwrite-mariadb container and connected to the database from within the container with the mysql-client. This worked and I could connect with both accounts, normal user account and root account with the adjusted credentials from the .env-file. If I try to connect with the mysql-client from outside of the container none of the accounts work.

@patrickc-sb, thanks for creating this issue! πŸ™πŸΌ

I’ve made my changes in the .env file and ran docker compose up -d --remove-orphans

Did you already have Appwrite running before you did this? If so, updating the database password in the .env file doesn’t actually change the database password. You’ll need to follow the usual mysql/mariadb steps to update the password in the database.