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

latest postgres docker image update fails #1612

Closed
JorisVanEijden opened this issue May 9, 2019 · 13 comments

Comments

Projects
None yet
5 participants
@JorisVanEijden
Copy link

commented May 9, 2019

Bitnami changed the config of their postgres container: https://github.com/bitnami/bitnami-docker-postgresql#notable-changes

This makes postgres installs fail.

name: test
recipe: lamp
config:
  php: '7.2'
  database: postgres

It will fail to start and the logs show a failure to start the entrypoint.

Remove any existing postgres images to ensure lando downloads the latest container.
docker images -f reference=bitnami/postgresql -q | xargs docker rmi -f

Attempted start:

$ lando start
...
Starting test_database_1 ... done
ERROR: No container found for database_1
error: Looks like database is not running! It should be so this is a problem.
warn: Try running `lando logs -s database` to help locate the problem!

The log:

$ lando logs -s database
Attaching to test_database_1
database_1   | mkdir: cannot create directory ‘/etc/ssh’: Permission denied
database_1   | Running command /app-entrypoint.sh /run.sh
database_1   | Running with exec!
database_1   | /lando-entrypoint.sh: 26: exec: /app-entrypoint.sh: not found
database_1   | mkdir: cannot create directory ‘/etc/ssh’: Permission denied
database_1   | Running command /app-entrypoint.sh /run.sh
database_1   | Running with exec!
database_1   | /lando-entrypoint.sh: 26: exec: /app-entrypoint.sh: not found

Workaround:
Use a tagged postgresql image from before r70:

name: test
recipe: lamp
config:
  php: '7.2'
  database: postgres:10.6.0-r68 

@JorisVanEijden JorisVanEijden added the bug label May 9, 2019

@mrweiner

This comment has been minimized.

Copy link

commented May 9, 2019

I'm seeing the sameon both 10.7.0 and 9.6, although the workaround doesn't appear to work with either of the following .lando.yml files for 3.0.0-rc.16 on windows 10 pro for workstations.

name: st
recipe: drupal8
services:
  appserver:
    xdebug: true
  database:
    type: postgres:10.7.0-r68
    portforward: 3307
config:
  webroot: st_project/web
  php: 7.2
name: st
recipe: drupal8
services:
  appserver:
    xdebug: true
config:
  webroot: st_project/web
  php: 7.2
  database: postgres:10.7.0-r68 

Both throw

error: Error: postgres version 10.7.0-r68 is not supported
    at new LandoService (C:\snapshot\lando\build\cli\plugins\lando-core\compose\lando\builder.js:0:0)
    at new LandoService (C:\snapshot\lando\build\cli\plugins\lando-core\types\service\builder.js:0:0)
    at new LandoPostgres (C:\snapshot\lando\build\cli\plugins\lando-services\services\postgres\builder.js:0:0)
    at module.exports.app.events.on._.forEach.service (C:\snapshot\lando\build\cli\plugins\lando-services\app.js:0:0)    
    at arrayEach (C:\snapshot\lando\build\cli\node_modules\lodash\lodash.js:516:11)
    at Function.forEach (C:\snapshot\lando\build\cli\node_modules\lodash\lodash.js:9344:14)
    at AsyncEvents.module.exports.app.events.on (C:\snapshot\lando\build\cli\plugins\lando-services\app.js:0:0)
    at AsyncEvents.handle (C:\snapshot\lando\build\cli\lib\events.js:0:0)
    at emit.Promise.each.fn (C:\snapshot\lando\build\cli\lib\events.js:0:0)
From previous event:
    at AsyncEvents.emit (C:\snapshot\lando\build\cli\lib\events.js:0:0)
    at module.exports.init.loadPlugins.then (C:\snapshot\lando\build\cli\lib\app.js:0:0)
From previous event:
    at App.init (C:\snapshot\lando\build\cli\lib\app.js:0:0)
    at lando.Promise.try (C:\snapshot\lando\build\cli\lib\cli.js:0:0)
From previous event:
    at handleInteractive (C:\snapshot\lando\build\cli\lib\cli.js:0:0)
    at module.exports.parseToYargs.checkForUpdates.then.lando.bootstrap.then.lando.events.emit.then.then (C:\snapshot\lan
do\build\cli\lib\cli.js:0:0)
From previous event:
    at module.exports.parseToYargs.checkForUpdates.then.lando.bootstrap.then.lando (C:\snapshot\lando\build\cli\lib\cli.j
s:0:0)
From previous event:
    at module.exports.parseToYargs.checkForUpdates.then (C:\snapshot\lando\build\cli\lib\cli.js:0:0)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
From previous event:
    at Object.handler (C:\snapshot\lando\build\cli\lib\cli.js:0:0)
    at Object.runCommand (C:\snapshot\lando\build\cli\node_modules\yargs\lib\command.js:238:44)
    at Object.parseArgs [as _parseArgs] (C:\snapshot\lando\build\cli\node_modules\yargs\yargs.js:1063:30)
    at Function.get [as argv] (C:\snapshot\lando\build\cli\node_modules\yargs\yargs.js:1004:21)
    at Cli.run (C:\snapshot\lando\build\cli\lib\cli.js:0:0)
    at Object.<anonymous> (C:\snapshot\lando\build\cli\bin\lando.js:0:0)
    at Module._compile (pkg/prelude/bootstrap.js:1254:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:711:10)
    at Module.load (internal/modules/cjs/loader.js:610:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:549:12)
    at Function.Module._load (internal/modules/cjs/loader.js:541:3)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1309:12)
    at startup (internal/bootstrap/node.js:274:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:608:3)

If I try to use v10.6.0 instead, lando start finishes with

warn: Service database is unhealthy
warn: Run "lando logs -s database"
Starting st_database_1 ... done
Killing st_database_1 ... done

lando logs -s database returns:

Attaching to st_database_1
database_1   | mkdir: cannot create directory ‘/etc/ssh’: Permission denied
database_1   | Running command /app-entrypoint.sh /run.sh
database_1   | Running with exec!
database_1   |
database_1   | Welcome to the Bitnami postgresql container
database_1   | Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-postgresql
database_1   | Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-postgresql/issues
database_1   |
database_1   | nami    INFO  Initializing postgresql
database_1   | postgre INFO  ==> No injected postgresql.conf file found. Creating default postgresql.conf file...        
database_1   | postgre INFO  ==> No injected pg_hba.conf file found. Creating default pg_hba.conf file...
database_1   | postgre INFO  ==> Deploying PostgreSQL from scratch...
database_1   | Error executing 'postInstallation': Unable to start com.bitnami.postgresql: pg_ctl: could not start server
database_1   | Examine the log output.
database_1   | : pg_ctl: could not start server
database_1   | Examine the log output.
database_1   |
database_1   | mkdir: cannot create directory ‘/etc/ssh’: Permission denied
database_1   | Running command /app-entrypoint.sh /run.sh
database_1   | Running with exec!
database_1   |
database_1   | Welcome to the Bitnami postgresql container
database_1   | Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-postgresql
database_1   | Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-postgresql/issues
database_1   |
@JorisVanEijden

This comment has been minimized.

Copy link
Author

commented May 10, 2019

Bitnami is right now releasing new versions of their image that contains a fix for config file loading.
bitnami/bitnami-docker-postgresql#132
https://hub.docker.com/r/bitnami/postgresql/tags
Let's see if that helps.

@JorisVanEijden

This comment has been minimized.

Copy link
Author

commented May 10, 2019

Looks like that release doesn't help.
I'm running on database: postgres:9.6.12-r68 which is fine.
perhaps there is a 10.x tag that also still works?

@mrweiner

This comment has been minimized.

Copy link

commented May 10, 2019

Are you getting this at all?

warn: Service database is unhealthy
warn: Run "lando logs -s database"

I see that instead of ERROR: No container found for database_1 for 9.6.12-r68 and 10.6.0. This is my first app using postgres so maybe this is a normal thing to see.

@mrweiner

This comment has been minimized.

Copy link

commented May 10, 2019

Actually I think that may have to do with the "services" .lando.yml syntax recommended in the docs. I get that issue when using

name: st
recipe: drupal8
services:
  appserver:
    xdebug: true
  database:
    type: postgres:10.6.0
    portforward: 3307
config:
  webroot: st_project/web
  php: 7.2

but not when using

name: st
recipe: drupal8
config:
  webroot: st_project/web
  php: 7.2
  database: postgres:10.6.0
  portforward: 3307
  xdebug: true

...although port forwarding doesn't work in the second example. Probably the wrong way to define it.

Think it warrants a separate issue?

@pirog

This comment has been minimized.

Copy link
Member

commented May 13, 2019

@mrweiner if the syntax you use is not supported i dont think you should expect it to work.

portforward is not part of the recipe config because it is service specific and we dont really want to try to guess what service's ports you want to foward.

@pirog

This comment has been minimized.

Copy link
Member

commented May 13, 2019

i think the lowest common denominator workaround that is probably going to work regardless of other choices youve made in your landofile(s) is something like this

name: myapp
services:
  database:
    type: postgres:custom
    overrides:
      image: bitnami/postgres:9.6.12-r68
@jcandan

This comment has been minimized.

Copy link
Contributor

commented May 13, 2019

That seems to have worked @pirog, thanks! However, note that the correct path is bitnami/postgresql, not just bitnami/postgres

Also note, that I had to still specify postgres for my drupal7 recipe. Otherwise mysql was default, and the database override was failing to supply a psql command (expected behavior since no tooling directive would be necessary as it would come with the recipe were it configured with postgres).

End result: this workaround worked for me:

name: myapp
recipe: drupal7
config:
  webroot: .
  database: postgres
services:
  database:
    type: postgres:custom
    overrides:
      image: bitnami/postgresql:10.7.0-r68
@mrweiner

This comment has been minimized.

Copy link

commented May 13, 2019

@pirog I didn't expect portforward to work, just wanted to note that it didn't. Didn't realize it was service specific but that makes. By "Think it warrants a separate issue?" I was referring to the issue with the service syntax not working with @JorisVanEijden workaround. I see now that that wasn't at all clear.

Can confirm that @jcandan .lando.yml worked for me as well. Thanks everybody!

@thursdaybw

This comment has been minimized.

Copy link

commented May 20, 2019

When I apply the workaround in here #1612 (comment)

I get this issue:

$ lando rebuild
? Are you sure you want to rebuild? Yes
Rising anew like a fire phoenix from the ashes! Rebuilding app...
No stopped containers
Pulling database      ... error
Pulling elasticsearch ... done

ERROR: for database  pull access denied for bitnami/postgres, repository does not exist or may require 'docker login'
ERROR: pull access denied for bitnami/postgres, repository does not exist or may require 'docker login'
Pulling database      ... error
@thursdaybw

This comment has been minimized.

Copy link

commented May 20, 2019

I've logged into my dockerhub account using docker login, same issue.

@pirog

This comment has been minimized.

Copy link
Member

commented May 20, 2019

@thursdaybw note that bitnami/postgres is not a valid image so that error mesage makes sense

@pirog pirog self-assigned this May 21, 2019

@pirog pirog added this to the 3.0.0-rc.17 milestone May 21, 2019

pirog added a commit that referenced this issue May 21, 2019

pirog added a commit that referenced this issue May 21, 2019

pirog added a commit that referenced this issue May 21, 2019

Merge pull request #1629 from lando/pld041
#1612: Fix breaking upstream postgres change
@thursdaybw

This comment has been minimized.

Copy link

commented Jun 3, 2019

@pirog Thank you so much for putting those commits in to fix the postgres issue.
I was never able to get postgres version 9 working but postgres 10 I did (but I needed 9 :( ). But now, having installed the dev lando from source I can again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.