[google-appengine] Passing "--verbosity true" to gcloud through Maven

2017-06-22 Thread Joshua Fox
mvn appengine:deploy is failing.

We are using com.google.cloud.tools:appengine-maven-plugin

We need more information, and we might get that if we can pass the
--verbosity=true   from Maven to gcloud.

The docs
 don't
say how to do that.

How can we pass this parameter from Maven into gcloud?



Error message below. The  Log Viewer shows nothing at all about the
deployment.

GCLOUD: Updating service [service1]...
GCLOUD: ...failed.
GCLOUD: ERROR: (gcloud.app.deploy) Error Response: [13] An internal error
occurred.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAD%3DB7cNiaeQsGd1cNFvNz52BE9-Q4c6viVstDVz4mj5R8nwueg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Connecting Google App Engine to Cloud SQL

2017-06-22 Thread Jason Lee
I am trying to follow the tutorial at:

And I am having the hardest time making my Google App Engine (GoLang) 
connect to the Cloud SQL Postgres database. I am able to connect NOT 
following the tutorial by manually opening the port from the firewall 
rules. But I cannot do it this way because it's connected via IP and if I 
do it this way, I cannot deploy to GAE.

Could someone please review the following GoLang code to see what is wrong.

```
*This following line is used to connect from localhost GoLang app to Cloud 
SQL -- NOT FOLLOWING THE TUTORIAL*
db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT user=USERNAME 
password=PASSWORD dbname=DBNAME sslmode=disable)

Here, I am connecting to the Cloud SQL postgres database by IP address. I 
opened a port manually by firewall rule to make it accessible from my local 
IP.
This works great but I cannot "deploy" my GoLang app to Google App Engine 
so this is not possible.

---

*This does NOT work. It follows the tutorial. I tried 4 different 
variations.*

connectionName = "CONNECTION_NAME"
db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)", user, 
password, connectionName))
db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME", 
user, password, connectionName))
db, err := sql.Open("postgres", 
fmt.Sprintf("postgres://%s:%s@cloudsql(%s)", user, password, 
connectionName))
db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@cloudsql(%s)/
DB_NAME", user, password, connectionName))

All four of these variations do not work. And I do not know why. I could 
really use some help understanding why. The only difference between this 
and the tutorial is that I'm using "postgres", not "mysql".
```

Thank you so kindly in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/2d7ae38a-8dbe-4836-84e4-d1d4d8651f30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: missing "=" after following connecting GAE and Cloud SQL tutorial

2017-06-22 Thread Jason Lee
Hi George,

I changed my question, could you please 
check: https://groups.google.com/forum/#!topic/google-appengine/zgTVS1ARLis

Thank you.


On Wednesday, 21 June 2017 11:04:47 UTC-7, George (Cloud Platform Support) 
wrote:
>
> Hello Jason, 
>
> Where did you replace "mysql" to "progres", exactly? 
>
> The tutorial you mention is meant for the standard environment. 
> "Connection from an App Engine standard environment application to a 
> PostgreSQL instance is not supported.", as explained in the "Connecting 
> from App Engine" online document 
> . On the 
> same page you can find more information on how to connect to your 
> PostgreSQL database from the app engine. 
>
> If you want to connect from external applications, "Connection Options 
> for External Applications 
> " 
> provides you with needed information. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d41bcd24-e544-47aa-9594-a9ddf8bc0dc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Connecting Google App Engine to Cloud SQL

2017-06-22 Thread Jason Lee
Tutorial link I am following 
is: https://cloud.google.com/appengine/docs/standard/go/cloud-sql/#setting-up



On Thursday, 22 June 2017 12:25:56 UTC-7, Jason Lee wrote:
>
> I am trying to follow the tutorial at:
>
> And I am having the hardest time making my Google App Engine (GoLang) 
> connect to the Cloud SQL Postgres database. I am able to connect NOT 
> following the tutorial by manually opening the port from the firewall 
> rules. But I cannot do it this way because it's connected via IP and if I 
> do it this way, I cannot deploy to GAE.
>
> Could someone please review the following GoLang code to see what is wrong.
>
> ```
> *This following line is used to connect from localhost GoLang app to Cloud 
> SQL -- NOT FOLLOWING THE TUTORIAL*
> db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT user=USERNAME 
> password=PASSWORD dbname=DBNAME sslmode=disable)
>
> Here, I am connecting to the Cloud SQL postgres database by IP address. I 
> opened a port manually by firewall rule to make it accessible from my local 
> IP.
> This works great but I cannot "deploy" my GoLang app to Google App Engine 
> so this is not possible.
>
> ---
>
> *This does NOT work. It follows the tutorial. I tried 4 different 
> variations.*
>
> connectionName = "CONNECTION_NAME"
> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)", user, 
> password, connectionName))
> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME", 
> user, password, connectionName))
> db, err := sql.Open("postgres", 
> fmt.Sprintf("postgres://%s:%s@cloudsql(%s)", user, password, 
> connectionName))
> db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@cloudsql(%s)/
> DB_NAME", user, password, connectionName))
>
> All four of these variations do not work. And I do not know why. I could 
> really use some help understanding why. The only difference between this 
> and the tutorial is that I'm using "postgres", not "mysql".
> ```
>
> Thank you so kindly in advance.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/2cc425fa-b87c-409b-b423-a7b8a3bc1065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: Connecting Google App Engine to Cloud SQL

2017-06-22 Thread 'Josh Moore' via Google App Engine
If you take a look at the CloudSQL Postgres documentation
, you'll see
that App Engine standard is not yet supported.  Postgres on CloudSQL is
currently a beta product and isn't available for all environments at this
time.  You can, however, use a Postgres db on App Engine Flexible
environment.

On Thu, Jun 22, 2017 at 12:44 PM, Jason Lee  wrote:

> Tutorial link I am following is: https://cloud.google.com/
> appengine/docs/standard/go/cloud-sql/#setting-up
>
>
>
> On Thursday, 22 June 2017 12:25:56 UTC-7, Jason Lee wrote:
>>
>> I am trying to follow the tutorial at:
>>
>> And I am having the hardest time making my Google App Engine (GoLang)
>> connect to the Cloud SQL Postgres database. I am able to connect NOT
>> following the tutorial by manually opening the port from the firewall
>> rules. But I cannot do it this way because it's connected via IP and if I
>> do it this way, I cannot deploy to GAE.
>>
>> Could someone please review the following GoLang code to see what is
>> wrong.
>>
>> ```
>> *This following line is used to connect from localhost GoLang app to
>> Cloud SQL -- NOT FOLLOWING THE TUTORIAL*
>> db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT user=USERNAME
>> password=PASSWORD dbname=DBNAME sslmode=disable)
>>
>> Here, I am connecting to the Cloud SQL postgres database by IP address. I
>> opened a port manually by firewall rule to make it accessible from my local
>> IP.
>> This works great but I cannot "deploy" my GoLang app to Google App Engine
>> so this is not possible.
>>
>> ---
>>
>> *This does NOT work. It follows the tutorial. I tried 4 different
>> variations.*
>>
>> connectionName = "CONNECTION_NAME"
>> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)", user,
>> password, connectionName))
>> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME",
>> user, password, connectionName))
>> db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@cloudsql(%s)",
>> user, password, connectionName))
>> db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@
>> cloudsql(%s)/DB_NAME", user, password, connectionName))
>>
>> All four of these variations do not work. And I do not know why. I could
>> really use some help understanding why. The only difference between this
>> and the tutorial is that I'm using "postgres", not "mysql".
>> ```
>>
>> Thank you so kindly in advance.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-appengine/2cc425fa-b87c-409b-b423-
> a7b8a3bc1065%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Josh Moore |  Cloud Solutions Engineer |  joshu...@google.com |

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAOvpJmVN13-AKK7UQkMJPJNp7BxWiMY2EBkae5ctSuVYhjyRLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: Connecting Google App Engine to Cloud SQL

2017-06-22 Thread Jason Lee
I *am *using App Engine flexible environment.

Does this mean there's no way for me to connect to Google Cloud SQL from 
App Engine once deployed?



On Thursday, 22 June 2017 13:03:22 UTC-7, joshuamo wrote:
>
> If you take a look at the CloudSQL Postgres documentation 
> , you'll 
> see that App Engine standard is not yet supported.  Postgres on CloudSQL is 
> currently a beta product and isn't available for all environments at this 
> time.  You can, however, use a Postgres db on App Engine Flexible 
> environment.
>
> On Thu, Jun 22, 2017 at 12:44 PM, Jason Lee  > wrote:
>
>> Tutorial link I am following is: 
>> https://cloud.google.com/appengine/docs/standard/go/cloud-sql/#setting-up
>>
>>
>>
>> On Thursday, 22 June 2017 12:25:56 UTC-7, Jason Lee wrote:
>>>
>>> I am trying to follow the tutorial at:
>>>
>>> And I am having the hardest time making my Google App Engine (GoLang) 
>>> connect to the Cloud SQL Postgres database. I am able to connect NOT 
>>> following the tutorial by manually opening the port from the firewall 
>>> rules. But I cannot do it this way because it's connected via IP and if I 
>>> do it this way, I cannot deploy to GAE.
>>>
>>> Could someone please review the following GoLang code to see what is 
>>> wrong.
>>>
>>> ```
>>> *This following line is used to connect from localhost GoLang app to 
>>> Cloud SQL -- NOT FOLLOWING THE TUTORIAL*
>>> db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT user=USERNAME 
>>> password=PASSWORD dbname=DBNAME sslmode=disable)
>>>
>>> Here, I am connecting to the Cloud SQL postgres database by IP address. 
>>> I opened a port manually by firewall rule to make it accessible from my 
>>> local IP.
>>> This works great but I cannot "deploy" my GoLang app to Google App 
>>> Engine so this is not possible.
>>>
>>> ---
>>>
>>> *This does NOT work. It follows the tutorial. I tried 4 different 
>>> variations.*
>>>
>>> connectionName = "CONNECTION_NAME"
>>> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)", user, 
>>> password, connectionName))
>>> db, err := sql.Open("postgres", 
>>> fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME", user, password, connectionName))
>>> db, err := sql.Open("postgres", 
>>> fmt.Sprintf("postgres://%s:%s@cloudsql(%s)", user, password, 
>>> connectionName))
>>> db, err := sql.Open("postgres", 
>>> fmt.Sprintf("postgres://%s:%s@cloudsql(%s)/DB_NAME", user, password, 
>>> connectionName))
>>>
>>> All four of these variations do not work. And I do not know why. I could 
>>> really use some help understanding why. The only difference between this 
>>> and the tutorial is that I'm using "postgres", not "mysql".
>>> ```
>>>
>>> Thank you so kindly in advance.
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google App Engine" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-appengi...@googlegroups.com .
>> To post to this group, send email to google-a...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/google-appengine.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-appengine/2cc425fa-b87c-409b-b423-a7b8a3bc1065%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Josh Moore |  Cloud Solutions Engineer |  josh...@google.com 
>  |  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/e8bd03ea-06f1-49a3-ab5c-c6c60b235001%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Passing "--verbosity true" to gcloud through Maven

2017-06-22 Thread 'George (Cloud Platform Support)' via Google App Engine
Hello Joshua, 

In case you adjust your deployment strategy and use gcloud-maven-plugin, in 
place of the appengine-maven-plugin, the option for --verbose exactly is 
present there. You can find related details on github 
. 

Debug information can be also obtained from maven by running mvn -X 
appengine:deploy, with the -X option. 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/d6513211-6e48-4ff0-a112-9454eaf20048%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: Connecting Google App Engine to Cloud SQL

2017-06-22 Thread 'Josh Moore' via Google App Engine
The tutorial you linked was for the App Engine standard environment, which
is why it isn't working in the Flexible environment.  I would look over the
App Engine Flexible golang docs for Using CloudSQL
, and
the App Engine Flexible python docs for Using CloudSQL Postgres
.
I'll put in a request to add a sample for go, so this is an easier task to
just get started with.

I haven't tested this myself, but it looks like your connection should look
like:
db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@%s?host=/cloudsql/%s",
user, password, database, connectionName))


On Thu, Jun 22, 2017 at 1:11 PM, Jason Lee  wrote:

> I *am *using App Engine flexible environment.
>
> Does this mean there's no way for me to connect to Google Cloud SQL from
> App Engine once deployed?
>
>
>
> On Thursday, 22 June 2017 13:03:22 UTC-7, joshuamo wrote:
>>
>> If you take a look at the CloudSQL Postgres documentation
>> , you'll
>> see that App Engine standard is not yet supported.  Postgres on CloudSQL is
>> currently a beta product and isn't available for all environments at this
>> time.  You can, however, use a Postgres db on App Engine Flexible
>> environment.
>>
>> On Thu, Jun 22, 2017 at 12:44 PM, Jason Lee  wrote:
>>
>>> Tutorial link I am following is: https://cloud.google.com/a
>>> ppengine/docs/standard/go/cloud-sql/#setting-up
>>>
>>>
>>>
>>> On Thursday, 22 June 2017 12:25:56 UTC-7, Jason Lee wrote:

 I am trying to follow the tutorial at:

 And I am having the hardest time making my Google App Engine (GoLang)
 connect to the Cloud SQL Postgres database. I am able to connect NOT
 following the tutorial by manually opening the port from the firewall
 rules. But I cannot do it this way because it's connected via IP and if I
 do it this way, I cannot deploy to GAE.

 Could someone please review the following GoLang code to see what is
 wrong.

 ```
 *This following line is used to connect from localhost GoLang app to
 Cloud SQL -- NOT FOLLOWING THE TUTORIAL*
 db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT user=USERNAME
 password=PASSWORD dbname=DBNAME sslmode=disable)

 Here, I am connecting to the Cloud SQL postgres database by IP address.
 I opened a port manually by firewall rule to make it accessible from my
 local IP.
 This works great but I cannot "deploy" my GoLang app to Google App
 Engine so this is not possible.

 ---

 *This does NOT work. It follows the tutorial. I tried 4 different
 variations.*

 connectionName = "CONNECTION_NAME"
 db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)",
 user, password, connectionName))
 db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME",
 user, password, connectionName))
 db, err := sql.Open("postgres", 
 fmt.Sprintf("postgres://%s:%s@cloudsql(%s)",
 user, password, connectionName))
 db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@
 cloudsql(%s)/DB_NAME", user, password, connectionName))

 All four of these variations do not work. And I do not know why. I
 could really use some help understanding why. The only difference between
 this and the tutorial is that I'm using "postgres", not "mysql".
 ```

 Thank you so kindly in advance.

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google App Engine" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-appengi...@googlegroups.com.
>>> To post to this group, send email to google-a...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/google-appengine.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-appengine/2cc425fa-b87c-409b-b423-a7b8a3bc1065%
>>> 40googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Josh Moore |  Cloud Solutions Engineer |  josh...@google.com |
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-appengine/e8bd03ea-06f1-49

Re: [google-appengine] Re: Search limit

2017-06-22 Thread Emlyn
I do this is a slightly more costly way Nick; I generate my new document,
read any existing document from the index, compare, only put on a change. I
like your memcache idea, I could possibly cache the last written version.


On 22 June 2017 at 11:38, Nickolas Daskalou  wrote:

> That's a nice way of working around the rate limits Emlyn.
>
> In your _post_put function you can also compare a hash of the last
> document you put in the Search API index for the Datastore entity, and only
> send to the Search API if the current document's hash is different.
>
> To make it fast and cost-effective, you can use Memcache to store the hash
> of the most recent document sent to the Search API for a particular
> Datastore entity.
>
> This method is most useful if your app does a lot of updates to Datastore
> entities which would not actually change the Search API document at all
> (e.g. when updating Datastore entity properties which are not indexed in
> the Search API).
>
> Nick
>
>
> On 22 June 2017 at 11:42, Emlyn  wrote:
>
>> Thanks George, I read that, that's great. I may have to go for a support
>> level in the near future.
>>
>> For anyone who's interested, I was able to fix my problems with the
>> Search API as follows:
>>
>> My code enqueues a huge amount of tasks very rapidly, which modify
>> datastore objects. In the _post_put handlers, these also update search
>> indices.
>>
>> I was having problems that the datastore updates were working, but the
>> rate was too high for the search indices; I was getting timeouts, quota
>> limitations, bad things :-)
>>
>> I've changed my _post_put handlers to do the updates to search indices in
>> separate tasks, on a queue I've configured just for this. It's rate limited
>> to below the maximum rate for the search api (ie: maximum search throughput
>> is 15000/minute, or 250/s, so I've set it lower than this).
>>
>> That's completely fixed the problem. And because I'm not hitting quota
>> limits, the real throughput is much higher than it was; I don't see this
>> queue hitting the limit and lagging behind the rest of the job.
>>
>> Now I get to sleep comfortably at night :-) Thanks for the help.
>>
>>
>> On 22 June 2017 at 03:53, 'George (Cloud Platform Support)' via Google
>> App Engine  wrote:
>>
>>> Hi Emlyn,
>>>
>>> News is not entirely bad: "Note: Although these limits are enforced by
>>> the minute, the Cloud Platform Console displays the daily totals for each.
>>> Customers with Silver, Gold, or Platinum support can request higher
>>> throughput limits by contacting their support representative." This is to
>>> be read just below the quotas paragraph we speak about. In short, you may
>>> consider asking for a quota increase.
>>>
>>> Information on how to reduce your app's needs for paid resources, and so
>>> keep within quotas, you may consult the "Managing App Resources"
>>> documentation page
>>> 
>>> .
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google App Engine" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-appengine+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-appengine@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/google-appengine.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-appengine/623ea57b-1c0c-4454-a854-5cb5fa84bd8b%40
>>> googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Emlyn
>>
>> https://medium.com/the-infinite-machine - A publication about Google App
>> Engine
>> sutllang.com - My language sUTL
>> https://plus.google.com/u/0/100281903174934656260 - Google+
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-appengine+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-appengine@googlegroups.com.
>> Visit this group at https://groups.google.com/group/google-appengine.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-appengine/CAMp1VPBy7WjB-Qw8N0mkdR0CEP%2BqEf%2Byz%
>> 2BxwKCn2GwT1EfGsuA%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
>

Re: [google-appengine] Re: Connecting Google App Engine to Cloud SQL

2017-06-22 Thread Jason Lee
Thank you,

That code snippet you gave did not work, but I will wait for a GoLang 
example.



On Thursday, 22 June 2017 14:01:40 UTC-7, joshuamo wrote:
>
> The tutorial you linked was for the App Engine standard environment, which 
> is why it isn't working in the Flexible environment.  I would look over the 
> App Engine Flexible golang docs for Using CloudSQL 
> , 
> and the App Engine Flexible python docs for Using CloudSQL Postgres 
> .
>   
> I'll put in a request to add a sample for go, so this is an easier task to 
> just get started with.
>
> I haven't tested this myself, but it looks like your connection should 
> look like:
> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@%s?host=/cloudsql/%s", 
> user, password, database, connectionName))
>
>
> On Thu, Jun 22, 2017 at 1:11 PM, Jason Lee  > wrote:
>
>> I *am *using App Engine flexible environment.
>>
>> Does this mean there's no way for me to connect to Google Cloud SQL from 
>> App Engine once deployed?
>>
>>
>>
>> On Thursday, 22 June 2017 13:03:22 UTC-7, joshuamo wrote:
>>>
>>> If you take a look at the CloudSQL Postgres documentation 
>>> , you'll 
>>> see that App Engine standard is not yet supported.  Postgres on CloudSQL is 
>>> currently a beta product and isn't available for all environments at this 
>>> time.  You can, however, use a Postgres db on App Engine Flexible 
>>> environment.
>>>
>>> On Thu, Jun 22, 2017 at 12:44 PM, Jason Lee  wrote:
>>>
 Tutorial link I am following is: 
 https://cloud.google.com/appengine/docs/standard/go/cloud-sql/#setting-up



 On Thursday, 22 June 2017 12:25:56 UTC-7, Jason Lee wrote:
>
> I am trying to follow the tutorial at:
>
> And I am having the hardest time making my Google App Engine (GoLang) 
> connect to the Cloud SQL Postgres database. I am able to connect NOT 
> following the tutorial by manually opening the port from the firewall 
> rules. But I cannot do it this way because it's connected via IP and if I 
> do it this way, I cannot deploy to GAE.
>
> Could someone please review the following GoLang code to see what is 
> wrong.
>
> ```
> *This following line is used to connect from localhost GoLang app to 
> Cloud SQL -- NOT FOLLOWING THE TUTORIAL*
> db, err := sql.Open("postgres", host=IP_ADDRESS port=PORT 
> user=USERNAME password=PASSWORD dbname=DBNAME sslmode=disable)
>
> Here, I am connecting to the Cloud SQL postgres database by IP 
> address. I opened a port manually by firewall rule to make it accessible 
> from my local IP.
> This works great but I cannot "deploy" my GoLang app to Google App 
> Engine so this is not possible.
>
> ---
>
> *This does NOT work. It follows the tutorial. I tried 4 different 
> variations.*
>
> connectionName = "CONNECTION_NAME"
> db, err := sql.Open("postgres", fmt.Sprintf("%s:%s@cloudsql(%s)", 
> user, password, connectionName))
> db, err := sql.Open("postgres", 
> fmt.Sprintf("%s:%s@cloudsql(%s)/DB_NAME", user, password, connectionName))
> db, err := sql.Open("postgres", 
> fmt.Sprintf("postgres://%s:%s@cloudsql(%s)", user, password, 
> connectionName))
> db, err := sql.Open("postgres", 
> fmt.Sprintf("postgres://%s:%s@cloudsql(%s)/DB_NAME", user, password, 
> connectionName))
>
> All four of these variations do not work. And I do not know why. I 
> could really use some help understanding why. The only difference between 
> this and the tutorial is that I'm using "postgres", not "mysql".
> ```
>
> Thank you so kindly in advance.
>
 -- 
 You received this message because you are subscribed to the Google 
 Groups "Google App Engine" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to google-appengi...@googlegroups.com.
 To post to this group, send email to google-a...@googlegroups.com.
 Visit this group at https://groups.google.com/group/google-appengine.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/google-appengine/2cc425fa-b87c-409b-b423-a7b8a3bc1065%40googlegroups.com
  
 
 .

 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>>
>>> Josh Moore |  Cloud Solutions Engineer |  josh...@google.com |  
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google App Engine" group.
>> To unsubscribe from this group and stop receiving emails