I am not sure what the problem is for you but it tested this and I found a
different error which I fixed in DAL trunk. Please try the latest trunk and
see it you can reproduce it.
Massimo
On Friday, 11 December 2015 19:15:24 UTC-6, Tom Campbell wrote:
>
> Can someone tell me what I'm doing wrong in my attempt to use Google Cloud
> SQL?
>
> My GAE app runs successfully on local machine without database support.
> Goal is to use Google Cloud SQL database.
> Remote Google Cloud SQL database is accessible via mysql on the command
> line.
> Google SDK is the latest.
>
> db.py contains this code:
> db = DAL('google:sql://gigcity-1951:dbtest/tomsdatabase')
>
> When run, yields this web2py error:
>
>
> <type 'exceptions.RuntimeError'> Failure to connect, tried 5 times:
>> Traceback (most recent call last): File
>> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/base.py", line 410, in __init__
>> self._adapter = ADAPTERS[self._dbname](**kwargs) File
>> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/adapters/base.py", line 47, in
>> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File
>> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/adapters/google.py", line 51,
>> in __init__ if do_connect: self.reconnect() File
>> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/connection.py", line 92, in
>> reconnect self.connection = f() File
>> "/Users/tom/Dropbox/work/m/web2py/gluon/dal/adapters/google.py", line 49,
>> in connector return rdbms.connect(**driver_args) AttributeError: 'NoneType'
>> object has no attribute 'connect'
>>
>
> I start it like this:
>
> dev_appserver.py ../web2py --mysql_user=sampleuser --mysql_password=foo
>>
>
>
> Relevant (?) lines of app.yaml:
>
>
>> application: gigcity-1951
>> version: 1
>> api_version: 1
>>
>> # use these lines for Python 2.7
>> # upload app with: appcfg.py update web2py (where 'web2py' is web2py's
>> root dir
>> #
>> runtime: python27
>> threadsafe: true # true for WSGI & concurrent requests (Python 2.7
>> only)
>>
>> default_expiration: "24h" # for static files
>>
>> handlers:
>>
>> # Warning! Static mapping - below - isn't compatible with
>> # the parametric router's language logic.
>> # You cannot use them together.
>>
>> - url: /(.+?)/static/_\d.\d.\d\/(.+)
>> static_files: applications/\1/static/\2
>> upload: applications/(.+?)/static/(.+)
>>
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.