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

Internal Server Error when duplicate options in LXC config file (With is legal in LXC) #12

Open
rkkoszewski opened this issue Jan 5, 2019 · 1 comment

Comments

@rkkoszewski
Copy link

Hi,
Seems like this version of LXC-Web-Panel doesn't support having duplicate keys in the LXC config file. Having duplicate keys are completely legal in LXC and all options are read properly (Even if duplicate).

One frequent case is when you want to mount multiple things, you're repeatedly using "lxc.mount.entry".

But right now if you have multiple mount points in the LXC configuration, the whole LXC-Web-Panel breaks after logging in.

The exception says:

[2019-01-05 17:38:36,444] ERROR in app: Exception on /home [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.5/dist-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.5/dist-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.5/dist-packages/Flask-1.0.2-py3.5.egg/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.5/dist-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.5/dist-packages/Flask-1.0.2-py3.5.egg/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.5/dist-packages/lwp-0.10b1-py3.5.egg/lwp/utils.py", line 96, in new_handler
    return handler(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/lwp-0.10b1-py3.5.egg/lwp/views/main.py", line 49, in home
    'settings': lwp.get_container_settings(container, status),
  File "/usr/local/lib/python3.5/dist-packages/lwp-0.10b1-py3.5.egg/lwp/__init__.py", line 233, in get_container_settings
    config.readfp(normalized)
  File "/usr/lib/python3.5/configparser.py", line 760, in readfp
    self.read_file(fp, source=filename)
  File "/usr/lib/python3.5/configparser.py", line 715, in read_file
    self._read(f, source)
  File "/usr/lib/python3.5/configparser.py", line 1089, in _read
    fpname, lineno)
configparser.DuplicateOptionError: While reading from '<???>' [line 28]: option 'lxc.mount.entry' in section 'DEFAULT' already exists
@n3storm
Copy link

n3storm commented Jan 28, 2019

You are right, have you fixed this?

I think I did by replacing configparser library with another, but not sure yet.

We are open to pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants