Friday, September 28, 2018

[google-cloud-sql-discuss] Re: Postgres Sql - On Demand Backup "atomicity"

The recommendation to perform the backups when your instance runs fewer operations is related to performance. Changes are not recommended because the backup is going to use resources. 

In this document, it tells that writes and other operations are unaffected, which means that writes and other operations will not be part of the backed up data. So, the on-demand backup is atomic and it is not recommended to run your risky operations at the same time as they may impact the use of resources. Check this Stack Overflow post or more details on Postgres backups.

On Thursday, September 27, 2018 at 1:36:47 PM UTC-4, Piny Houri wrote:
Hi guys,

Was wondering if the on demand backup is atomic - i.e. once I start it, it freezes the current state and any changes after starting (and before finishing) are not reflected?

I.e. do I need to wait for the backup to finish before running my risky operations or I can just go ahead once it's acknowledged?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/fe2e2c4e-22a8-4066-8031-ec76ce4538b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Fails to connect to Cloud SQL when using Knex.js (direct driver works fine)

Thank You so much for the answer. The functions is using the default AppEngine SA. And this account has Editor role.

I'm using socketPath instead of ip too. i have the following params (omitting only user and password here):
max: 1, user: 'username', password: 'password', database: 'appengine_helloworld_db', socketPath: '/cloudsql/hello-world-4736435:southamerica-east1:hello-world-postgis-sp'

I tried to do the connection after adding client Cloud SQL role to the SA, but I'm having the same issue. When you made this connection, which were the roles of SA?

Thank You.

sexta-feira, 28 de Setembro de 2018 às 14:49:50 UTC-3, Igor Savin escreveu:
Hi Emerson!

We've had exactly same problem: check and double-check that you are using the SA that you think you are using for the connection and that it has the correct permissions.

On Friday, September 28, 2018 at 5:29:39 AM UTC+2, Emerson Moraes wrote:
Hi Igor, i'm sorry to use your issue to make a question to you.

I'm trying to run postgresDemo (from node js samples) function to connect with my CloudSQL Postgres passing all needed env params. You said that if you use "pg" directly it works fine. In my case it's not working. I'm getting the following error:

{"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":5432}

Do you passed by this problem too?

Note: my App Engine Java Application is getting connection with the same params that I'm using in Cloud Function.

Thank You so much,

Emerson Leite de Moraes

quinta-feira, 27 de Setembro de 2018 às 14:36:47 UTC-3, Igor Savin escreveu:
We are trying to query Cloud SQL instances (PostgreSQL and MySQL 2nd generation) from a Cloud Function (Node.js 8).

When we create pool directly using driver (e. g. using "pg" or "mysql2"), for an example like this:


const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};



mysql
.createPool(dbConfig)

It works just fine. However, if we try instantiating pool using knex, e. g. like this:

const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};


Knex(client: 'mysql2',
connection
: dbConfig)


we get error during execution:

D functionName kkb7wsgnbixj Function execution started functionName kkb7wsgnbixj
D functionNAme kkb7wsgnbixj
Function execution took 818 ms, finished with status: 'connection error' functionName kkb7wsgnbixj


This seems to be specific to Cloud Functions/Cloud SQL, because locally knex code works just fine and it also works just fine from non-cloud-function projects as well.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6a9ed94c-2a7d-456f-8eda-bc655d191272%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Fails to connect to Cloud SQL when using Knex.js (direct driver works fine)

Also you should be using socketPath instead of host/port to connect to CloudSQL from cloud function, see documentation - https://cloud.google.com/functions/docs/sql

On Friday, September 28, 2018 at 5:29:39 AM UTC+2, Emerson Moraes wrote:
Hi Igor, i'm sorry to use your issue to make a question to you.

I'm trying to run postgresDemo (from node js samples) function to connect with my CloudSQL Postgres passing all needed env params. You said that if you use "pg" directly it works fine. In my case it's not working. I'm getting the following error:

{"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":5432}

Do you passed by this problem too?

Note: my App Engine Java Application is getting connection with the same params that I'm using in Cloud Function.

Thank You so much,

Emerson Leite de Moraes

quinta-feira, 27 de Setembro de 2018 às 14:36:47 UTC-3, Igor Savin escreveu:
We are trying to query Cloud SQL instances (PostgreSQL and MySQL 2nd generation) from a Cloud Function (Node.js 8).

When we create pool directly using driver (e. g. using "pg" or "mysql2"), for an example like this:


const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};



mysql
.createPool(dbConfig)

It works just fine. However, if we try instantiating pool using knex, e. g. like this:

const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};


Knex(client: 'mysql2',
connection
: dbConfig)


we get error during execution:

D functionName kkb7wsgnbixj Function execution started functionName kkb7wsgnbixj
D functionNAme kkb7wsgnbixj
Function execution took 818 ms, finished with status: 'connection error' functionName kkb7wsgnbixj


This seems to be specific to Cloud Functions/Cloud SQL, because locally knex code works just fine and it also works just fine from non-cloud-function projects as well.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/81981530-02a6-48ac-a202-21cc727a2b39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Can not import from storage

Hi all,

I've got same issue, I solved it trying to do same by command line:

LOAD DATA INFILE ... CHARACTER SET 'utf8'
  FIELDS TERMINATED BY
',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\"'.

More info: https://cloud.google.com/sql/docs/mysql/import-export/importing

El martes, 9 de agosto de 2016, 18:39:12 (UTC+2), James McManus escribió:
When I attempt to import a file using the console, to cloud sql, from storage I get the following message when I "Browse" for the file:

Object not available. Either it does not exist or you do not have access. Try browsing for the object instead.

I've done this many times before and have not had this problem. I've tried changing permissions on the file, in storage, but have the same problem. I can also can download the file, directly using a url, so I do not think the problem is with storage. 

If I change the path, to the file, in the cloud sql import "Browse" console to:

danudata/danunews%2F2016%2Flatest_news_feed080916.csv

I no longer get the error message, but it then fails to import the data.

This appears to be a problem with google sql import console. Has anybody else had this problem? Are there solutions?

Thanks
Jim

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a9f63acf-3c47-4d3a-926b-4eab2afe8cd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Can not import from storage

Hi all,

Same issue, I have solved it trying to do same but by command line:

LOAD DATA INFILE ... CHARACTER SET 'utf8'
  FIELDS TERMINATED BY
',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\"'.

Regards.

More info: https://cloud.google.com/sql/docs/mysql/import-export/importing

El martes, 9 de agosto de 2016, 18:39:12 (UTC+2), James McManus escribió:
When I attempt to import a file using the console, to cloud sql, from storage I get the following message when I "Browse" for the file:

Object not available. Either it does not exist or you do not have access. Try browsing for the object instead.

I've done this many times before and have not had this problem. I've tried changing permissions on the file, in storage, but have the same problem. I can also can download the file, directly using a url, so I do not think the problem is with storage. 

If I change the path, to the file, in the cloud sql import "Browse" console to:

danudata/danunews%2F2016%2Flatest_news_feed080916.csv

I no longer get the error message, but it then fails to import the data.

This appears to be a problem with google sql import console. Has anybody else had this problem? Are there solutions?

Thanks
Jim

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/0b7da4f0-f041-474a-bcb7-47bc998bccb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Fails to connect to Cloud SQL when using Knex.js (direct driver works fine)

Hi Emerson!

We've had exactly same problem: check and double-check that you are using the SA that you think you are using for the connection and that it has the correct permissions.

On Friday, September 28, 2018 at 5:29:39 AM UTC+2, Emerson Moraes wrote:
Hi Igor, i'm sorry to use your issue to make a question to you.

I'm trying to run postgresDemo (from node js samples) function to connect with my CloudSQL Postgres passing all needed env params. You said that if you use "pg" directly it works fine. In my case it's not working. I'm getting the following error:

{"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":5432}

Do you passed by this problem too?

Note: my App Engine Java Application is getting connection with the same params that I'm using in Cloud Function.

Thank You so much,

Emerson Leite de Moraes

quinta-feira, 27 de Setembro de 2018 às 14:36:47 UTC-3, Igor Savin escreveu:
We are trying to query Cloud SQL instances (PostgreSQL and MySQL 2nd generation) from a Cloud Function (Node.js 8).

When we create pool directly using driver (e. g. using "pg" or "mysql2"), for an example like this:


const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};



mysql
.createPool(dbConfig)

It works just fine. However, if we try instantiating pool using knex, e. g. like this:

const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};


Knex(client: 'mysql2',
connection
: dbConfig)


we get error during execution:

D functionName kkb7wsgnbixj Function execution started functionName kkb7wsgnbixj
D functionNAme kkb7wsgnbixj
Function execution took 818 ms, finished with status: 'connection error' functionName kkb7wsgnbixj


This seems to be specific to Cloud Functions/Cloud SQL, because locally knex code works just fine and it also works just fine from non-cloud-function projects as well.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2a2f137e-fc96-4533-8f2f-dcb2b915e735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, September 27, 2018

[google-cloud-sql-discuss] Re: Fails to connect to Cloud SQL when using Knex.js (direct driver works fine)

Is the function returning this error consistently? As per this documentation regarding connecting to Cloud SQL in Cloud Functions, connections to the database might be dropped by the infrastructure underlying Cloud Functions, so you will need to use a library that supports automatically reconnecting broken connections. Also you need to make sure you are setting maximum concurrent connections to 1 since Cloud Functions limits it to 1.

I did some research regarding re-connection using knex specifically, I suggest looking into this issue thread, which discusses reconnecting after a server disconnect. It might be the reason the connection keeps dropping in your case.

It is recommended to post development related questions on Stackoverflow as they will get more visibility. Groups is better suited for general discussion questions.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/ad38625f-8564-4bb9-a142-1e1a33d4f6ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Cloud Function postgresDemo is working?

Hi!

I'm trying to deploy postgresDemo function from node.js samples.
But i'm not having success on get connection to my Cloud SQL instance.

I used the following command to publish the function: gcloud beta functions deploy postgresDemo --runtime nodejs8 --env-vars-file env.yaml --trigger-http

I added console log to see if all needed env vars are beeing filled correctly and it's fine. But when I try to create the pg.Pool, i have the following error:

Error: connect ECONNREFUSED 127.0.0.1:5432\n at Object._errnoException (util.js:1022:11)\n at _exceptionWithHostPort (util.js:1044:20)\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)\n code: 'ECONNREFUSED',\n errno: 'ECONNREFUSED',\n syscall: 'connect',\n address: '127.0.0.1',\n port: 5432

My App Engine Java application is working with this Cloud SQL instance. But in node cloud function i'm not havind success with the connection.

Here are my params only omitting user and password:

max: 1, user: 'username', password: 'password', database: 'appengine_helloworld_db', socketPath: '/cloudsql/hello-world-4736435:southamerica-east1:hello-world-postgis-sp'

Thank You,

Emerson Leite de Moraes

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/e324d77c-59d4-4815-ae90-204cc48a8120%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Fails to connect to Cloud SQL when using Knex.js (direct driver works fine)

Hi Igor, i'm sorry to use your issue to make a question to you.

I'm trying to run postgresDemo (from node js samples) function to connect with my CloudSQL Postgres passing all needed env params. You said that if you use "pg" directly it works fine. In my case it's not working. I'm getting the following error:

{"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect","address":"127.0.0.1","port":5432}

Do you passed by this problem too?

Note: my App Engine Java Application is getting connection with the same params that I'm using in Cloud Function.

Thank You so much,

Emerson Leite de Moraes

quinta-feira, 27 de Setembro de 2018 às 14:36:47 UTC-3, Igor Savin escreveu:
We are trying to query Cloud SQL instances (PostgreSQL and MySQL 2nd generation) from a Cloud Function (Node.js 8).

When we create pool directly using driver (e. g. using "pg" or "mysql2"), for an example like this:


const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};



mysql
.createPool(dbConfig)

It works just fine. However, if we try instantiating pool using knex, e. g. like this:

const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};


Knex(client: 'mysql2',
connection
: dbConfig)


we get error during execution:

D functionName kkb7wsgnbixj Function execution started functionName kkb7wsgnbixj
D functionNAme kkb7wsgnbixj
Function execution took 818 ms, finished with status: 'connection error' functionName kkb7wsgnbixj


This seems to be specific to Cloud Functions/Cloud SQL, because locally knex code works just fine and it also works just fine from non-cloud-function projects as well.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/55ef07e3-df51-4805-8471-3238215d3425%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Postgres Sql - On Demand Backup "atomicity"

Hi guys,

Was wondering if the on demand backup is atomic - i.e. once I start it, it freezes the current state and any changes after starting (and before finishing) are not reflected?

I.e. do I need to wait for the backup to finish before running my risky operations or I can just go ahead once it's acknowledged?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/77375357-7fe0-4326-88c0-8f963d45a75a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wednesday, September 26, 2018

[google-cloud-sql-discuss] Re: My postgres DB increase storage usage non-stop

The issue is most likely happening due to the database behavior. More specifically due to complicated queries that create a lot of temporary tables at a certain point in time. PostgreSQL here will behave the same way as MySQL so it may rapidly accumulate a lot of temp tables on disk, but then will remove them as soon as the queries finish. In order to check the instance storage usage, check on Cloud Console > SQL > "instance" > Overview tab. Also, check the replica current storage size.

Note that it is not possible to decrease the size of the instance once it has increased. However, it is possible to edit the instance settings [2] and disable the automatic storage increase, but that the database may stop accepting incoming connections and go offline if it runs out of space [3].

I hope it helps you identify the reason why the instance storage increased.

On Tuesday, September 25, 2018 at 2:00:27 PM UTC-4, Binh Bui Van wrote:
I have a DB postgres and 1 replica DB
Until Yesterday, my DB only about 300MB(replica DB is the same).
But from yesterday, DB storage usage increase to ~4.5GB.(but i see replica DB  still just 300MB)
I checked log and see that, many temp file has been created.
--
path "base/pgsql_tmp/pgsql_tmp20714.0", size 4882432
--
It this the reason make storage increase?
Why it does not happen in past.
Anyone give me advice?

Thank you!

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/52aecb82-70fa-43e3-8fbe-346bbe08f5f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Fails to connect to Cloud SQL when using Knex.js (direct driver works fine)

We are trying to query Cloud SQL instances (PostgreSQL and MySQL 2nd generation) from a Cloud Function (Node.js 8).

When we create pool directly using driver (e. g. using "pg" or "mysql2"), for an example like this:


const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};



mysql
.createPool(dbConfig)

It works just fine. However, if we try instantiating pool using knex, e. g. like this:

const dbConfig = {
 user
: 'username',
 password
: 'password',
 database
: 'dbName',
 socketPath
= `/cloudsql/instance_name`;
};


Knex(client: 'mysql2',
connection
: dbConfig)


we get error during execution:

D functionName kkb7wsgnbixj Function execution started functionName kkb7wsgnbixj
D functionNAme kkb7wsgnbixj
Function execution took 818 ms, finished with status: 'connection error' functionName kkb7wsgnbixj


This seems to be specific to Cloud Functions/Cloud SQL, because locally knex code works just fine and it also works just fine from non-cloud-function projects as well.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/289aead4-0c7d-4c83-b2ca-87f3cf64c8fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tuesday, September 25, 2018

[google-cloud-sql-discuss] Re: Advice/experience using micro & small instances

In support of Karthick's advice: you may follow this guide to change your instance type and save money. If database is accessed about twice a week, the maintenance window involved in this operation cannot possibly affect your Customer much. 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/9f963738-56e5-4445-bae7-06bcaa070a92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Advice/experience using micro & small instances

Hi Ben,
I'm in the same boat. I have a small ecological database that will be accessed by only five data nerds, and would have *plenty* of room even in the micro instance. Have you had any luck or experience using micro? I'd like to press the downsize button before my free credit runs dry...
Best,
Ashley


On Wednesday, February 28, 2018 at 8:04:32 AM UTC-6, Ben Oliver wrote:
I have an SQL instance running, I've been pleased with the service so far but as a db-n1-standard-1 the cost is quite high for my usage level.

I went to downgrade and saw the warning that it is not recommended for production use.

I just wanted to know what your experiences were with the smaller options.

I'm perhaps in a bit of a niche - it's a production DB but with extremely low size and use. It maybe gets accessed by customers twice a week! We would never even come close to hitting the usage limits.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/727214af-7bcc-47d4-9bb2-da58bcfdbed3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] My postgres DB increase storage usage non-stop

I have a DB postgres and 1 replica DB
Until Yesterday, my DB only about 300MB(replica DB is the same).
But from yesterday, DB storage usage increase to ~4.5GB.(but i see replica DB  still just 300MB)
I checked log and see that, many temp file has been created.
--
path "base/pgsql_tmp/pgsql_tmp20714.0", size 4882432
--
It this the reason make storage increase?
Why it does not happen in past.
Anyone give me advice?

Thank you!

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/92fc19b1-4789-4dab-87ec-396fcfcff046%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Monday, September 24, 2018

Re: [google-cloud-sql-discuss] Re: ERROR: must be owner of extension plpgsql

On the Cloud PostgreSQL, the documentation confirms that configuring External Masters are not supported. However, this is supported within the CloudSQL first and Second Generations. About the implementation on Cloud PostgreSQL, I can confirm that there are internal ongoing processes to ensure this feature is available soon. 

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2d7b1a56-8756-4d97-aa08-2992c8c20df1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: [google-cloud-sql-discuss] Re: ERROR: must be owner of extension plpgsql

so there is no way to import any big external db into gcloud, also, there is no way for master-slave config streaming replication... and 1 year passed. 

On Friday, April 13, 2018 at 12:16:25 PM UTC+3, Tianzhou Chen wrote:
The proper way to dump a single DB is via the export option from your console or via gcloud, which would skip dumping plpgsql stuff.

Using pg_dump directly will not work as it has the permission issue of plpgsql.

On Wednesday, October 11, 2017 at 6:02:55 AM UTC-7, Stanislas drg wrote:
The above code doesn't work in my case.
The following command :


pg_dump -Fp --no-acl --no-owner -h localhost -d test2 -U myusername --file sth.sql

Returns : 

SET SET SET SET SET SET SET SET CREATE EXTENSION ERROR: must be owner of extension plpgsql


Tbh, I find it baffling that the command provided in [the documentation](https://cloud.google.com/sql/docs/postgres/import-export/creating-sqldump-csv) doesn't work either (returns the same error as above).

I've been trying to overcome this for the past three hours using numerous methods. I've recreated an instance, dumped a test and production DB using various combinations, tried to DROP plpsql and change user privileges. Nothing worked so far.

I've also carefully looked at this [S.O thread](https://stackoverflow.com/questions/13410631/how-to-solve-privileges-issues-when-restore-postgresql-database)

Contrarily to what is described for Amazon RDS, the error seems blocking (I can't see any changes in the DB).


What is the proper way to dump a simple DB as of now ?


Thank you for your help




--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/d065e834-e092-42b7-aeb1-2b7952a31b67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Saturday, September 22, 2018

[google-cloud-sql-discuss] Re: Bizarre issues using Slick 3.2.3 + HikariCP + CloudSQL

Please report the issue on our issue tracker [1] so we can keep track of it. Google Groups is generally reserved for discussions and not troubleshooting, thanks.

[1] https://developers.google.com/issue-tracker/

On Thursday, September 20, 2018 at 10:44:14 AM UTC-4, Charles Batty-Capps wrote:
Hi,
We are getting some very strange issues. We use Scala in App Engine Standard (Java8) with a 2nd generation Cloud SQL (MySQL).

It's like some result sets are getting parsed on the wrong thread or something. 
Some examples include:
java.lang.ClassCastException: java.lang.Integer cannot be cast to <our domain model>
java.sql.SQLException: ResultSet is from UPDATE. No Data.

The really bizarre thing is that this only happens once in a blue moon; say once a day for ~20 requests somewhat nearby in time, out of thousands and thousands of requests. 

We are using the correct Java8 connection string, like this from the Cloud SQL App Engine Standard docs.
jdbc:mysql://google/${CLOUD_SQL_DATABASE}?cloudSqlInstance=${CLOUD_SQL_INSTANCE}&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC

How does this relate to GAE & Cloud SQL?
Being in GAE seems to be preventing us from troubleshooting for these reasons:
(1) I cannot tell which version of mysql-connector-j is being used. The dependency is swapped out at runtime in some way; from the stacktraces it's clear that the ordinary MySQL connector 5.1.42 is not being used, and the documentation has comments that say "only used locally" for this dependency. If we were able to control the version of mysql-connector-j, then we would use a known good version that is tested with Slick + HikariCP.
(2) This seems to have started happening when we switched to correctly using the com.google.cloud.sql.mysql.SocketFactory . Could there be a bug with this socket factory, or some weird incompatibility with HikariCP or Slick?

I really appreciate any hints to point me in the right direction, this is a pretty brutal problem as the stacktraces are very deep in the MySQL connector code (which is some custom Google version) so I am basically helpless at troubleshooting in any useful way since the stacktraces don't line up with the code.


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/48c5e92b-5166-4017-b7c5-685e1886e261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Friday, September 21, 2018

[google-cloud-sql-discuss] Re: phpMyAdmin - MySQL server has gone away

Hello Noel


I am glad to know that the issue was resolved for you. And thank you for your feedback on documentation changes. I can see Pia already changed it. I hope that helps.


On Friday, September 21, 2018 at 9:38:41 AM UTC-4, Noel McKeown wrote:
Hi Amit,

Thanks for getting back. 

Yeah it was the curly bracket were the problem.
I would think it's worth updating the tech note as its not accurate.
The double curly brackets are not highlighted to replace so I would think you leave these as is based on the instructions below:

  1. Paste the new secret in place of {{your-secret}} in config.inc.php.
  2. Replace the value of {{your_connection_string}} (within the $host variable) with the Instance connection name property.

I had a look online and it seems to be a common problem so maybe a lot of people are reading it the same.

Best Regards,
Noel

On Thursday, 20 September 2018 15:44:14 UTC+1, Amit (Google Cloud Support) wrote:

Hi


It seems like you have an internal ticket with us for this case. Per my colleague's feedback on that case, he suggested to check your host in the config.inc.php file. As you already checked this file, he just wanted to make sure you included the region in your host path, as an example:


$host = "/cloudsql/yourProjectID:regionOfTheInstance:SQLinstanceName"


Please let him know if after following those steps, you are able to connect.



On Tuesday, September 18, 2018 at 1:36:03 PM UTC-4, Noel McKeown wrote:
Hi users,

I have setup phpMyAdmin on my app engine to connect to the Cloud SQL instances as per this technote:

I haven't any issue following the guide and phpMyAdmin loads fine.
When I try to login I get the following for all accounts:

phpMyAdmin_FailedLogin.PNG




I had a look everywhere online but can't resolve this. The instance connection name in config.inc.php is correct and IAM should be all setup.


Anyone come across this and have an idea to resolve ?


Many Thanks


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/b7557528-3933-4467-80fd-9cd29f1d962f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: phpMyAdmin - MySQL server has gone away

I updated the docs so the highlighting includes the curly brackets. Hope that helps folks.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/699b8a99-2cba-48dc-bb45-08f5f3e3a5bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, September 20, 2018

[google-cloud-sql-discuss] Re: maintenance window skipped

Apologies, the documentation was incorrect. It has been fixed.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a99d13f8-fc9d-4735-b2d6-586754000a4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: phpMyAdmin - MySQL server has gone away

Hi Amit,

Thanks for getting back. 

Yeah it was the curly bracket were the problem.
I would think it's worth updating the tech note as its not accurate.
The double curly brackets are not highlighted to replace so I would think you leave these as is based on the instructions below:

  1. Paste the new secret in place of {{your-secret}} in config.inc.php.
  2. Replace the value of {{your_connection_string}} (within the $host variable) with the Instance connection name property.

I had a look online and it seems to be a common problem so maybe a lot of people are reading it the same.

Best Regards,
Noel

On Thursday, 20 September 2018 15:44:14 UTC+1, Amit (Google Cloud Support) wrote:

Hi


It seems like you have an internal ticket with us for this case. Per my colleague's feedback on that case, he suggested to check your host in the config.inc.php file. As you already checked this file, he just wanted to make sure you included the region in your host path, as an example:


$host = "/cloudsql/yourProjectID:regionOfTheInstance:SQLinstanceName"


Please let him know if after following those steps, you are able to connect.



On Tuesday, September 18, 2018 at 1:36:03 PM UTC-4, Noel McKeown wrote:
Hi users,

I have setup phpMyAdmin on my app engine to connect to the Cloud SQL instances as per this technote:

I haven't any issue following the guide and phpMyAdmin loads fine.
When I try to login I get the following for all accounts:

phpMyAdmin_FailedLogin.PNG




I had a look everywhere online but can't resolve this. The instance connection name in config.inc.php is correct and IAM should be all setup.


Anyone come across this and have an idea to resolve ?


Many Thanks


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/cdc7911f-ac74-4285-b2bf-9ce145942ab6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[google-cloud-sql-discuss] Re: Bizarre issues using Slick 3.2.3 + HikariCP + CloudSQL

Some other errors we're seeing (which again happen seemingly randomly a very small fraction of the time). I have no idea what's causing this sort of data corruption.
  • java.sql.SQLException: Unknown character set index for field '11824' received from server.
  • Could not map transaction isolation '<random string from a database column for an unrelated query> to a valid JDBC level.

On Thursday, September 20, 2018 at 7:44:14 AM UTC-7, Charles Batty-Capps wrote:
Hi,
We are getting some very strange issues. We use Scala in App Engine Standard (Java8) with a 2nd generation Cloud SQL (MySQL).

It's like some result sets are getting parsed on the wrong thread or something. 
Some examples include:
java.lang.ClassCastException: java.lang.Integer cannot be cast to <our domain model>
java.sql.SQLException: ResultSet is from UPDATE. No Data.

The really bizarre thing is that this only happens once in a blue moon; say once a day for ~20 requests somewhat nearby in time, out of thousands and thousands of requests. 

We are using the correct Java8 connection string, like this from the Cloud SQL App Engine Standard docs.
jdbc:mysql://google/${CLOUD_SQL_DATABASE}?cloudSqlInstance=${CLOUD_SQL_INSTANCE}&socketFactory=com.google.cloud.sql.mysql.SocketFactory&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC

How does this relate to GAE & Cloud SQL?
Being in GAE seems to be preventing us from troubleshooting for these reasons:
(1) I cannot tell which version of mysql-connector-j is being used. The dependency is swapped out at runtime in some way; from the stacktraces it's clear that the ordinary MySQL connector 5.1.42 is not being used, and the documentation has comments that say "only used locally" for this dependency. If we were able to control the version of mysql-connector-j, then we would use a known good version that is tested with Slick + HikariCP.
(2) This seems to have started happening when we switched to correctly using the com.google.cloud.sql.mysql.SocketFactory . Could there be a bug with this socket factory, or some weird incompatibility with HikariCP or Slick?

I really appreciate any hints to point me in the right direction, this is a pretty brutal problem as the stacktraces are very deep in the MySQL connector code (which is some custom Google version) so I am basically helpless at troubleshooting in any useful way since the stacktraces don't line up with the code.


--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a8f435b5-7c0b-466d-8e4a-fc8f83466aa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.