wingsuit-designsystem / wingsuit-kickstarter

Wingsuit Kickstarter is a demo project to show how to use Wingsuit with Drupal.
12 stars 8 forks source link

error 2002 (HY000) Can't connect to local SQL server through socket / Lando support #26

Closed f1rf1n closed 1 year ago

f1rf1n commented 1 year ago

Hi there,

I am trying to get the kickstarter working with, Lando (the local dev package I use). I had some trouble at first (had to install node and yarn). But those are working now (see attched yml if interested)

But now the blt setup step of installing just halts after printing the error message below. I never had to put in my DB credentials, so obviously I am missing a step somewhere. Probably something that is done automagically on Docksal or DDev

Any hints?

Willing to provide any info needed, but I think this problem has a very easy solution.

The full error:

> drupal:deployment-identifier:init
Generating deployment identifier...
> drupal:sql:import
 [Acquia\Blt\Robo\Tasks\DrushTask] Running /app/wingsuit-kickstarter/vendor/bin/drush @self sql-drop --no-interaction --ansi &&
 /app/wingsuit-kickstarter/vendor/bin/drush @self sql-cli < ../dump/dump.sql --no-interaction --ansi in /app/wingsuit-kickstarter/docroot
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
f1rf1n commented 1 year ago

The .lando.yml file I am currently using.

name: wingsuit-kickstarter
recipe: drupal9
config:
  webroot: wingsuit-kickstarter/docroot
services:
  appserver:
    type: php
    build_as_root:
      # Note that you will want to use the script for the major version of node you want to install
      # See: https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
      - curl -sL https://deb.nodesource.com/setup_14.x | bash -
      - apt-get install -y nodejs
      - npm install --global yarn
tooling:
  node:
    service: appserver
  npm:
    service: appserver  
  yarn:
    service: appserver
f1rf1n commented 1 year ago

Then I found blt doctor which confirmed blt is not using my DB settings. So I changed my local.blt.yml to the Lando drupal9 recipe settings:

  db:
    database: drupal9
    username: drupal9
    password: drupal9
    host: database
    port: 3306

Also had to change the URI setting:

  local:
    protocol: http
    hostname: wingsuit-kickstarter.lndo.site

Still the same error though.

f1rf1n commented 1 year ago

And this was a case of RTFM, With the F standing for File, being the readm.md. I was looking at https://wingsuit-designsystem.github.io/drupal/ui_patterns/ which does NOT state:

Copy blt/example.local.blt.yml to blt/local.blt.yml and adjust your database settings in your blt/local.blt.yml file. After that run:

So yeah, that was an interesting couple of hours. For anyone else running into issues with Lando here is minimal complete working config:

recipe: drupal9
config:
  webroot: wingsuit-kickstarter/docroot
services:
  appserver:
    type: php:8.1
    build_as_root:
      # Note that you will want to use the script for the major version of node you want to install
      # See: https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
      - curl -sL https://deb.nodesource.com/setup_14.x | bash -
      - apt-get install -y nodejs
      - npm install --global yarn
tooling:
  node:
    service: appserver
  npm:
    service: appserver  
  yarn:
    service: appserver

Love this project BTW, brilliant