lando / platformsh

The Official Platform.sh Lando Plugin
https://docs.lando.dev/platformsh
GNU General Public License v3.0
6 stars 4 forks source link

Locking down ports for external database connection not working #171

Open jasloe opened 1 year ago

jasloe commented 1 year ago

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.

aimfeld commented 1 year ago

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

jasloe commented 1 year ago

@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 commented 1 year ago

This issue is still persistent with v3.11.0.

jasloe commented 1 year ago

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

spencerthayer commented 11 months ago

Fix this y’all.