Roots Discourse

Trellis: Problems with database connection (mariaDB)


#1

Hi,

my Trellis powered sites can not connect to their databases. Besides the familiar Error establishing a database connection page, they show following PHP error:

( ! ) Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /srv/www/XXX/current/web/wp/wp-includes/wp-db.php on line 1531

So I’ve tried vagrant reload --provision, which crashed on task mariadb : Install MySQL server] with the following error:

'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options
::=--force-confold"     install 'mariadb-server'' failed: No apport report
written because the error message indicates its a followup error from a
previous failure.
E: Sub-process /usr/bin/dpkg returned an error code (1)

No apport report written because the error message indicates its a followup
error from a previous failure.
E: Sub-process /usr/bin/dpkg returned an error code (1)

I can post the stack trace, if it will be of any use.


My configuration:

  • OSX 10.13.6
  • Vagrant 2.2.0 (updated for debug)
  • Trellis - current vagrant pull (did for debug)
  • Ansible 2.4.2.0_2 (donwgraded for debug)

I’m not aware of any change in my local environment - besides putting my computer to service for a keyboard repair, where they did not touch my data.

The issue looks awfully similar to this one - SOLVED! Vagrant provision - Composer could not find composer.json with encrypted HD - except I don’t have encrypted HD, so I’m not exactly sure what to do next.

Can you point me in some direction? Thanks.


#2

Also, I was wondering if the culprit was something in my existing configuration. So I’ve tried to do vagrant provision with plain Bedrock in my web folder (and changed wordpress_sites.yml, vault.yml files accordingly) and it led me to same result.


#3

Today I tried to provision brand new Trellis instance, so I could continue working at least on new projects. The provisioning process seem to get stuck on some Composer task.

vagrant reload --provision --debug =>

included: /Users/cibulka/wp/trellis/vendor/roles/composer/tasks/global-require.yml for default
DEBUG subprocess: stdout: 
TASK [composer : Install configured globally-required packages.] ***************
 INFO interface: detail: 
TASK [composer : Install configured globally-required packages.] ***************
TASK [composer : Install configured globally-required packages.] ***************

It would seem that the problem is with one of the globally required packages, unfortunately I can’t determine which one it is - there is no info in output and I can’t find the list of dependencies anywhere in Trellis directory.

Maybe this is connected to the problem with my existing box? The answer I linked mentioned Composer as well.

Thanks in advance, I really do need to solve this problem asap. :confused:

Edit

On 3rd attempt, provisioning of new Trellis box finished successfully. However problems with the old box persist.