Pivotal Web Services Forums/Pivotal Web Services/Deploying with cf, the command line interface for Pivotal CF

Answered

Problem creating a tunnel to elephantsql

emiliolorente
asked this on June 28, 2013 05:16

Hello,
First of all sorry for my english. I'm a user of Cloudfoundry with an applicattion in the V1. Now I'm migrating this application to CloudFoundry V2 with no succes, because I need to populate the database before.


When I try to create a tunnel to the elephantsql service I have this error:

"Opening tunnel on port 10000... FAILED
RuntimeError: Could not determine hostname for elephantsql-402db
For more information, see ~/.cf/crash"

cat ~/.cf/crash
Time of crash:
Fri Jun 28 13:54:45 +0200 2013

RuntimeError: Could not determine hostname for elephantsql-402db

cf-3.0.0/lib/tunnel/tunnel.rb:253:in `get_connection_info'
cf-3.0.0/lib/tunnel/tunnel.rb:252:in `each'
cf-3.0.0/lib/tunnel/tunnel.rb:252:in `get_connection_info'
cf-3.0.0/lib/tunnel/tunnel.rb:35:in `open!'
cf-3.0.0/lib/tunnel/plugin.rb:41:in `tunnel'
interact-0.5.2/lib/interact/progress.rb:98:in `with_progress'
cf-3.0.0/lib/tunnel/plugin.rb:40:in `tunnel'
mothership-0.5.1/lib/mothership/base.rb:66:in `send'
mothership-0.5.1/lib/mothership/base.rb:66:in `run'
mothership-0.5.1/lib/mothership/command.rb:72:in `invoke'
mothership-0.5.1/lib/mothership/command.rb:86:in `instance_exec'
mothership-0.5.1/lib/mothership/command.rb:86:in `invoke'
mothership-0.5.1/lib/mothership/base.rb:55:in `execute'
cf-3.0.0/lib/cf/cli.rb:156:in `execute'
cf-3.0.0/lib/cf/cli.rb:167:in `save_token_if_it_changes'
cf-3.0.0/lib/cf/cli.rb:155:in `execute'
cf-3.0.0/lib/cf/cli.rb:101:in `wrap_errors'
cf-3.0.0/lib/cf/cli.rb:151:in `execute'
mothership-0.5.1/lib/mothership.rb:45:in `start'
cf-3.0.0/bin/cf:13
/usr/local/bin/cf:23:in `load'
/usr/local/bin/cf:23

How can I solve this error?

thanks

 

Emilio

 

 

Comments

User photo
dhigham
Pivotal Web Services Support

Hi, as services are now provisioned outside of Cloud Foundry via third party vendors, it is not necessary to use a tunnel to connect to it. To get the connection details for your service, log in to https://console.run.pivotal.io and navigating and find the provisioned in the associated space. Clicking the "manage" button next to the relevant service will take you the providers homepage where you should be able to obtain connection details.

June 28, 2013 06:03
User photo
emiliolorente

Thanks dhigham! now is working like a charm

June 28, 2013 11:26
User photo
ob

I had same problem with mongodb / mongolab.

When I follow your instructions, I finally got to https://mongolab.com/databases/CloudFoundry_xxxxxx#importexport with the instruction to enter

mongorestore -h ds031328.mongolab.com:31328 -d CloudFoundry_xxxxxxx -u <user> -p <password>

The question is, what should I use for <user> and <password>?

When I use my CloudFoundry credentials, the command fails with 

assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }

Without user and password I get an error "not authorized to create index on CloudFoundry_xxxxxxx.xxx"

July 02, 2013 12:11
User photo
dhigham
Pivotal Web Services Support
Check Answer

On the Mongolab site you can view the "System.Users" system collection and view all the database usernames and passwords there. Obviously there will be a user per bound application in there, if you want to find the username and password for a particular bound application I would look at the env.log file for your app using cf;

cf files <app name> logs/env.log

 

In there you should see the environment variable VCAP_SERVICES with the service details.

July 04, 2013 05:26
User photo
agustin.treceno

Hi Pivotal CF Support, 

If services are provided now by third party vendors. How can you guarantee that the web server (let's say *.cfapps.io) and the database (let's say us-cdbr-east-04.cleardb.com) are in the same LAN or near each other (geographically speaking)? 

Thanks, 

Agustin

September 18, 2013 03:07
User photo
bkeelapudi
Pivotal Web Services Support
Check Answer

Hi agustin,

Geographically speaking, ClearDB hosts their instances in different US AWS zones as seen in the image below: 

img.tiff

You can see this by selecting the manage button from the console for the cleardb service and by choosing Endpoint information tab in their menu. For more information on it please contact Cleardb directly. 

 

thanks, 

Bala

 

September 20, 2013 11:25