[web2py] Re: GAE - SQL cloud connection

2012-11-16 Thread rif
I created today a sql cloud database. And I got the same error.

I changed to path VARCHAR(255) and now it works. Anybody else having the 
same problem?

-rif

marți, 7 august 2012, 18:27:13 UTC+3, Massimo Di Pierro a scris:

 Why does 512 result in Specified key was too long; max key length is 767 
 bytes. Is one counting unicode and one bytes? If setting this length to 
 128 is the only option, I will change it but I am afraid it may be too 
 short to store .table files. Did you encounter any problem after this 
 change?

 On Friday, 6 January 2012 18:43:22 UTC-6, howesc wrote:

 i don't know if i'm gonna regret this later, but in dal.py i changed that 
 field length to 128:

 self.db.executesql(CREATE TABLE IF NOT EXISTS 
 web2py_filesystem (path VARCHAR(128), content LONGTEXT, PRIMARY KEY(path) ) 
 ENGINE=InnoDB;)

 now it works again.



-- 





[web2py] Re: GAE - SQL cloud connection

2012-11-16 Thread Massimo Di Pierro
Please open a ticket and we will fix this asap.

On Friday, 16 November 2012 04:49:35 UTC-6, rif wrote:

 I created today a sql cloud database. And I got the same error.

 I changed to path VARCHAR(255) and now it works. Anybody else having the 
 same problem?

 -rif

 marți, 7 august 2012, 18:27:13 UTC+3, Massimo Di Pierro a scris:

 Why does 512 result in Specified key was too long; max key length is 767 
 bytes. Is one counting unicode and one bytes? If setting this length to 
 128 is the only option, I will change it but I am afraid it may be too 
 short to store .table files. Did you encounter any problem after this 
 change?

 On Friday, 6 January 2012 18:43:22 UTC-6, howesc wrote:

 i don't know if i'm gonna regret this later, but in dal.py i changed 
 that field length to 128:

 self.db.executesql(CREATE TABLE IF NOT EXISTS 
 web2py_filesystem (path VARCHAR(128), content LONGTEXT, PRIMARY KEY(path) ) 
 ENGINE=InnoDB;)

 now it works again.



-- 





[web2py] Re: GAE - SQL cloud connection

2012-11-16 Thread rif
Done (http://code.google.com/p/web2py/issues/detail?id=1172)

Are the migrations issues to GoogleSQL still present?

-rif

vineri, 16 noiembrie 2012, 12:57:14 UTC+2, Massimo Di Pierro a scris:

 Please open a ticket and we will fix this asap.

 On Friday, 16 November 2012 04:49:35 UTC-6, rif wrote:

 I created today a sql cloud database. And I got the same error.

 I changed to path VARCHAR(255) and now it works. Anybody else having the 
 same problem?

 -rif

 marți, 7 august 2012, 18:27:13 UTC+3, Massimo Di Pierro a scris:

 Why does 512 result in Specified key was too long; max key length is 
 767 bytes. Is one counting unicode and one bytes? If setting this length 
 to 128 is the only option, I will change it but I am afraid it may be too 
 short to store .table files. Did you encounter any problem after this 
 change?

 On Friday, 6 January 2012 18:43:22 UTC-6, howesc wrote:

 i don't know if i'm gonna regret this later, but in dal.py i changed 
 that field length to 128:

 self.db.executesql(CREATE TABLE IF NOT EXISTS 
 web2py_filesystem (path VARCHAR(128), content LONGTEXT, PRIMARY KEY(path) 
 ) 
 ENGINE=InnoDB;)

 now it works again.



-- 





[web2py] Re: GAE - SQL cloud connection

2012-08-07 Thread Alexei Vinidiktov
The problem still exists in the latest nightly build.

Without this modification (changing the field length to 128) launching 
web2py on the remote GAE server gives me the error:

DatabaseError: 1071: Specified key was too long; max key length is 767 bytes


The whole traceback is as follows:

Traceback (most recent call last):
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/restricted.py,
 line 205, in restricted
exec ccode in environment
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/applications/vocabilis/models/db.py,
 line 22, in module
session.connect(request, response, db = db)
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/globals.py, 
line 523, in connect
migrate=table_migrate,
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/dal.py, line 
6943, in define_table
polymodel=polymodel)
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/dal.py, line 
810, in create_table
logfile = self.file_open(table._loggername, 'a')
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/dal.py, line 
3816, in file_open
return DatabaseStoredFile(self.db,filename,mode)
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/dal.py, line 
3757, in __init__
self.db.executesql(CREATE TABLE IF NOT EXISTS web2py_filesystem (path 
VARCHAR(512), content LONGTEXT, PRIMARY KEY(path) ) ENGINE=InnoDB;)
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/dal.py, line 
7022, in executesql
self._adapter.execute(query)
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/dal.py, line 
3865, in execute
return self.log_execute(a.decode('utf8'))
  File 
/base/data/home/apps/s~vocabilis-net/1.360870371412546434/gluon/dal.py, line 
1546, in log_execute
ret = self.cursor.execute(*a, **b)
  File 
/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py,
 line 424, in execute
self._DoExec(request)
  File 
/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py,
 line 355, in _DoExec
response = self._conn.MakeRequest('Exec', request)
  File 
/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py,
 line 711, in MakeRequest
response = self._MakeRetriableRequest(stub_method, request)
  File 
/base/python27_runtime/python27_lib/versions/1/google/storage/speckle/python/api/rdbms.py,
 line 742, in _MakeRetriableRequest
sql_exception.message))
DatabaseError: 1071: Specified key was too long; max key length is 767 bytes


On Saturday, January 7, 2012 7:43:22 AM UTC+7, howesc wrote:

 i don't know if i'm gonna regret this later, but in dal.py i changed that 
 field length to 128:

 self.db.executesql(CREATE TABLE IF NOT EXISTS 
 web2py_filesystem (path VARCHAR(128), content LONGTEXT, PRIMARY KEY(path) ) 
 ENGINE=InnoDB;)

 now it works again.


-- 





[web2py] Re: GAE - SQL cloud connection

2012-08-07 Thread Massimo Di Pierro
Why does 512 result in Specified key was too long; max key length is 767 
bytes. Is one counting unicode and one bytes? If setting this length to 
128 is the only option, I will change it but I am afraid it may be too 
short to store .table files. Did you encounter any problem after this 
change?

On Friday, 6 January 2012 18:43:22 UTC-6, howesc wrote:

 i don't know if i'm gonna regret this later, but in dal.py i changed that 
 field length to 128:

 self.db.executesql(CREATE TABLE IF NOT EXISTS 
 web2py_filesystem (path VARCHAR(128), content LONGTEXT, PRIMARY KEY(path) ) 
 ENGINE=InnoDB;)

 now it works again.


-- 





[web2py] Re: GAE - SQL cloud connection

2012-01-06 Thread howesc
i don't know if i'm gonna regret this later, but in dal.py i changed that 
field length to 128:

self.db.executesql(CREATE TABLE IF NOT EXISTS 
web2py_filesystem (path VARCHAR(128), content LONGTEXT, PRIMARY KEY(path) ) 
ENGINE=InnoDB;)

now it works again.


[web2py] Re: GAE - SQL cloud connection

2011-11-10 Thread pallav
Hi Massimo,

I just ran into the same issue on GAE SQL. Any update/ideas since the
last post? I'm happy to help code/debug/brainstorm.

Thanks,
Pallav

On Oct 19, 10:53 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 This is another of those weird mysql issues

 CREATE TABLE IF NOT EXISTS web2py_filesystem (path VARCHAR(512),
 content LONGTEXT, PRIMARYKEY(path));

 results in DatabaseError: 1071: Specifiedkeywastoolong; maxkey
 length is 767 bytes

 I need to think about a workaround I have been running on
 google:sql and I did not run into this problem before.

 On Oct 18, 10:51 pm, Simon Ashley gregs...@gmail.com wrote:







  Having an issues connecting to the SQL cloud.

  Have a simple application which works on SQLite.
  Able to deploy to GAE using the following:
    db = DAL('gae')

  However if its changed to:
    db = DAL('google:sql://cdmr01:csm/csmcel05',migrate_enabled=True)
    # cdmr01:csm is the sql cloud instance and csmcel05 the GAE
  application; which we assume is correct.

  It can't create the database failing with the following log:

  E 2011-10-19 13:00:14.137
  Traceback (most recent call last):
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  restricted.py, line 192, in restricted
      exec ccode in environment
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/
  applications/demurage/models/db.py, line 16, in module
      session.connect(request, response, db=db)
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  globals.py, line 425, in connect
      migrate=table_migrate,
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  dal.py, line 4534, in define_table
      polymodel=polymodel)
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  dal.py, line 691, in create_table
      logfile = self.file_open(table._loggername, 'a')
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  dal.py, line 2925, in file_open
      return DatabaseStoredFile(self.db,filename,mode)
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  dal.py, line 2866, in __init__
      self.db.executesql(CREATE TABLE IF NOT EXISTS web2py_filesystem
  (path VARCHAR(512), content LONGTEXT, PRIMARYKEY(path) )
  ENGINE=InnoDB;)
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  dal.py, line 4607, in executesql
      self._adapter.execute(query)
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  dal.py, line 1339, in execute
      return self.log_execute(*a, **b)
    File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
  dal.py, line 1334, in log_execute
      ret = self.cursor.execute(*a, **b)
    File /base/python_runtime/python_lib/versions/1/google/storage/
  speckle/python/api/rdbms.py, line 287, in execute
      response = self._conn.MakeRequest('Exec', request)
    File /base/python_runtime/python_lib/versions/1/google/storage/
  speckle/python/api/rdbms.py, line 579, in MakeRequest
      response = self._MakeRetriableRequest(stub_method, request)
    File /base/python_runtime/python_lib/versions/1/google/storage/
  speckle/python/api/rdbms.py, line 610, in _MakeRetriableRequest
      sql_exception.message))
  DatabaseError: 1071: Specifiedkeywastoolong; maxkeylength is 767
  bytes

  Any ideas or work arounds?
  (would be good to have a sample application we know works, if the
  issue is with the connection/routes /app configurations)


[web2py] Re: GAE - SQL cloud connection

2011-10-19 Thread Massimo Di Pierro
This is another of those weird mysql issues

CREATE TABLE IF NOT EXISTS web2py_filesystem (path VARCHAR(512),
content LONGTEXT, PRIMARY KEY(path));

results in DatabaseError: 1071: Specified key was too long; max key
length is 767 bytes

I need to think about a workaround I have been running on
google:sql and I did not run into this problem before.


On Oct 18, 10:51 pm, Simon Ashley gregs...@gmail.com wrote:
 Having an issues connecting to the SQL cloud.

 Have a simple application which works on SQLite.
 Able to deploy to GAE using the following:
   db = DAL('gae')

 However if its changed to:
   db = DAL('google:sql://cdmr01:csm/csmcel05',migrate_enabled=True)
   # cdmr01:csm is the sql cloud instance and csmcel05 the GAE
 application; which we assume is correct.

 It can't create the database failing with the following log:

 E 2011-10-19 13:00:14.137
 Traceback (most recent call last):
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 restricted.py, line 192, in restricted
     exec ccode in environment
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/
 applications/demurage/models/db.py, line 16, in module
     session.connect(request, response, db=db)
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 globals.py, line 425, in connect
     migrate=table_migrate,
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 dal.py, line 4534, in define_table
     polymodel=polymodel)
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 dal.py, line 691, in create_table
     logfile = self.file_open(table._loggername, 'a')
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 dal.py, line 2925, in file_open
     return DatabaseStoredFile(self.db,filename,mode)
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 dal.py, line 2866, in __init__
     self.db.executesql(CREATE TABLE IF NOT EXISTS web2py_filesystem
 (path VARCHAR(512), content LONGTEXT, PRIMARY KEY(path) )
 ENGINE=InnoDB;)
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 dal.py, line 4607, in executesql
     self._adapter.execute(query)
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 dal.py, line 1339, in execute
     return self.log_execute(*a, **b)
   File /base/data/home/apps/s~csmcel05/1.354064527714710096/gluon/
 dal.py, line 1334, in log_execute
     ret = self.cursor.execute(*a, **b)
   File /base/python_runtime/python_lib/versions/1/google/storage/
 speckle/python/api/rdbms.py, line 287, in execute
     response = self._conn.MakeRequest('Exec', request)
   File /base/python_runtime/python_lib/versions/1/google/storage/
 speckle/python/api/rdbms.py, line 579, in MakeRequest
     response = self._MakeRetriableRequest(stub_method, request)
   File /base/python_runtime/python_lib/versions/1/google/storage/
 speckle/python/api/rdbms.py, line 610, in _MakeRetriableRequest
     sql_exception.message))
 DatabaseError: 1071: Specified key was too long; max key length is 767
 bytes

 Any ideas or work arounds?
 (would be good to have a sample application we know works, if the
 issue is with the connection/routes /app configurations)