Drupal website mysql error Google Cloud SQL - google-cloud-sql

Today I got a problem with a drupal website connected to a SQL database in Google Cloud SQL (error 502 in my browser).
Accessing the SQL logs I got this entry thousands of times:
2018-10-02 11:49:00.434 ECT
2018-10-02T16:49:00.434633Z 8291808 [Note] Aborted connection 8291808 to db: 'drupal' user: 'root' host: '35.224.213.131' (Got an error reading communication packets)
screen capture log GOOGLE CLOUD SQL
I still could connect from my web server to the SQL server via command line but for some reason I kept getting the same error when I openned the site.
I finally restarted the SQL server and it worked again.
Have any of you encountered this problem?

As you can see over at https://cloud.google.com/sql/docs/mysql/diagnose-issues the message "Aborted connection" usually means that your application is not terminating connections properly, or that you had a network issue.

Related

Db2 on Cloud connection refused w/ reason "19" ("USERID DISABLED or RESTRICTED")

While working with my database today, which is a DB2 on Cloud instance (free/lite plan), it began to reject my attempts to connect (from both python and node.js) with the following error:
SQL30082N Security processing failed with reason "19" ("USERID DISABLED or RESTRICTED"). SQLSTATE=08001\r SQLCODE=-30082
The userid in question is the auot-generated user/schema created when I created the Db2 on Cloud service via the console. I and still access the Db2 instance UI from the console. I had able to connect to the database multiple times only a few minutes prior. I have been using the secure (SSL) connection string details. Any ideas on how to reset the userid?

Unable to connect to second generation from SDK on OS X

I am unable to connect to a second generation Cloud SQL database from my OS/X SDK environment using PHP. I get a 1045 "Access denied for user 'user'#'ip address' (using password: YES)" error. I am using SSL for the direct IP connections.
My setup works fine for first generation Cloud SQL databases and it also works from MySQL Workbench.
I am migrating from a first to a second generation database and running tests. The only thing that changes is IP address and the referenced SSL files. From the PHP program the connection string looks like this for both generation 1 and generation 2 connections when using the SDK:
mysql:host=<IP_ADDRESS>:3306;dbname=<DATABASE>
Although the proxy hangs or crashes when attempting to connect it does report a valid connection when testing the connection from MySQL Workbench. When I attempt the actual connection, though, it either hangs after "New connection for..." message or crashes with a fatal error: unexpected signal during runtime execution after issuing the "New connection for..." message.

RDS PostgreSQL: General error: 7 SSL error: invalid key length

Sometimes I catch an error from RDS PostgreSQL.
SQLSTATE[HY000]: General error: 7 SSL error: invalid key length
Usually it works fine, but sometimes the error.
What could it be? Any ideas?
Engine: PostgreSQL 9.4.1
Certificate Authority: rds-ca-2015 (Mar 5, 2020)
Instance Class: db.m3.medium
Storage Type: General Purpose (SSD)
IOPS: disabled
Storage: 100 GB
Encryption Enabled: No
DB Instance Status: available
Multi AZ: No
Updated 2016-01-18
A SQL request does not matter, I catch the error with different requests, usually primitive. And I don't see any relationship with the SQL request.
I noticed, that it happens when SQL requests have a delay:
<- Request from PayPal Webhook Event
-> SQL requests (everything fine)
-> Request to PayPal REST API for validation (everything fine)
-> SQL requests (catch the error)
I cannot understand, it's only for AWS / RDS or someone catch it in other cases?
Updated 2016-01-27
From error/postgresql.log
LOG: could not receive data from client: Connection reset by peer
When I'm trying execute a query again I'm getting another error:
SQLSTATE[HY000]: General error: 7 no connection to the server
Reconnecting does not help, I have the same error "no connection to the server"
The script made 50 attempts during the day and in the end the script has worked without the error.
Seems the error related with network or connecting (PDO connecting, PHP-FPM, PHP 5.6, SSL)
Same issue here with Paypal, I turned off the sslmode in the PostgreSQL connection pool (internal network)
sslmode=disable
dsn = 'pgsql:host=host.com;port=5432;dbname=postgres;sslmode=disable'
TLDR;
If you are using OpenSSL or anything related to it and PHP < 7.1, turning off SSL for Postgres might solve your problem.
non-TLDR;
Had same issue with custom framework, Postgres 9.3 on AWS VM and a legacy PHP 5.3.
Worked for 3 years w/o any problems then all of a sudden a simple select started throwing this error without any relevant changes to code/configuration. It wasn't the longest query we have (char count) and it wasn't the query that took a long time to execute.
While SSL was off in Postgres pg_hba.conf, explicitly disabling it in DSN: sslmode=disable (see #Gergo Bacskai answer) did help and the error did not return.
So after a deeper investigation what seems to be the cause is this bug: https://bugs.php.net/bug.php?id=69524
We have started using phpseclib when integrating with 3rd party service and it probably uses openssl_pkey_get_public or some alternative to it and that's the moment we started receiving these errors.

ERROR 2013 (HY000) while connecting to Google Cloud Sql MySql database from mysql client

Since yesterday, I am getting the following error while trying to connect to my Google Cloud SQL MySql database:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
My app is able to connect to the database, but I am unable to connect from my computer. I have configured my public ip address in Access Controls section.
I noticed one other thing. The public address I setup is not stored, and when I come back to the "Access Control" tab I see a different ip address from what I saved.
How do I access my Cloud SQL MySql instance through MySql client? Is there any other setting I need to do?
I figured this was a browser problem. The Google developer console on Mozilla was displaying the ip as updated although it was not updating it in the backend. I used Chrome to set this Access control in the Developer console and this worked fine.

Google Cloud SQL: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 0

I'm desperate since my Google Cloud SQL instance went down. I could connect to it yesterday without problem but since this morning i'm unable to connect to it in any way, it produces the following error: The database server returned this error: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 0
This is what I did to try to fix this:
restart instance
added authorized ip-addresses in CIDR notation
reset root password
restored backup
pinged the ip-address and I get response
All these actions completed but i'm still unable to connect through:
PHP
MySQL workbench
Ubuntu MySQL command line
All without luck. What could I do to repair my Cloud SQL instance. Is anyone else having this problem?
I'm from the Cloud SQL team. We are looking into this issue, it should be resolved soon. See https://groups.google.com/forum/#!topic/google-cloud-sql-announce/SwomB2zuRDo. Updates will be posted on that thread (and if there's anything particularly important I'll edit this post).
The problem seems to only affect connections from outside Google Cloud. Clients connecting from App Engine and Compute Engine should work fine.
Our company has same problem.
We are unable to connect through both MySQL workbench and MySQL command line.
Our Google Appengine application has no problems to connect since its not using external IP.
there.I encountered the same problem.You need to find out your public ip address,for that type "my public ip" in Google.Now click on your Cloud SQL instance that you created,under that click on ACCESS CONTROL tab and then click on Authorization tab under that.Under Authorized network,give any name you want to the network and copy your public ip address in the network.Now save changes and try to run the command from console.It should work fine.