Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading existing local sites in lando 3.20.x => 3.21.x beta or stable database fails to build site fails to load #125

Closed
bronius-congruity opened this issue Aug 24, 2024 · 0 comments

Comments

@bronius-congruity
Copy link

bronius-congruity commented Aug 24, 2024

I think when 3.21 alpha/beta started coming out (excellent improvements, btw) a lot of us got snagged on the upgrade. Now several months later I am back at it and finally cracked what went wonky for me and what worked.

Wonky:

Existing Drupal site built with a lando 3.20.x recipe referencing "mariadb" would not lando rebuild successfully with upgraded lando 3.21.x. Using the same sort of recipe, I can start a new project (and db comes up, and healthcheck passes), but I can't seem to latch onto existing ones. Upon closer inspection, my database build failed with a write permission error:

lando logs -s database

Lando Log
database_1  | userperms 21:23:33.29 WARN  ==> Only the root user can reset permissions! This is probably ok though...
database_1  | loadkeys 21:23:33.39 WARN  ==> Only the root user can load ssh keys! This is probably ok though...
database_1  | lando 21:23:33.40 INFO  ==> Lando handing off to: /launch.sh
database_1  | lando 21:23:33.42 DEBUG ==> Running command with exec...
database_1  | mariadb 21:23:33.51
database_1  | mariadb 21:23:33.54 Welcome to the Bitnami mariadb container
database_1  | mariadb 21:23:33.55 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-mariadb
database_1  | mariadb 21:23:33.57 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-mariadb/issues
database_1  | mariadb 21:23:33.59
database_1  | mariadb 21:23:33.71 INFO  ==> ** Starting MariaDB setup **
database_1  | mariadb 21:23:33.80 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars
database_1  | mariadb 21:23:33.83 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
database_1  | mariadb 21:23:33.88 INFO  ==> Initializing mariadb database
database_1  | mariadb 21:23:33.91 DEBUG ==> Ensuring expected directories/files exist
database_1  | mkdir: cannot create directory '/bitnami/mariadb/data': Permission denied

What worked

Warning: This will destroy your database and data. But follow all the steps, and you don't lose it.

Dump db to local (host) disk, rebuild (like destroy and rebuild), and then load db dump again:

lando drush sql-dump > ../some/path/db.sql
lando destroy -y
lando rebuild -y
lando drush sqlc < ../some/path/db.sql

Sharing here in hopes it helps someone else (or me in a few months down the road).

@rtfm-47 rtfm-47 transferred this issue from lando/lando Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants