Search code examples
mongodbcloud-foundryswisscomdev

Connection to service via CLI not working


I recently tried to connect to one of our cloud spaces on Swisscom Application cloud using the CLI.

cf login worked fine and also cf push works as expected.

But if I try to open a ssh tunnel to the mongo db (service) I get an error.

Creating tunnel ...

FAILED

Unable to parse domain

The command I tried:

cf service-connector 13000 XXX:YYY

where XXX is the host which I took from the service key and YYY the port which I took from there too.

Do you have any idea what I am doing wrong?


Solution

  • It seems like you stumbled on an old issue with the service-connector plugin. Due to a change in the cf-cli the plugin is unable to find the correct endpoint to connect to.

    Please ensure you're using the latest cf-cli and service-connector plugin version. Swisscom service-connector plugin version should be 1.0.8. You can get it from this site: https://docs.developer.swisscom.com/service-connector/

    I recommend using cf ssh when ever possible: https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html It requires a service binding to the app you're connecting to.