Hey Prashant,

Usually issues are reported in the Public Issue Tracker 
<https://code.google.com/p/googlecloudsql/issues/list>, rather than in 
Groups as here, but it turns out that the information you've provided is 
very close to adequate for a Public Issue Tracker report, and I can just go 
ahead and use it to create an issue tracker thread, once I reproduce the 
behaviour. In order to make sure I do so properly, however, could you just 
let me know what changes you'd made to the example app before deploying?

Once I've got that information and got the issue reproduced and a tracking 
thread made in the Public Issue Tracker, I'll post it back here so you can 
star the issue to follow it.

Cheers!

Nick
Cloud Platform Community Support

On Tuesday, April 5, 2016 at 12:07:41 AM UTC-4, Prashant V wrote:
>
> I treid out a python app to see whether it was a runtime specific issue. I 
> created a simple app based on the sample app here: 
> https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/managed_vms/cloudsql
>
> It also failed with a similar error which leads me to believe that this is 
> just an issue with the App Engine flexible environment when trying to 
> access CloudSQL. 
>
> Exception from python:
>
> Traceback (most recent call last):
>>
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 
>> 2074, in _wrap_pool_connect
>>     return fn()
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 376, 
>> in connect
>>     return _ConnectionFairy._checkout(self)
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 713, 
>> in _checkout
>>     fairy = _ConnectionRecord.checkout(pool)
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 480, 
>> in checkout
>>     rec = pool._do_get()
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 1060, 
>> in _do_get
>>     self._dec_overflow()
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/util/langhelpers.py", 
>> line 60, in __exit__
>>     compat.reraise(exc_type, exc_value, exc_tb)
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 
>> 184, in reraise
>>     raise value
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 1057, 
>> in _do_get
>>     return self._create_connection()
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 323, 
>> in _create_connection
>>     return _ConnectionRecord(self)
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 449, 
>> in __init__
>>     self.connection = self.__connect()
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/pool.py", line 607, 
>> in __connect
>>     connection = self.__pool._invoke_creator(self)
>>   File 
>> "/env/lib/python3.4/site-packages/sqlalchemy/engine/strategies.py", line 
>> 97, in connect
>>     return dialect.connect(*cargs, **cparams)
>>   File "/env/lib/python3.4/site-packages/sqlalchemy/engine/default.py", 
>> line 385, in connect
>>     return self.dbapi.connect(*cargs, **cparams)
>>   File "/env/lib/python3.4/site-packages/pymysql/__init__.py", line 88, 
>> in Connect
>>     return Connection(*args, **kwargs)
>>   File "/env/lib/python3.4/site-packages/pymysql/connections.py", line 
>> 679, in __init__
>>     self.connect()
>>   File "/env/lib/python3.4/site-packages/pymysql/connections.py", line 
>> 890, in connect
>>     self._get_server_information()
>>   File "/env/lib/python3.4/site-packages/pymysql/connections.py", line 
>> 1190, in _get_server_information
>>     packet = self._read_packet()
>>   File "/env/lib/python3.4/site-packages/pymysql/connections.py", line 
>> 946, in _read_packet
>>     packet_header = self._read_bytes(4)
>>   File "/env/lib/python3.4/site-packages/pymysql/connections.py", line 
>> 982, in _read_bytes
>>     2013, "Lost connection to MySQL server during query")
>> pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server 
>> during query')
>>
>>
> On Monday, 4 April 2016 20:52:48 UTC-7, Prashant V wrote:
>>
>> Thanks for the reply Nick. Here's the exact error from the container,
>>
>>> Warning: mysqli::mysqli(): MySQL server has gone away in 
>>> /var/www/html/test.php on line 2
>>> Warning: mysqli::mysqli(): Error while reading greeting packet. PID=222 
>>> in /var/www/html/test.php on line 2
>>> Warning: mysqli::mysqli(): (HY000/2006): MySQL server has gone away in 
>>> /var/www/html/test.php on line 2
>>
>>
>> I'm using a custom docker container for Wordpress (so PHP), and tried a 
>> manual PHP script which produced that.
>>
>> I changed my database settings to allow all (0.0.0.0/0), and tried a 
>> user that can connect remotely (verified from my local machine).
>>
>> It doesn't really give a very helpful error, I think the error logs are 
>> on the server side. I can give you the database ID off-thread if you'd like.
>>
>> On Monday, 4 April 2016 09:21:06 UTC-7, Nick (Cloud Platform Support) 
>> wrote:
>>>
>>> This is interesting. It appears possible, but I can't confirm (and I'm 
>>> not sure if you can, any longer), that even after enabling the beta_setting 
>>> and attempting a socket connection, the IP of the Managed VM instance had 
>>> changed, not being a static IP but ephemeral, resulting in the instance 
>>> refusing connection. If possible, could you share the logs of the errors 
>>> you saw? To answer your posts' ending question, Cloud SQL with Flexible 
>>> Environment <https://cloud.google.com/appengine/docs/flexible/> apps is 
>>> supported as a beta feature for now in Python, Node.js, and Go, while 
>>> Java is not yet supported 
>>> <https://cloud.google.com/appengine/docs/flexible/python/using-cloud-sql>
>>> .
>>>
>>>
>>>
>>> On Monday, April 4, 2016 at 2:59:12 AM UTC-4, Prashant V wrote:
>>>>
>>>> I was trying to get a cloud sql instance working inside of a container 
>>>> running on App Engine Flexible Environment, and hit a few issues:
>>>>
>>>> First, I couldn't find /cloudsql directory containing unix sockets at 
>>>> all. I'm not sure if this is in custom containers by default?
>>>> https://cloud.google.com/appengine/docs/python/cloud-sql/
>>>>
>>>> I managed to get something working by finding a beta_settings key in 
>>>> app.yaml and set it to:
>>>>
>>>> beta_settings:                                                          
>>>>                                               │
>>>>
>>>>   cloud_sql_instances: <project-id>:<region-id>:<database-id>
>>>>
>>>>
>>>> This led to the /cloudsql directory existing, but the contents didn't 
>>>> match what I expected, I expected /cloudsql/<app-id>:<database-id>, but it 
>>>> had <region-id> in the middle.
>>>>
>>>>
>>>> After all that, it still failed to connect, giving me errors that the 
>>>> remote mysql had gone away (even though the app was definitely in the 
>>>> authorized list).
>>>>
>>>>
>>>> I ended up connecting via IP as a workaround, but I'd like to get this 
>>>> working with the socket. Is Cloud SQL supported in the Flexible 
>>>> Environment?
>>>>
>>>>
>>>>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/07cf0d70-23ed-4070-ade3-d243d46b9fff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine] C... Prashant V
    • [google-appengi... 'Nick (Cloud Platform Support)' via Google App Engine
      • [google-app... Prashant V
        • [google... Prashant V
          • [go... 'Nick (Cloud Platform Support)' via Google App Engine
            • ... Prashant V
              • ... 'Nick (Cloud Platform Support)' via Google App Engine
                • ... Prashant Varanasi
                • ... 'Nick (Cloud Platform Support)' via Google App Engine
                • ... 'Nick (Cloud Platform Support)' via Google App Engine
                • ... 'Les Vogel' via Google App Engine
                • ... Prashant V
                • ... 'Nick (Cloud Platform Support)' via Google App Engine
                • ... Prashant V
                • ... 'Nick (Cloud Platform Support)' via Google App Engine

Reply via email to