Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error parsing extra details in some startup config files #429

Closed
fmigneault opened this issue May 5, 2021 · 0 comments · Fixed by #430
Closed

[BUG] Error parsing extra details in some startup config files #429

fmigneault opened this issue May 5, 2021 · 0 comments · Fixed by #430
Assignees
Labels
bug Problem, error, or invalid behaviour

Comments

@fmigneault
Copy link
Collaborator

Describe the bug

Config format is incorrectly parsed (list of dict instead of directly the dict) when additional sections are provided specifically in permissions.cfg or providers.cfg files. This doesn't seem to be the case in config.yml files, but should be validated with corresponding tests.

To Reproduce
Steps to reproduce the behavior:

  1. Load permissions.cfg file that has both permissions and another section (eg: users)
  2. Error logged

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • Version: seen in 3.8, but could be anything before.

Additional Details

Traceback (most recent call last):
  File "/usr/local/bin/gunicorn", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 61, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 223, in run
    super(Application, self).run()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 60, in __init__
    self.setup(app)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 120, in setup
    self.app.wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 50, in load
    return self.load_pasteapp()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 46, in load_pasteapp
    return load_pasteapp(self.cfgurl, self.relpath, global_conf=self.cfg.paste_global_conf)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/pasterapp.py", line 71, in load_pasteapp
    global_conf=global_conf)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 253, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 278, in loadobj
    return context.create()
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 150, in invoke
    **context.local_conf)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/usr/local/lib/python3.7/site-packages/paste/urlmap.py", line 31, in urlmap_factory
    app = loader.get_app(app_name, global_conf=global_conf)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 356, in get_app
    name=name, global_conf=global_conf).create()
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 235, in invoke
    filtered = context.next_context.create()
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 715, in create
    return self.object_type.invoke(self)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/loadwsgi.py", line 152, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/usr/local/lib/python3.7/site-packages/paste/deploy/util.py", line 55, in fix_call
    val = callable(*args, **kw)
  File "/opt/local/src/magpie/magpie/app.py", line 75, in main
    magpie_register_permissions_from_config(perm_cfg, db_session=db_session)
  File "/opt/local/src/magpie/magpie/register.py", line 944, in magpie_register_permissions_from_config
    _process_permissions(perms, magpie_url, cookies_or_session, users, groups)
  File "/opt/local/src/magpie/magpie/register.py", line 974, in _process_permissions
    users_conf = _make_config_registry(users, "username")
  File "/opt/local/src/magpie/magpie/register.py", line 959, in _make_config_registry
    cfg_key = cfg.get(key, None)
AttributeError: 'list' object has no attribute 'get'

using this config
bird-house/birdhouse-deploy@6bd69b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem, error, or invalid behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant