GoogleCloudPlatform / appengine-ruby

Optional integration library for the Ruby runtime for Google App Engine
Apache License 2.0
53 stars 21 forks source link

Migration when postgres DB is hosted on Compute Engine VM #16

Closed tombroomfield closed 5 years ago

tombroomfield commented 6 years ago

Hi, Really enjoying running rails on AppEngine, however, due to some compliance requirements around customer supplied keys, we've had to run our database on a Compute Engine VM.

This all works perfectly except for running the migrations through the app engine command line tool, I get the following error:

New Error: PG::ConnectionBad: could not connect to server: Connection timed out, Is the server running on host "10.152.x.x" and accepting TCP/IP connections on port 5432

Due to this, I have to manually SSH into the App engine containers and run it from within the context of the app file. How can I execute the migration so it can access the PG VM running on Compute Engine?

Cheers

dazuma commented 5 years ago

I take it from the IP address that you have a VPC set up and are connecting via a private IP. If so, this is not currently possible with appengine:exec. (See #24.) I do think we can provide a workaround in the upcoming version 0.5, but it will come with a performance penalty because it involves making an app engine deployment (which will likely be slow for flexible environment apps).

Closing this. Please follow #24 for updates, or feel free to reopen if you're still encountering this and you aren't using a VPC.