There was a problem connecting to the database

Hi, I’m trying run Passbolt on Docker with an RDS database, but I keep getting this error:

Running baseline checks, please wait…
Exception: SQLSTATE[HY000] [2002] No such file or directory in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 92]

Exception: There was a problem connecting to the database: SQLSTATE[HY000] [2002] No such file or directory in [/var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php, line 82]

I am building an image with docker compose, like this:

version: “3.4”
context: ./
dockerfile: ./docker/Dockerfile
tty: true
- env/passbolt.env
- gpg_volume:/var/www/passbolt/config/gpg
- images_volume:/var/www/passbolt/webroot/img/public
- /run
- 80:80
- 443:443


My env/passbolt.env is something like this:

Can someone help me, please?

[x] I have read intro post: About the Installation Issues category
[x] I have read the tutorials, help and searched for similar issues
[x] I provide relevant information about my server (component names and versions, etc.)
[x] I provide a copy of my logs and healthcheck
[x] I describe the steps I have taken to trouble shoot the problem
[x] I describe the steps on how to reproduce the issue

Hi @Elias Welcome to the forum!

Can you confirm if you already created the database on RDS and have granted privileges on it to the USER? Also, confirm from passbolt server command line that you can connect with:

mysql -u USER -p -h

If both of these steps are validated, the next step would be to build the container, and then run this to see if access to RDS is possible from within passbolt:

docker-compose exec passbolt mysql -u USER -p -h

Hi Garrett, thanks for the greetings!

I tried the steps you described and I have access to db in both ways. Locally everything works perfectly but when I try to deploy to production the error that I posted appears.

I am sending the image to an AWS ECR e then using a container orchestrator. Locally I am using Ubuntu 20.04.

@Elias I have read elsewhere that RDS may not need the port configured. Try commenting out the DATASOURCES_DEFAULT_PORT=3306 line and see if it makes a difference. (It may not, as the port may be set to a default 3306 in passbolt. But we can experiment if this first step does not work. )

The other issue may be security settings on the AWS end of things, like a firewall setting.

Hi @garrett I fixed the problem. I had to change the file


in the image and commit the changes. In that file, I changed the host parameter from localhost to the server URL, like thisScreenshot from 2021-01-19 20-42-52

1 Like

Great, so if that works maybe you will be able to revert it and use:



See: Database Basics - 3.9 which shows url as an alternative variable, specifically this section:

Finding a solution without hacking the source code will prevent a future issue during updates.

1 Like

Thanks @garrett it worked!

1 Like

@Elias thank you for posting the results from your work, it helps us all when you do this. Very much appreciated.

1 Like

I am using EC2 and RDS. but my DB details are not there in ./usr/share/php/passbolt/vendor/robmorgan/phinx/src/data/Phinx/phinx.yml.dist

Trying to find the location of the db config…


@poorni If you are still using AWS AMI as noted in your other post, it is structured differently than the Docker install as is being discussed in this thread. It is not recommended for you to look for phinx.yml.


For AWS AMI, where i should look for db details.
My main query , after we install in my case AWS AMI, where are the config files we create during the installation process.



Please ignore my query. Found it