pyjobs / web

PyJobs website
MIT License
8 stars 3 forks source link

uwsgi restart needed when pyjobs_crawlers sources updated #1

Open buxx opened 8 years ago

buxx commented 8 years ago

After automatic update of pyjobs_crawlers source this error was generated if wsgi not restarted/reloaded:

Traceback (most recent call last):
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/appwrappers/transaction_manager.py", line 83, in __call__
    response = self.next_handler(controller, environ, context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/appwrappers/caching.py", line 54, in __call__
    return self.next_handler(controller, environ, context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/appwrappers/session.py", line 71, in __call__
    response = self.next_handler(controller, environ, context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/appwrappers/identity.py", line 47, in __call__
    return self.next_handler(controller, environ, context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/appwrappers/i18n.py", line 71, in __call__
    return self.next_handler(controller, environ, context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/wsgiapp.py", line 295, in dispatch
    return controller(environ, context)
  File "/srv/www/pyjobs.fr/pyjobs_web/pyjobsweb/lib/base.py", line 27, in __call__
    return TGController.__call__(self, environ, context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/controllers/dispatcher.py", line 128, in __call__
    response = self._perform_call(context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/controllers/dispatcher.py", line 109, in _perform_call
    r = self._call(func, params, remainder=remainder, context=context)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/controllers/decoratedcontroller.py", line 127, in _call
    response = self._render_response(context, controller, output)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/controllers/decoratedcontroller.py", line 237, in _render_response
    template_name=template_name, **render_params)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/render.py", line 212, in render
    kwargs['result'] = render_function(template_name, tg_vars, **kwargs)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/renderers/mako.py", line 126, in __call__
    cache_type=cache_type, cache_expire=cache_expire)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/render.py", line 278, in cached_template
    return render_func()
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/tg/renderers/mako.py", line 123, in render_template
    return Markup(template.render_unicode(**template_vars))
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/mako/template.py", line 454, in render_unicode
    as_unicode=True)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/mako/runtime.py", line 829, in _render
    **_kwargs_for_callable(callable_, data))
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/mako/runtime.py", line 864, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/srv/www/pyjobs.fr/venv2.7/lib/python2.7/site-packages/mako/runtime.py", line 890, in _exec_template
    callable_(context, *args, **kwargs)
  File "/srv/www/pyjobs.fr/pyjobs_web/data/templates/srv/www/pyjobs.fr/pyjobs_web/pyjobsweb/templates/master.mak.py", line 42, in render_body
    __M_writer(escape(self.content_wrapper()))
  File "/srv/www/pyjobs.fr/pyjobs_web/data/templates/srv/www/pyjobs.fr/pyjobs_web/pyjobsweb/templates/master.mak.py", line 192, in render_content_wrapper
    __M_writer(escape(self.body()))
  File "/srv/www/pyjobs.fr/pyjobs_web/data/templates/srv/www/pyjobs.fr/pyjobs_web/pyjobsweb/templates/jobs.mak.py", line 85, in render_body
    __M_writer(escape(sources[job.source].url))
KeyError: u'urbanlinker'
[pid: 24986|app: 0|req: 1524/12392] 109.190.10.247 () {42 vars in 883 bytes} [Thu Feb 11 09:12:55 2016] GET /?page=3 => generated 2931 bytes in 39 msecs (HTTP/1.1 500) 4 headers in 143 bytes (2 switches on core 0)
buxx commented 8 years ago

Note: sources var probably loaded at turbogear wsgi deamon start or something like that.