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

Locking down ports for external database connection not working #171

Open
jasloe opened this issue Aug 25, 2022 · 5 comments
Open

Locking down ports for external database connection not working #171

jasloe opened this issue Aug 25, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@jasloe
Copy link

jasloe commented Aug 25, 2022

I’m having trouble locking down ports using the platformsh recipe with multiple database containers.

I'm on the latest versions of Lando and the platformsh CLI. Here are the relevant excerpt from my configuration:

[services.yaml]
db:
  type: mariadb:10.4
  disk: 2048

db2:
  type: mariadb:10.4
  disk: 2048

[.platform.app.yaml]
relationships:
  database: "db:mysql"
  database2: "db2:mysql"

[.lando.yml]
recipe: platformsh
services:
  db:
    portforward: 3307
  db2:
    portforward: 3308

lando rebuild -y returns:

  { service: 'db',
    type: 'platformsh-mariadb',
    creds:
     [ { internal_hostname: 'database.internal', path: 'main', port: 3306, user: 'user' } ],
    internal_connection: { host: 'db', port: '3306' },
    external_connection: { host: '127.0.0.1', port: '64811' },

  { service: 'db2',
    type: 'platformsh-mariadb',
    creds:
     [ { internal_hostname: 'database2.internal', path: 'main', port: 3306, user: 'user' } ],
    internal_connection: { host: 'db2', port: '3306' },
    external_connection: { host: '127.0.0.1', port: '64810' },

There's a nearly identical and now-closed issue at #39. Either there's a regression somewhere or I don't know what I'm doing. Trying to understand the lando logs commands to troubleshoot this but the docs are 404.

@jasloe jasloe added the bug Something isn't working label Aug 25, 2022
@aimfeld
Copy link

aimfeld commented Aug 29, 2022

@jasloe A colleague of mine experiences the same problem with lando 3.6.5. A temporary downgrade to 3.6.4 might help.

@jasloe
Copy link
Author

jasloe commented Aug 31, 2022

@aimfeld thanks for replying. I'm now running 3.6.4 with mixed results. It seems to work fixing only one of the ports, i.e.:

services:
  db:
    portforward: 3309
  db2:
    portforward: 3310
internal_connection: { host: 'db', port: '3306' },
external_connection: { host: '127.0.0.1', port: '50907' },
internal_connection: { host: 'db2', port: '3306' },
external_connection: { host: '127.0.0.1', port: '3310' },

It's unpredictable which service's port gets fixed. Not sure where to go next with troubleshooting.

@spencerthayer
Copy link

This issue is still persistent with v3.11.0.

@jasloe
Copy link
Author

jasloe commented Jul 6, 2023

On v3.18.0. Was broken in 2020. Remains broken in 2023.

@spencerthayer
Copy link

Fix this y’all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants