+index/all yields traceback or Internal Server Error

Issue #569 resolved
Roger Haase
created an issue

+index/all, prior to the fix for #567, had incorrectly used the ACLs for the default namespace for all existing namespaces. With the fix applied, it now yields a traceback on the terminal console.

[2017-07-02 13:04:52,479] ERROR in app: Exception on /+index/all [GET]
Traceback (most recent call last):
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask\app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask\app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask\app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask\app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask\app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "c:\bitbucket\moin2\MoinMoin\apps\frontend\views.py", line 984, in index
    ns_len=ns_len,
  File "c:\bitbucket\moin2\MoinMoin\themes\__init__.py", line 55, in render_template
    return render_theme_template(get_current_theme(), template, **context)
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask_themes\__init__.py", line 448, in render_theme_template
    return render_template(template_name, **context)
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask\templating.py", line 134, in render_template
    context, ctx.app)
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\flask\templating.py", line 116, in _render
    rv = template.render(context)
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\jinja2\environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "c:\bitbucket\moin2\MoinMoin\templates\index.html", line 3, in top-level template code
    {% import theme("itemviews.html") as itemviews with context %}
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\jinja2\environment.py", line 1073, in make_module
    return TemplateModule(self, self.new_context(vars, shared, locals))
  File "c:\bitbucket\moin2-venv-python\lib\site-packages\jinja2\environment.py", line 1152, in __init__
    body_stream = list(template.root_render_func(context))

  File "c:\bitbucket\moin2\MoinMoin\templates\itemviews.html", line 23, in top-level template code
    {%- if endpoint == 'frontend.modify_item' and user.may.write(fqname) %}
  File "c:\bitbucket\moin2\MoinMoin\security\__init__.py", line 91, in <lambda>
    return lambda itemname: flaskg.storage.may(itemname, attr, usernames=self.names)
  File "c:\bitbucket\moin2\MoinMoin\storage\middleware\protecting.py", line 201, in may
    allowed = item.allows(capability, user_names=usernames)
  File "c:\bitbucket\moin2\MoinMoin\storage\middleware\protecting.py", line 278, in allows
    acl_cfg = self.protector._get_configured_acls(self.item.fqname)
  File "c:\bitbucket\moin2\MoinMoin\storage\middleware\protecting.py", line 98, in _get_configured_acls
    raise ValueError('No acl_mapping entry found for item {0!r}'.format(fqname))
ValueError: No acl_mapping entry found for item CompositeName(namespace=u'all', field=u'name_exact', value=u'')
2017-07-02 13:04:52,519 INFO werkzeug:87 127.0.0.1 "GET /+index/all HTTP/1.1" 500 -

Comments (1)

  1. Log in to comment