You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DB version is 13 while the client bin versions (psql and pg_dump on appserver) are still on version 10.
If I define another Postgres version in the config, I'd expect that the recipe automatically uses the right version also for the client commands (psql, pg_dump).
I guess this is related to lando/lando#1680. I found a workaround also there.
I added following lines to get the client bins with the right version:
and I get pg_restore --version or sql --version is 10 unless I force the installation of 12 using the run section of the configuration. Because my dump file doesn't load to the database and writes incompatible version.
I think the issue description captures this, but our team ran into this and the cause wasn't obvious so I'll add a comment. Here's a minimal repro, showing that with a simple configuration it's possible to see mismatched client versions:
(the last two commands are the same, specifying then omitting the host)
In a Drupal recipe, drush sql:* will be wrapping the appserver versions of the commands, while Lando's sql-import command will use the database host's client tools and versions (unless the user specifies -h).
If the appserver needs matching versions (eg to use drush sql:* commands with PostgreSQL), then a workaround is to add a build step for your appserver to install a matching set of PostgreSQL client commands, as noted by @dpacassi in the issue description.
Working on both postgres and non-postgres projects, I'd probably rather Lando didn't add such a build step by default, unless it applied only to Lando configurations where postgres was used, as I wouldn't want to have to wait for extra steps on a rebuild if the project at hand won't use those tools at all.
NB: @Daisuke-sama#2 (comment) did not behave as expected because the test was done with lando ssh database (which drops the user into an appserver shell), not lando ssh -s database (database shell).
Activity
Daisuke-sama commentedon Mar 22, 2022
hey!
Same for me, while I am looking for the twelve version.
Also I cannot override the credentials
labboy0276 commentedon Apr 1, 2022
@dpacassi @Daisuke-sama can you please provide steps to replicate. Using the following lando file:
The commands show the right version:
Daisuke-sama commentedon Apr 1, 2022
sure, my steps:
and I get
pg_restore --versionorsql --versionis 10 unless I force the installation of 12 using the run section of the configuration. Because my dump file doesn't load to the database and writes incompatible version.Daisuke-sama commentedon Apr 1, 2022
labboy0276 commentedon Apr 1, 2022
strange @Daisuke-sama on this lando file:
I get the following:
And on yours:
What version of Lando are you on? Have you tried purging your system and starting over? https://docs.lando.dev/help/purging-containers.html
long-blade commentedon Nov 23, 2022
Same problem
After purging my system and starting over.
xurizaemon commentedon Jul 7, 2023
I think the issue description captures this, but our team ran into this and the cause wasn't obvious so I'll add a comment. Here's a minimal repro, showing that with a simple configuration it's possible to see mismatched client versions:
.lando.yml:
steps to reproduce:
(the last two commands are the same, specifying then omitting the host)
In a Drupal recipe,
drush sql:*will be wrapping the appserver versions of the commands, while Lando'ssql-importcommand will use thedatabasehost's client tools and versions (unless the user specifies-h).If the appserver needs matching versions (eg to use
drush sql:*commands with PostgreSQL), then a workaround is to add a build step for your appserver to install a matching set of PostgreSQL client commands, as noted by @dpacassi in the issue description.Working on both postgres and non-postgres projects, I'd probably rather Lando didn't add such a build step by default, unless it applied only to Lando configurations where postgres was used, as I wouldn't want to have to wait for extra steps on a rebuild if the project at hand won't use those tools at all.
NB: @Daisuke-sama #2 (comment) did not behave as expected because the test was done with
lando ssh database(which drops the user into an appserver shell), notlando ssh -s database(database shell).