Looked at all the data I would ever send or use in the system and I
don't see any pickles. I only use them in the messages I am sending and
then unpickle them as soon as they get to me. I can't imagine were else
it could be as I don't play with any funny objects or persistent items.
Additionally, the updates only happen every 2 seconds. I will get good,
bad, then good data in those times. I don't make a request everytime
there is a refresh. The request is every 2 seconds. I will do more
tests, but if anything else comes to mind, I certainly need your help.
Web2py would then become useless in this situation and I would end up
haivng to rebuild a year of code in something else.
....):
Jason Brower
On 10/04/2010 06:25 PM, Jason Brower wrote:
Interesting... I will look into it. I was trying to avoid something
like this so perhaps the object was thrown in there deep in some
dictionary or something. Thanks for the help. I will report back
tomorrow.
On 10/04/2010 06:24 PM, mdipierro wrote:
The issue is not you picklying. The issue is you storing in the
session something the web2py can pickle but not unpickle, like an
object of a class defined in a module that you define or import.
On Oct 4, 10:18 am, Jason Brower<[email protected]> wrote:
I will look if I am picling anything, but if I remember, I am only
pickling things AFTER I started seeing this bug. Though I think you
pickling in the application if I am not mistaken.
What would you like next?
Best Regards,
Jason Brower
On 10/04/2010 04:44 PM, mdipierro wrote:
Not sure but here
request.session_id: None
response.session_id: 127-0-0-1-3bf56311-2bf8-454d-9772-5825e8533348
insecure string pickle
insecure string pickle
insecure string pickle
insecure string pickle
insecure string pickle
insecure string pickle
insecure string pickle
insecure string pickle
time in controller: 1286173614.93
session keys: ['_formkey[default]', 'auth']
request.session_id: None
response.session_id: 127-0-0-1-8ae576c9-83d3-49c9-9b31-0dcf7fb5b573
something bad happens. From that moment on web2py seems to issue a new
session at every request. You either do a os.chdir (not allowed) or
you store in the session an object can Python cannot unpickle back.
On Oct 4, 1:33 am, Jason Brower<[email protected]> wrote:
Attached is the print out. I still have my old debug information
there
showing when I press each key.
Thanks,
Jason Brower
On 09/29/2010 04:34 PM, mdipierro wrote:
I am going to need your help debugging this. In gluon/globals.py
if response.session_id:
try:
response.session_file = \
open(response.session_filename, 'rb+')
portalocker.lock(response.session_file,
portalocker.LOCK_EX)
self.update(cPickle.load(response.session_file))
response.session_file.seek(0)
except:
self._unlock(response)
response.session_id = None
change it to
if response.session_id:
try:
response.session_file = \
open(response.session_filename, 'rb+')
portalocker.lock(response.session_file,
portalocker.LOCK_EX)
self.update(cPickle.load(response.session_file))
response.session_file.seek(0)
except Exception, e:
print e
self._unlock(response)
response.session_id = None
what does it print?
On Sep 29, 12:14 am, Jason Brower<[email protected]> wrote:
request.session_id is always none, how ever.
BR,
Jason
On 09/28/2010 06:30 PM, mdipierro wrote:
add {{=request.session_id}} and {{=response.session_id}} my
guess is
that for some reason the browser requests a session, web2py cannot
open it, so it issues a new one.
check if the session_in in request/response and across requests is
always the same.
On Sep 28, 10:05 am, Jason Brower<[email protected]>
wrote:
There are two pages in two different controller files running.
One is automated... it executes all the session updating for the
interface. For example it tells what motor is in motion or
what sensor
was triggered. I don't have this controller function print
anything at
all. (I did have it print the data it just pulled at one point
but the
error never happened.) It simply updates a bunch of session
variables. The second function in another controller file
views that session data. I can refresh the page and it will
read the session data and display it
to the screen. This function prints data to the terminal when
ever it
is called. It prints the sorted(session.keys()) and the epoch
time. This is where the error shows. When I refresh some
times it shows the
session data other times it does not. The parts of my page in
the view
that need the session data will not work. (They are NoneType
objects.) I
use the epoch time to show when they events happened to you.
I don't
have a session.forget in my entire coded no anything that
would reset
these varialbes except for the first function I mentioned here.
Best Regards,
Jason Brower
On 09/28/2010 04:37 PM, mdipierro wrote:
Jason,
I am sorry but I do not have enough information. What do you
see in
the output that is wrong? What code produces the output?
massimo
On Sep 28, 6:16 am, Jason
Brower<[email protected]> wrote:
We had thought it at one point to be issues with the
corruption of the
file I used between the machine_server and the
web2py_server, but sadly
the issues still occurs...
I have been able to implement my machine server in twisted
with AMP
protocol builder. I have web2py picking up that data. This
is a
totally awsome setup and works very well. I can see the
data at any
time by simple requesting it.
I have 2 controller files running here...
One is running a page that refreshes a smaller one that runs
a request
to the twisted server, it instantly gets the data back and
parses it out
to the session keys you see in the attatched files.
On the second controller I have a more details information
of that
session data. It simply reads from the session keys and
prints them
nicely for the view. There is little code except when
getting a
particular item in the session dictionaries. And a small
custom form. I
personally feel these are not related at all.
In that controller's index I also have it print the
time.time() and
sorted(session.keys()) to print this debug information for
you. I was
manually refression the page to show you what happens. It's
not every
other anymore, it's rather random to me...
I can't imagine where else in my code I could be making a
mistake here.
Best Regards,
Jason Brower
error_report.txt
6KViewDownload
debug_info1.txt
27KViewDownload