Re: [web2py] Re: Error writing to session with latest Google App Engine 1.8.1

2013-07-06 Thread Aravindan Rs
hi cfh,

did you complete the move to the recent web2py version? does it solve the 
issue and work well with GAE version 1.8.1? i want to move now and any 
notes from you would be helpful.

thanks,
aravind.

On Saturday, 15 June 2013 06:18:06 UTC+5:30, Christian Foster Howes wrote:

 Yup, that change is why i'm upgrading web2py now.  Other GAE users have 
 reported issues with the recent web2py versions, and i think i found an 
 issue in the auth module when using custom table names.  I'll let you 
 know my results as i do my testing 

 cfh 

 On 6/14/13 17:33 , Aravindan Rs wrote: 
  Thanks - I assume you are talking about the change from class 
  Reference(int) to class Reference(long). Should work I think. 
  Btw: This fix was done quite some time ago (on Jan 1st 2013 - 
  
 https://github.com/web2py/web2py/commit/dd3055836a3f8fbc5b06763710c369cab3f3fc40)
  

  - so patch might not be necessary. I'll move to latest web2py and check. 
  
  Thanks again, 
  Aravind. 
  
  
  On Friday, 14 June 2013 20:16:41 UTC+5:30, Christian Foster Howes wrote: 
  
  Aravind, 
  
  I see that in trunk (and perhaps the latest web2py release) i think 
 that 
  this has been fixed.  Please make sure you are using the latest web2py 
  version.  I'm working on upgrading to the latest web2py version and 
 then 
  the latest GAE SDK to get things working for me.  There may be some 
 patches 
  coming, hopefully later today 
  
  cfh 
  
  On Thursday, June 13, 2013 2:15:46 AM UTC-7, Aravindan Rs wrote: 
  
  Hi, 
  
  I get the following error stack on login / logout when session object 
 is 
  attempted to be written to the database: 
  
  Traceback (most recent call last): 
 File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py, 
 line 551, in wsgibase 
   session._try_store_in_db(request, response) 
 File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py, 
 line 728, in _try_store_in_db 
   record_id = table.insert(**dd) 
 File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
 line 7806, in insert 
   ret =  self._db._adapter.insert(self,self._listify(fields)) 
 File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
 line 4618, in insert 
   rid = Reference(tmp.key().id()) 
  OverflowError: Python int too large to convert to C long 
  
  
  
  I'm using Google App Engine - with python 2.7 and web2py. 
  
  I have one version of application which was deployed yesterday - this 
 is 
  still working (i.e. no such errors during login/logout). I deploy the 
 same 
  code today and it does not work. This morning google sent a release 
  announcement for google app engine 1.8.1. The change was related to 
  scattered auto ID (64 bits). I'm guessing my problem could be due app 
  engine change. 
  
  Are others facing similar problem? Any known solutions? 
  
  Warm Regards, 
  Aravind. 
  
  
  
  


-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Error writing to session with latest Google App Engine 1.8.1

2013-06-14 Thread Aravindan Rs
Thanks - I assume you are talking about the change from class 
Reference(int) to class Reference(long). Should work I think.
Btw: This fix was done quite some time ago (on Jan 1st 2013 - 
https://github.com/web2py/web2py/commit/dd3055836a3f8fbc5b06763710c369cab3f3fc40)
 
- so patch might not be necessary. I'll move to latest web2py and check.

Thanks again,
Aravind.


On Friday, 14 June 2013 20:16:41 UTC+5:30, Christian Foster Howes wrote:

 Aravind,

 I see that in trunk (and perhaps the latest web2py release) i think that 
 this has been fixed.  Please make sure you are using the latest web2py 
 version.  I'm working on upgrading to the latest web2py version and then 
 the latest GAE SDK to get things working for me.  There may be some patches 
 coming, hopefully later today

 cfh

 On Thursday, June 13, 2013 2:15:46 AM UTC-7, Aravindan Rs wrote:

 Hi,

 I get the following error stack on login / logout when session object is 
 attempted to be written to the database:

 Traceback (most recent call last):
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py, 
 line 551, in wsgibase
 session._try_store_in_db(request, response)
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py, 
 line 728, in _try_store_in_db
 record_id = table.insert(**dd)
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
 line 7806, in insert
 ret =  self._db._adapter.insert(self,self._listify(fields))
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
 line 4618, in insert
 rid = Reference(tmp.key().id())
 OverflowError: Python int too large to convert to C long



 I'm using Google App Engine - with python 2.7 and web2py.

 I have one version of application which was deployed yesterday - this is 
 still working (i.e. no such errors during login/logout). I deploy the same 
 code today and it does not work. This morning google sent a release 
 announcement for google app engine 1.8.1. The change was related to 
 scattered auto ID (64 bits). I'm guessing my problem could be due app 
 engine change.

 Are others facing similar problem? Any known solutions?

 Warm Regards,
 Aravind.




-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Google App Engine - with python 2.7 and web2py. My application suddenly stopped working from yesterd

2013-06-14 Thread Aravindan Rs
see thread 
https://groups.google.com/forum/?fromgroups=#!searchin/web2py/1.8.1/web2py/jT3djFSBxQw/VhRA_D46EAEJ

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Google App Engine - with python 2.7 and web2py. My application suddenly stopped working from yesterd

2013-06-14 Thread Aravindan Rs
see thread 
https://groups.google.com/forum/?fromgroups=#!searchin/web2py/1.8.1/web2py/jT3djFSBxQw/VhRA_D46EAEJ

On Friday, 14 June 2013 12:52:35 UTC+5:30, Mukesh wrote:

 Dear team,

 I'm using Google App Engine - with python 2.7 and web2py. My application 
 suddenly stopped working from yesterday to today. I deployed the 
 application today (June14, 2013) and I get the error OverflowError: Python 
 int too large to convert to C long when web2py code tries to store id() 
 from DB entity into a int variable. As web2py DB read/write is central to 
 my application almost nothing works.

  The last version of application deployed yesterday is working. The same 
 code deployed today does not work.

  Is the problem related to the change to 1.8.1 where scattered auto id is 
 the default?Call stack of failure (when web2py tries to write session 
 object into database):

 Traceback (most recent call last):

  

   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py, 
 line 551, in wsgibase

 session._try_store_in_db(request, response)

   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py, 
 line 728, in _try_store_in_db

 record_id = table.insert(**dd)

   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
 line 7806, in insert

 ret =  self._db._adapter.insert(self,self._listify(fields))

   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
 line 4618, in insert

 rid = Reference(tmp.key().id())

 OverflowError: Python int too large to convert to C long

  

 While accessing application getting below error after  deployment, the 
 application was working fine previously.

  

 I have performed below steps successfully:

 -  Deployment on sand box and testing

 -  Deployment on GAE

  

 Kindly suggest what changes are required at configuration leavel, so that 
 I will be able to access the application


-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Error writing to session with latest Google App Engine 1.8.1

2013-06-13 Thread Aravindan Rs
Hi,

I get the following error stack on login / logout when session object is 
attempted to be written to the database:

Traceback (most recent call last):
  File 
/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py, line 
551, in wsgibase
session._try_store_in_db(request, response)
  File 
/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py, 
line 728, in _try_store_in_db
record_id = table.insert(**dd)
  File /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
line 7806, in insert
ret =  self._db._adapter.insert(self,self._listify(fields))
  File /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, 
line 4618, in insert
rid = Reference(tmp.key().id())
OverflowError: Python int too large to convert to C long



I'm using Google App Engine - with python 2.7 and web2py.

I have one version of application which was deployed yesterday - this is 
still working (i.e. no such errors during login/logout). I deploy the same 
code today and it does not work. This morning google sent a release 
announcement for google app engine 1.8.1. The change was related to 
scattered auto ID (64 bits). I'm guessing my problem could be due app 
engine change.

Are others facing similar problem? Any known solutions?

Warm Regards,
Aravind.


-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Error writing to session with latest Google App Engine 1.8.1

2013-06-13 Thread Aravindan Rs
Adding the following line in the app.yaml solves the issue:
auto_id_policy: legacy

This changes the ID generation from scattered to legacy mode (I assume 
sequential?). I presume the number returned by GAE_DB_Entity.id() is of 
smaller size and the exception does not occur anymore.

But when I read GAE documentation, there is a statement that legacy mode 
will not be supported in future - so web2py needs to find a solution to 
this problem. 

Should I raise a ticket for this issue?

Are there impacts to application code which does not directly use any GAE 
code?

Br,
Aravind.


On Thursday, 13 June 2013 14:45:46 UTC+5:30, Aravindan Rs wrote:

 Hi,

 I get the following error stack on login / logout when session object is 
 attempted to be written to the database:

 Traceback (most recent call last):
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py, 
 line 551, in wsgibase
 session._try_store_in_db(request, response)
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py, 
 line 728, in _try_store_in_db
 record_id = table.insert(**dd)
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, line 
 7806, in insert
 ret =  self._db._adapter.insert(self,self._listify(fields))
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, line 
 4618, in insert
 rid = Reference(tmp.key().id())
 OverflowError: Python int too large to convert to C long



 I'm using Google App Engine - with python 2.7 and web2py.

 I have one version of application which was deployed yesterday - this is 
 still working (i.e. no such errors during login/logout). I deploy the same 
 code today and it does not work. This morning google sent a release 
 announcement for google app engine 1.8.1. The change was related to 
 scattered auto ID (64 bits). I'm guessing my problem could be due app 
 engine change.

 Are others facing similar problem? Any known solutions?

 Warm Regards,
 Aravind.




-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Session object gets written even when there is no change in the content

2013-06-11 Thread Aravindan Rs
Hi,

We use web2py in GAE environment and during our performance tuning we 
realized that session objects are getting written in every request - even 
in requests which do not modify the session object. I raised an issue 
regarding this in the web2py issue tracker where I've provided details (
https://code.google.com/p/web2py/issues/detail?id=1524). After some 
debugging I realized that actual session object does not change but the 
pickled string changes each time (e.g. order of items is not guaranteed in 
a dictionary) resulting is different hash each time which in turn results 
in the object being written to DB each time.

Most of my requests does not write to the session object - still every 
request results in write to session table. This impacts my system 
performance adversely + incurs higher cost as GAE charges for every DB 
read/write.

I think it is a difficult problem for web2py to solve - I assume I have to 
find a workaround in my code.

I'm thinking of using session.forget() in the right places. I know the code 
places where I write to session object. I assume web2py code writes to 
session object in login, logout and possibly few other authentication 
related flows. Are there other places to take care of? 

Is there a more elegant solution to my problem?

Thanks and regards,
Aravind.

PS: Though one can implement the above solution with just forget method - 
I would have loved also to have unforget method - I could have simply 
said forget() in one of the model files and unforget() in every place there 
is write to session object. 

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Session object gets written even when there is no change in the content

2013-06-11 Thread Aravindan Rs
You can find the issue at 
https://code.google.com/p/web2py/issues/detail?id=1524


On Wednesday, 12 June 2013 04:35:48 UTC+5:30, Massimo Di Pierro wrote:

 Can you please open a ticket about this. We'll need to think about this 
 and we do not want to forget.

 On Tuesday, 11 June 2013 16:47:08 UTC-5, Niphlod wrote:

 @derek : request.now is just a field that represents the row that needs 
 to go to the db. is then either inserted or updated accordingly to the 
 record_id found (more precisely, it tries to update and then if no updates 
 are detected it inserts it). at the beginning of the try_store_whatever 
 there's the self._unchanged() check, that is the one producing the issue.

 @massimo and devs: apparently this is not solvable empirically basing our 
 unchanged check on the hash of the pickled string (even if deepcopying 
 seems to return consistent behaviour). Given that the pickle docs doesn't 
 assure that consistent strings are generated, I think the only way is to 
 create a slightly different implementation of Storage for session (or just 
 change the Storage implementation) to keep a record of the Storage actually 
 being changed. If I'm not mistaken, it's a dict, so every call to
 __setitem__
 __delitem__
 pop (if key exists)
 setdefault (if key does not exists)
 update
 clear ?
 to the underlying dict needs to flip a something (boolean) that gets 
 checked in the _unchanged() function.

 On Tuesday, June 11, 2013 11:14:06 PM UTC+2, Niphlod wrote:

 apparently the issue (i.e. different strings can be generated for the 
 same object) is documented at 
 http://docs.python.org/2/library/pickle.html#id10




-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Load testing Web2py application under GAE using gatling: session cookie is not recogonized

2013-04-25 Thread Aravindan Rs
I raised the issue https://code.google.com/p/web2py/issues/detail?id=1462

Thanks and warm regards,
Aravindan.

On Wednesday, 24 April 2013 09:54:01 UTC+5:30, Massimo Di Pierro wrote:

 This is reasonable request and we may be able to accommodate it. Please 
 open a ticket on google code.

 http://code.google.com/p/web2py/issues/

 so it gets tracked.

 On Tuesday, 23 April 2013 21:06:08 UTC-5, Aravindan Rs wrote:

 Hello,

 I have deployed my web2py application on Google app engine. I'm trying to 
 use Gatling (http://gatling-tool.org/) for load testing my web 
 application. Just accessing my home page (which is a static page with a few 
 images and links) exhausts my free quota of DB write operations per day. 

 On further debugging I realized that each request was creating a new 
 session record in the table web2py_session_appname table. 

 Investigating the HTTP request and response traces from my Gatling 
 client, I see that the client is setting the Cookie parameter 
 (session_id_appname) correctly in the request - same as the one sent by 
 my web2py app in the Set-Cookie parameter of the last response. The 
 SetCookie value sent back by server is enclosed in double quote (). The 
 Cookie sent from client also contains double quote. 

 The code in gluons/globals.py tries to parse the cookie value using 
 below line of code:

 (record_id, unique_key) = response.session_id.split(':')

 The record_id now contains a double quote - so the record is not found in 
 db and a new session record is created each time.

 *I privately modified the globals.py code to use underscore ('_') 
 instead of colon (':') as delimiter in the session cookie - the cookie no 
 more contains double quote and the problem is solved.*

 Please note that this problem is faced only when I use gatling; using 
 normal browsers (chrome, FF, IE) does not result is new session record 
 created each time. I think the problem is due to the way gatling is 
 handling double quote in as part of cookie value. Also when I test with my 
 local web2py instance with gatling, the problem is not faced as session 
 cookies which are stored as files in file system does not contain ':' and 
 hence no double quoting.

 I don't see yet a way to modify gatling. 

 *My question to web2py community:*
 Do you see it as a fair request to change the delimiter used in DB 
 session cookies from ':' to something else (e.g. _) so that cookies are not 
 double quoted - this will accommodate also clients which know only to 
 handle 'cookie version 0'.

 If this is an acceptable change, where should raise my request / 
 contribute my changes?

 Thanks and warm regards,
 Aravindan.



-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Load testing Web2py application under GAE using gatling: session cookie is not recogonized

2013-04-23 Thread Aravindan Rs
Hello,

I have deployed my web2py application on Google app engine. I'm trying to 
use Gatling (http://gatling-tool.org/) for load testing my web application. 
Just accessing my home page (which is a static page with a few images and 
links) exhausts my free quota of DB write operations per day. 

On further debugging I realized that each request was creating a new 
session record in the table web2py_session_appname table. 

Investigating the HTTP request and response traces from my Gatling client, 
I see that the client is setting the Cookie parameter 
(session_id_appname) correctly in the request - same as the one sent by 
my web2py app in the Set-Cookie parameter of the last response. The 
SetCookie value sent back by server is enclosed in double quote (). The 
Cookie sent from client also contains double quote. 

The code in gluons/globals.py tries to parse the cookie value using below 
line of code:

(record_id, unique_key) = response.session_id.split(':')

The record_id now contains a double quote - so the record is not found in 
db and a new session record is created each time.

*I privately modified the globals.py code to use underscore ('_') instead 
of colon (':') as delimiter in the session cookie - the cookie no more 
contains double quote and the problem is solved.*

Please note that this problem is faced only when I use gatling; using 
normal browsers (chrome, FF, IE) does not result is new session record 
created each time. I think the problem is due to the way gatling is 
handling double quote in as part of cookie value. Also when I test with my 
local web2py instance with gatling, the problem is not faced as session 
cookies which are stored as files in file system does not contain ':' and 
hence no double quoting.

I don't see yet a way to modify gatling. 

*My question to web2py community:*
Do you see it as a fair request to change the delimiter used in DB session 
cookies from ':' to something else (e.g. _) so that cookies are not double 
quoted - this will accommodate also clients which know only to handle 
'cookie version 0'.

If this is an acceptable change, where should raise my request / contribute 
my changes?

Thanks and warm regards,
Aravindan.

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.