boxkite / ckanext-donneesqctheme

0 stars 0 forks source link

Error report, resource view - table #38

Closed deniszgonjanin closed 9 years ago

deniszgonjanin commented 9 years ago
[Wed Apr 15 19:11:34.585633 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] Error - <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\\ufeff' in position 851: ordinal not in range(128)
[Wed Apr 15 19:11:34.586545 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] URL: http://donneesqcsb.dcats.ca/dataset/ville-de-gatineau-district-electoral/resource/7506d04a-0418-44e0-8ae2-cb95569a1dc6/edit_view/1eb6642c-e588-4055-bd55-eac1e18dc8e7
[Wed Apr 15 19:11:34.586550 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/weberror/errormiddleware.py', line 162 in __call__
[Wed Apr 15 19:11:34.586552 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   app_iter = self.application(environ, sr_checker)
[Wed Apr 15 19:11:34.586553 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Wed Apr 15 19:11:34.586554 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   resp = self.call_func(req, *args, **self.kwargs)
[Wed Apr 15 19:11:34.586555 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Wed Apr 15 19:11:34.586568 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return self.func(req, *args, **kwargs)
[Wed Apr 15 19:11:34.586569 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/fanstatic/publisher.py', line 234 in __call__
[Wed Apr 15 19:11:34.586570 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return request.get_response(self.app)
[Wed Apr 15 19:11:34.586571 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Wed Apr 15 19:11:34.586572 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   application, catch_exc_info=False)
[Wed Apr 15 19:11:34.586573 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Wed Apr 15 19:11:34.586574 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   app_iter = application(self.environ, start_response)
[Wed Apr 15 19:11:34.586575 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Wed Apr 15 19:11:34.586576 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   resp = self.call_func(req, *args, **self.kwargs)
[Wed Apr 15 19:11:34.586577 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/dec.py', line 208 in call_func
[Wed Apr 15 19:11:34.586579 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return self.func(req, *args, **kwargs)
[Wed Apr 15 19:11:34.586579 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/fanstatic/injector.py', line 54 in __call__
[Wed Apr 15 19:11:34.586580 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   response = request.get_response(self.app)
[Wed Apr 15 19:11:34.586581 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/request.py', line 1053 in get_response
[Wed Apr 15 19:11:34.586582 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   application, catch_exc_info=False)
[Wed Apr 15 19:11:34.586583 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/webob/request.py', line 1022 in call_application
[Wed Apr 15 19:11:34.586589 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   app_iter = application(self.environ, start_response)
[Wed Apr 15 19:11:34.586590 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/beaker/middleware.py', line 73 in __call__
[Wed Apr 15 19:11:34.586591 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return self.app(environ, start_response)
[Wed Apr 15 19:11:34.586592 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/beaker/middleware.py', line 155 in __call__
[Wed Apr 15 19:11:34.586593 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return self.wrap_app(environ, session_start_response)
[Wed Apr 15 19:11:34.586597 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/routes/middleware.py', line 131 in __call__
[Wed Apr 15 19:11:34.586598 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   response = self.app(environ, start_response)
[Wed Apr 15 19:11:34.586599 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/wsgiapp.py', line 125 in __call__
[Wed Apr 15 19:11:34.586600 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   response = self.dispatch(controller, environ, start_response)
[Wed Apr 15 19:11:34.586602 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/wsgiapp.py', line 324 in dispatch
[Wed Apr 15 19:11:34.586603 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return controller(environ, start_response)
[Wed Apr 15 19:11:34.586605 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 338 in __call__
[Wed Apr 15 19:11:34.586606 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   res = WSGIController.__call__(self, environ, start_response)
[Wed Apr 15 19:11:34.586607 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/controllers/core.py', line 221 in __call__
[Wed Apr 15 19:11:34.586609 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   response = self._dispatch_call()
[Wed Apr 15 19:11:34.586610 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/controllers/core.py', line 172 in _dispatch_call
[Wed Apr 15 19:11:34.586612 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   response = self._inspect_call(func)
[Wed Apr 15 19:11:34.586613 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/controllers/core.py', line 107 in _inspect_call
[Wed Apr 15 19:11:34.586615 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   result = self._perform_call(func, args)
[Wed Apr 15 19:11:34.586616 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/controllers/core.py', line 60 in _perform_call
[Wed Apr 15 19:11:34.586619 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return func(**args)
[Wed Apr 15 19:11:34.586620 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/controllers/package.py', line 1572 in edit_view
[Wed Apr 15 19:11:34.586622 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return render('package/edit_view.html', extra_vars=vars)
[Wed Apr 15 19:11:34.586623 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 217 in render
[Wed Apr 15 19:11:34.586625 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   loader_class=loader_class)
[Wed Apr 15 19:11:34.586626 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/templating.py', line 249 in cached_template
[Wed Apr 15 19:11:34.586628 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return render_func()
[Wed Apr 15 19:11:34.586630 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 155 in render_template
[Wed Apr 15 19:11:34.586632 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return render_jinja2(template_name, globs)
[Wed Apr 15 19:11:34.586633 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 104 in render_jinja2
[Wed Apr 15 19:11:34.586635 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return template.render(**extra_vars)
[Wed Apr 15 19:11:34.586636 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/jinja2/environment.py', line 894 in render
[Wed Apr 15 19:11:34.586638 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return self.environment.handle_exception(exc_info, True)
[Wed Apr 15 19:11:34.586639 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/edit_view.html', line 1 in top-level template code
[Wed Apr 15 19:11:34.586642 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% extends "package/view_edit_base.html" %}
[Wed Apr 15 19:11:34.586643 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/view_edit_base.html', line 4 in top-level template code
[Wed Apr 15 19:11:34.586645 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% set res = c.resource %}
[Wed Apr 15 19:11:34.586646 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/resource_edit_base.html', line 4 in top-level template code
[Wed Apr 15 19:11:34.586648 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% set res = c.resource %}
[Wed Apr 15 19:11:34.586650 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/base.html', line 3 in top-level template code
[Wed Apr 15 19:11:34.586651 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% set pkg = c.pkg_dict or pkg_dict %}
[Wed Apr 15 19:11:34.586653 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/page.html', line 1 in top-level template code
[Wed Apr 15 19:11:34.586654 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% extends "base.html" %}
[Wed Apr 15 19:11:34.586656 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckanext-donneesqctheme/ckanext/donneesqctheme/templates/base.html', line 1 in top-level template code
[Wed Apr 15 19:11:34.586657 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% ckan_extends %}
[Wed Apr 15 19:11:34.586659 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckanext-harvest/ckanext/harvest/templates_new/base.html', line 1 in top-level template code
[Wed Apr 15 19:11:34.586660 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% ckan_extends %}
[Wed Apr 15 19:11:34.586663 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckanext-googleanalytics/ckanext/googleanalytics/templates/base.html', line 1 in top-level template code
[Wed Apr 15 19:11:34.586664 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% ckan_extends %}
[Wed Apr 15 19:11:34.586666 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/base.html', line 103 in top-level template code
[Wed Apr 15 19:11:34.586667 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {%- block page %}{% endblock -%}
[Wed Apr 15 19:11:34.586669 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/page.html', line 19 in block "page"
[Wed Apr 15 19:11:34.586670 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {%- block content %}
[Wed Apr 15 19:11:34.586672 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/page.html', line 22 in block "content"
[Wed Apr 15 19:11:34.586673 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% block main_content %}
[Wed Apr 15 19:11:34.586676 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/view_edit_base.html', line 30 in block "main_content"
[Wed Apr 15 19:11:34.586677 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {{ super() }}
[Wed Apr 15 19:11:34.586678 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/page.html', line 57 in block "main_content"
[Wed Apr 15 19:11:34.586680 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% block primary %}
[Wed Apr 15 19:11:34.586681 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/page.html', line 70 in block "primary"
[Wed Apr 15 19:11:34.586683 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% block primary_content %}
[Wed Apr 15 19:11:34.586685 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/page.html', line 90 in block "primary_content"
[Wed Apr 15 19:11:34.586686 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% block primary_content_inner %}
[Wed Apr 15 19:11:34.586688 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/view_edit_base.html', line 19 in block "primary_content_inner"
[Wed Apr 15 19:11:34.586689 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% block form %}{% endblock %}
[Wed Apr 15 19:11:34.586691 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/edit_view.html', line 17 in block "form"
[Wed Apr 15 19:11:34.586692 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% include 'package/snippets/view_form.html' %}
[Wed Apr 15 19:11:34.586694 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/snippets/view_form.html', line 12 in top-level template code
[Wed Apr 15 19:11:34.586695 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% block view_form_filters %}
[Wed Apr 15 19:11:34.586697 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/snippets/view_form.html', line 13 in block "view_form_filters"
[Wed Apr 15 19:11:34.586698 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   {% snippet 'package/snippets/view_form_filters.html', resource=resource, resource_view=resource_view %}
[Wed Apr 15 19:11:34.586700 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/jinja_extensions.py', line 255 in _call
[Wed Apr 15 19:11:34.586702 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return base.render_snippet(args[0], **kwargs)
[Wed Apr 15 19:11:34.586703 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 79 in render_snippet
[Wed Apr 15 19:11:34.586705 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   renderer='snippet')
[Wed Apr 15 19:11:34.586706 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 217 in render
[Wed Apr 15 19:11:34.586707 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   loader_class=loader_class)
[Wed Apr 15 19:11:34.586709 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/pylons/templating.py', line 249 in cached_template
[Wed Apr 15 19:11:34.586710 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return render_func()
[Wed Apr 15 19:11:34.586712 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 155 in render_template
[Wed Apr 15 19:11:34.586713 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return render_jinja2(template_name, globs)
[Wed Apr 15 19:11:34.586715 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/base.py', line 104 in render_jinja2
[Wed Apr 15 19:11:34.586716 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return template.render(**extra_vars)
[Wed Apr 15 19:11:34.586719 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/usr/lib/ckan/lib/python2.7/site-packages/jinja2/environment.py', line 894 in render
[Wed Apr 15 19:11:34.586720 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return self.environment.handle_exception(exc_info, True)
[Wed Apr 15 19:11:34.586722 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/templates/package/snippets/view_form_filters.html', line 39 in top-level template code
[Wed Apr 15 19:11:34.586723 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   data-module-template-filter-inputs = "{{ h.remove_linebreaks(templateFilterInputs) }}"
[Wed Apr 15 19:11:34.586725 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] File '/project/ckan/ckan/lib/helpers.py', line 1806 in remove_linebreaks
[Wed Apr 15 19:11:34.586727 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449]   return str(string).replace('\\n', '')
[Wed Apr 15 19:11:34.586728 2015] [:error] [pid 12:tid 140696205047552] [remote 172.17.42.1:25449] UnicodeEncodeError: 'ascii' codec can't encode character u'\\ufeff' in position 851: ordinal not in range(128)
Hoedic commented 9 years ago

The issue seems to be in the "add filter" feature of the edit view page. CKAN seem to analyze the file in order to propose filters and it fails in some occurrences with the provided CSV is encoded in utf-8 with BOM.

Here are the 2 same files, the no_bomworks fine, while the with_bom triggers the error: https://drive.google.com/folderview?id=0B7gAVbY0-eHrflZ6a0dUbVNEVzZKNkJDdFZCN2t0ak9YdWs0UzJHSUR6RUJDOGN3X1lVbm8&usp=sharing

When overriding view_form_filters.html with an empty file, the error does not occur anymore.

Hoedic commented 9 years ago

Moved to the official ckan issue tracker https://github.com/ckan/ckan/issues/2401