Starting a few days ago, I have been receiving "execution expired" errors from Twitter on Heroku. I don't receive this error in development, but when I deploy to Heroku I get it all the time.
It seems like other people are having this issue as well. See this bug report on the Twitter gem: https://github.com/sferik/twitter/issues/401#issuecomment-21614751
(although I don't think it's actually a bug with the Twitter gem as it seems Heroku-specific...)
Any idea how to solve this issue and why it is happening?
Stacktrace (most recent call first):
Twitter::Error::ClientError: execution expired
net/http.rb in initialize at line 878
File "net/http.rb", line 878, in initialize
TCPSocket.open(conn_address, conn_port, #local_host, #local_port)
File "net/http.rb", line 878, in open
TCPSocket.open(conn_address, conn_port, #local_host, #local_port)
File "net/http.rb", line 878, in block in connect
TCPSocket.open(conn_address, conn_port, #local_host, #local_port)
File "net/http.rb", line 877, in connect
s = Timeout.timeout(#open_timeout, Net::OpenTimeout) {
File "net/http.rb", line 862, in do_start
connect
File "net/http.rb", line 851, in start
do_start
File "net/http.rb", line 1367, in request
start {
File "new_relic/agent/instrumentation/net.rb", line 33, in request_with_newrelic_trace
request_without_newrelic_trace( request, *args, &block )
File "faraday/adapter/net_http.rb", line 75, in perform_request
http.request create_request(env)
File "faraday/adapter/net_http.rb", line 38, in call
http_response = perform_request(http, env)
File "faraday/response.rb", line 8, in call
#app.call(env).on_complete do |environment|
File "faraday/response.rb", line 8, in call
#app.call(env).on_complete do |environment|
File "faraday/response.rb", line 8, in call
#app.call(env).on_complete do |environment|
File "faraday/request/url_encoded.rb", line 14, in call
#app.call env
File "faraday/request/multipart.rb", line 13, in call
#app.call env
File "twitter/request/multipart_with_file.rb", line 14, in call
#app.call(env)
File "faraday/connection.rb", line 247, in run_request
self.app.call(env)
File "faraday/connection.rb", line 112, in post
run_request(:#{method}, url, body, headers, &block)
File "twitter/client.rb", line 108, in request
connection.send(method.to_sym, path, params, &request_setup).env
File "twitter/client.rb", line 72, in post
request(:post, path, params, signature_params)
File "twitter/api/utils.rb", line 51, in objects_from_response
response = send(request_method.to_sym, path, options)[:body]
File "twitter/api/users.rb", line 260, in block in users
objects_from_response(Twitter::User, method, "/1.1/users/lookup.json", merge_users(arguments.options, users))
File "twitter/core_ext/enumerable.rb", line 5, in block (2 levels) in threaded_map
Thread.new { yield object }
Related
I can manually interact with the bot through url. For example when I send a request to api.telegram.com/bot-token/getMe
the bot's basic info is returned I even get correct results using requests library in python shell but when I try bot.get_me() in the python shell it doesn't work and says this
Traceback (most recent call last):
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\connection.py", line 140, in _new_conn
conn = connection.create_connection(
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\util\connection.py", line 83, in create_conn
ection
raise err
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\util\connection.py", line 73, in create_conn
ection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 614, in urlopen
httplib_response = self._make_request(conn, method, url,
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 360, in _make_reque
st
self._validate_conn(conn)
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 857, in _validate_c
onn
super(HTTPSConnectionPool, self)._validate_conn(conn)
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\connectionpool.py", line 289, in _validate_c
onn
conn.connect()
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\connection.py", line 284, in connect
conn = self._new_conn()
File "C:\Users\YM\AppData\Local\Programs\Python\Python38-32\lib\site-packages\
telegram\vendor\ptb_urllib3\urllib3\connection.py", line 144, in _new_conn
raise ConnectTimeoutError(
telegram.vendor.ptb_urllib3.urllib3.exceptions.ConnectTimeoutError: (<telegram.v
endor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x024257F
0>, 'Connection to api.telegram.org timed out. (connect timeout=5.0)')
Looks like you're having problems with your internet connection, i.e. the request could not be finished within the timeout of 5 seconds. Keep in mind that a lot of problems can happen unexpectedly in networking. In fact python-telegram-bot has a wiki page dedicated to that topic. Ofc you could first try to simply increase the timeout, e.g. by passing timeout=<some_value_>5> to get_me.
Unble to create EC2 Instance due to socket.getaddrinfo info
Traceback (most recent call last):
File "C:\workspace\test1\main.py", line 131, in <module>
main()
File "C:\workspace\test1\main.py", line 101, in main client =create_client()
File "C:\workspace\test1\main.py", line 19, in create_client regions= client.get_all_regions()
File "C:\Python34\lib\site-packages\boto\ec2\connection.py", line 3477, in get_all_regions[('item', RegionInfo)], verb='POST')
File "C:\Python34\lib\site-packages\boto\connection.py", line 1170, in get_list response = self.make_request(action, params, path, verb)
File "C:\Python34\lib\site-packages\boto\connection.py", line 1116, in make_request return self._mexe(http_request)
File "C:\Python34\lib\site-packages\boto\connection.py", line 1030, in _mexe raise ex
File "C:\Python34\lib\site-packages\boto\connection.py", line 943, in _mexe request.body, request.headers)
File "C:\Python34\lib\http\client.py", line 1088, in request self._send_request(method, url, body, headers)
File "C:\Python34\lib\http\client.py", line 1126, in _send_request self.endheaders(body)
File "C:\Python34\lib\http\client.py", line 1084, in endheaders self._send_output(message_body)
File "C:\Python34\lib\http\client.py", line 922, in _send_output self.send(msg)
File "C:\Python34\lib\http\client.py", line 857, in send self.connect()
File "C:\Python34\lib\site-packages\boto\https_connection.py", line 119, in connect sock = socket.create_connection((self.host, self.port), self.timeout)
File "C:\Python34\lib\socket.py", line 494, in create_connection for res in getaddrinfo(host, port, 22, SOCK_STREAM):
File "C:\Python34\lib\socket.py", line 533, in getaddrinfo for res in_socket.getaddrinfo(host, port, family, type, proto, flags):socket.gaierror: [Errno 10047] getaddrinfo failed
gaierror is related to getaddrinfo and your problem is probably due to the hostname. If not yet, you may try to change for the IP address, which doesn't need to be resolved.
If you can post details about your code, may be helpful. (I know this may be not a full answer, but I can't comment yet)
Traceback (most recent call last):
File "/opt/openerp/server/openerp/addons/connector/queue/worker.py", line 123, in run_job
job.perform(session)
File "/opt/openerp/server/openerp/addons/connector/queue/job.py", line 492, in perform
self.result = self.func(session, *self.args, **self.kwargs)
File "/opt/openerp/server/openerp/addons/magentoerpconnect/unit/import_synchronizer.py", line 378, in import_record
importer.run(magento_id, force=force)
File "/opt/openerp/server/openerp/addons/magentoerpconnect/unit/import_synchroni zer.py", line 221, in run
self._import_dependencies()
File "/opt/openerp/server/openerp/addons/magentoerpconnect/sale.py", line 849, in _import_dependencies
'magento.product.product')
File "/opt/openerp/server/openerp/addons/magentoerpconnect/unit/import_synchronizer.py", line 124, in _import_dependency
importer.run(magento_id)
File "/opt/openerp/server/openerp/addons/magentoerpconnect/unit/import_synchronizer.py", line 206, in run
self.magento_record = self._get_magento_data()
File "/opt/openerp/server/openerp/addons/magentoerpconnect/unit/import_synchronizer.py", line 63, in _get_magento_data
return self.backend_adapter.read(self.magento_id)
File "/opt/openerp/server/openerp/addons/magentoerpconnect/product.py", line 278, in read
[int(id), storeview_id, attributes, 'id'])
File "/opt/openerp/server/openerp/addons/magentoerpconnect/product.py", line 243, in _call
return super(ProductProductAdapter, self)._call(method, arguments)
File "/opt/openerp/server/openerp/addons/magentoerpconnect/unit/backend_adapter.py", line 168, in _call
result = api.call(method, arguments)
File "/usr/local/lib/python2.7/dist-packages/magento-0.4-py2.7.egg/magento/api.py", line 161, in call
return self.client.call(self.session, resource_path, arguments)
File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
raise Fault(**self._stack[0])
Fault: <Fault 3: 'Invalid api path.'>
I Am Unable To Integrated & Sync My Products From Magento To Openerp,I Have Used The CampToCamp's Add-on In The Openerp & Have Added The Module On Magento. I Have Used My Magento Server Link & Have Added Enough Test Products Yet The Products Aren't Syncing Due To The Above error As In The Jobs Tab In Openerp. Please Help Me Get Through Or Understand What Am I Doing Wrongly.
Thank You In Advance.
The problem was the integration module which was installed on my magento site didn't match the integration module on Openerp so all i needed to do was install both from the same vender and it worked like a charm.
Just remove both the integration modules from openerp & magento,& follow a single vender for me i used the following guide to get the Integration working.
https://openerp-magento-connector.readthedocs.org/en/develop/index.html
I tried to load list of AWS images using Python boto library. So my code is like
con = boto.connect_ec2(user, pasw)
con.get_all_instances()
con.get_all_images()
Problem is that, get_all_instances() works fine, but get_all_images() is not responding. When stop application from kbd, I see
File "eagle/main.py", line 102, in <module>
main(sys.argv[1:])
File "eagle/main.py", line 97, in main
return request, process_request(request)
File "eagle/main.py", line 45, in process_request
request = each().process_request(request)
File "/home/rustem/projects/eagle.2.0/eagle/../eagle/middlewares/standard.py", line 64, in process_request
request.images = con.get_all_images()
File "/home/rustem/envs/eagle.2.0/lib/python2.7/site-packages/boto/ec2/connection.py", line 171, in get_all_images
[('item', Image)], verb='POST')
File "/home/rustem/envs/eagle.2.0/lib/python2.7/site-packages/boto/connection.py", line 1063, in get_list
body = response.read()
File "/home/rustem/envs/eagle.2.0/lib/python2.7/site-packages/boto/connection.py", line 411, in read
self._cached_response = httplib.HTTPResponse.read(self)
File "/usr/lib64/python2.7/httplib.py", line 541, in read
return self._read_chunked(amt)
File "/usr/lib64/python2.7/httplib.py", line 590, in _read_chunked
value.append(self._safe_read(chunk_left))
File "/usr/lib64/python2.7/httplib.py", line 647, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
File "/usr/lib64/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib64/python2.7/ssl.py", line 241, in recv
return self.read(buflen)
File "/usr/lib64/python2.7/ssl.py", line 160, in read
return self._sslobj.read(len)
KeyboardInterrupt
It seems like Boto's function is not working, AWS API is not responding. Have anyone similar problem? Thanks.
Reason was that the get_all_images function returns all images from AWS, so it works about few minutes. I started to user filters and now it takes reasonably time.
background
So I have a Pyramis app with a whole lot of models that relate to each other in different ways. These models were initially kept in a bunch of different files according to their general roles. For example I had a file called auth_models.py that contained the definition for User and Group.
I've been battling to deal with imports and suchlike because all the model files relate to each other in such a complex way so I gave in and placed all of them in the same file. And then I updated all my import statements elsewhere so everything should work.
Now whenever I try to access any view at all I get an internal server error. It turns out that the error is caused by the fact that auth_models.py no longer exists. The error is coming from a picklie.loads statement so I figure there is some session info being loaded that is no longer working. The full error message as well as my session settings are included at the end of this question.
question
If my assumption is correct, how would I get Pyramid to 'forget' the last sessions in a safe way?
If my assumption is incorrect, what's the best way to fix this? I don't want to revert to my old directory structure because that causes it's own problems...
settings
session.type = file
session.data_dir = %(here)s/data/sessions/data
session.lock_dir = %(here)s/data/sessions/lock
session.key = ******
session.secret = *****
session.cookie_on_exception = true
session.auto = true
session.timeout = 1800
error
2013-04-08 10:24:15,642 ERROR [waitress][Dummy-2] Exception when serving /
Traceback (most recent call last):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/toolbar.py", line 122, in toolbar_tween
response = _handler(request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler
result = handler(request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/__init__.py", line 82, in tm_tween
reraise(*exc_info)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/compat.py", line 13, in reraise
raise value
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_tm-0.7-py3.3.egg/pyramid_tm/__init__.py", line 63, in tm_tween
response = handler(request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/router.py", line 161, in handle_request
response = view_callable(context, request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/config/views.py", line 345, in rendered_view
result = view(context, request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/config/views.py", line 462, in _class_requestonly_view
inst = view(request)
File "/home/sheena/WORK/mega-3.3/mega/wsgi/pyramidapp/pyramidapp/views/basic_views.py", line 10, in __init__
BaseView.__init__(self,request)
File "/home/sheena/WORK/mega-3.3/mega/wsgi/pyramidapp/pyramidapp/views/class_base_view.py", line 15, in __init__
BaseView.session_init(request)
File "/home/sheena/WORK/mega-3.3/mega/wsgi/pyramidapp/pyramidapp/views/class_base_view.py", line 62, in session_init
if not request.session.__contains__(sKey):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/decorator.py", line 39, in __get__
val = self.wrapped(inst)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/request.py", line 350, in session
return factory(self)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 204, in __init__
value = signed_deserialize(cookieval, self._secret)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 82, in signed_deserialize
return pickle.loads(pickled)
ImportError: No module named 'pyramidapp.models.auth_models'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/mako_templating.py", line 211, in __call__
result = template.render_unicode(**system)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/template.py", line 421, in render_unicode
as_unicode=True)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 767, in _render
**_kwargs_for_callable(callable_, data))
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 799, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 825, in _exec_template
callable_(context, *args, **kwargs)
File "pyramid_debugtoolbar_templates_toolbar_dbtmako", line 111, in render_body
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/panels/request_vars.py", line 42, in content
if hasattr(self.request, 'session'):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/decorator.py", line 39, in __get__
val = self.wrapped(inst)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/request.py", line 350, in session
return factory(self)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 204, in __init__
value = signed_deserialize(cookieval, self._secret)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 82, in signed_deserialize
return pickle.loads(pickled)
ImportError: No module named 'pyramidapp.models.auth_models'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/waitress-0.8.2-py3.3.egg/waitress/channel.py", line 329, in service
task.service()
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/waitress-0.8.2-py3.3.egg/waitress/task.py", line 173, in service
self.execute()
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/waitress-0.8.2-py3.3.egg/waitress/task.py", line 380, in execute
app_iter = self.channel.server.application(env, start_response)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/router.py", line 251, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/router.py", line 227, in invoke_subrequest
response = handle_request(request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/toolbar.py", line 135, in toolbar_tween
toolbar.process_response(response)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/toolbar.py", line 56, in process_response
vars, request=request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/renderers.py", line 88, in render
return helper.render(value, None, request=request)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/renderers.py", line 557, in render
result = renderer(value, system_values)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/mako_templating.py", line 219, in __call__
reraise(MakoRenderingException(errtext), None, exc_info[2])
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/compat.py", line 131, in reraise
raise value.with_traceback(tb)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/mako_templating.py", line 211, in __call__
result = template.render_unicode(**system)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/template.py", line 421, in render_unicode
as_unicode=True)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 767, in _render
**_kwargs_for_callable(callable_, data))
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 799, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 825, in _exec_template
callable_(context, *args, **kwargs)
File "pyramid_debugtoolbar_templates_toolbar_dbtmako", line 111, in render_body
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/panels/request_vars.py", line 42, in content
if hasattr(self.request, 'session'):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/decorator.py", line 39, in __get__
val = self.wrapped(inst)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/request.py", line 350, in session
return factory(self)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 204, in __init__
value = signed_deserialize(cookieval, self._secret)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 82, in signed_deserialize
return pickle.loads(pickled)
pyramid.mako_templating.MakoRenderingException:
Traceback (most recent call last):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/mako_templating.py", line 211, in __call__
result = template.render_unicode(**system)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/template.py", line 421, in render_unicode
as_unicode=True)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 767, in _render
**_kwargs_for_callable(callable_, data))
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 799, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/Mako-0.7.3-py3.3.egg/mako/runtime.py", line 825, in _exec_template
callable_(context, *args, **kwargs)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/templates/toolbar.dbtmako", line 60, in render_body
${panel.content()|n}
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid_debugtoolbar-1.0.4-py3.3.egg/pyramid_debugtoolbar/panels/request_vars.py", line 42, in content
if hasattr(self.request, 'session'):
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/decorator.py", line 39, in __get__
val = self.wrapped(inst)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/request.py", line 350, in session
return factory(self)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 204, in __init__
value = signed_deserialize(cookieval, self._secret)
File "/home/sheena/WORK/mega-3.3/lib/python3.3/site-packages/pyramid-1.4-py3.3.egg/pyramid/session.py", line 82, in signed_deserialize
return pickle.loads(pickled)
ImportError: No module named 'pyramidapp.models.auth_models'
You have stored some of your model instances in a session cookie, which uses pickle to serialize and deserialize that data.
Because you moved the model to another module, pickle can no longer load the session data.
You can do two things:
If you don't care about the session data, simply delete your session cookie. Use your browser tools to delete the cookie manually, perhaps delete all cookies for your site.
Create an alias for the model in the old location. Create a pyramidapp.models.auth_models module that simply imports the models that used to be there. This module does not need to be imported by anything else, pickle will load it for you when needed.
Any future sessions will be created with the new location of your models, this affects only old session data.