hiddify / Hiddify-Manager

Multi-user anti-filtering panel, with an effortless installation and supporting more than 20 protocols to circumvent filtering plus the telegram proxy.
https://hiddify.com
GNU General Public License v3.0
6.38k stars 742 forks source link

Error when editing/creating domains #3319

Closed pjrobertson closed 1 year ago

pjrobertson commented 1 year ago

Describe the bug Following error when clicking to edit/create a new domain (admin settings)

500
Oops! something went wrong. Hiddify Panel 8.6.6

Please contact info@hiddify.com with the details in this page

not enough values to unpack (expected 4, got 3)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1517, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1503, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/usr/local/lib/python3.10/dist-packages/flask_admin/base.py", line 69, in inner
    return self._run_view(f, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/flask_admin/base.py", line 368, in _run_view
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/flask_admin/model/base.py", line 2112, in create_view
    return self.render(template,
  File "/usr/local/lib/python3.10/dist-packages/flask_admin/base.py", line 308, in render
    return render_template(template, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/flask/templating.py", line 154, in render_template
    return _render(
  File "/usr/local/lib/python3.10/dist-packages/flask/templating.py", line 128, in _render
    rv = template.render(context)
  File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.10/dist-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/model/create.html", line 3, in top-level template code
    {% import 'flask-admin/adminlte/forms.html' as forms with context %}
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/master.html", line 1, in top-level template code
    {% extends admin_base_template %}
  File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/templates/flaskadmin-layout.html", line 1, in top-level template code
    {% extends 'admin-layout.html' %}
  File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/templates/admin-layout.html", line 2, in top-level template code
    {% from 'macros.html' import icon,render_nav_item %}
  File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/templates/master.html", line 76, in top-level template code
    {% block page_body %}
  File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/templates/master.html", line 108, in block 'page_body'
    {% block body %}{% endblock %}
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/model/create.html", line 18, in block 'body'
    {% block create_form %}
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/model/create.html", line 20, in block 'create_form'
    {{ forms.form(modal_name, icon, form, form_opts, return_url, has_more=True, is_modal=False) }}
  File "/usr/local/lib/python3.10/dist-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/adminlte/forms.html", line 101, in template
    {% call form_tag(action=action) %}
  File "/usr/local/lib/python3.10/dist-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/adminlte/forms.html", line 94, in template
    {{ caller() }}
  File "/usr/local/lib/python3.10/dist-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/adminlte/forms.html", line 102, in template
    <div class="{{ type }}-body">{{ form_body(form, form_opts) }}</div>
  File "/usr/local/lib/python3.10/dist-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/usr/local/lib/python3.10/dist-packages/flask_adminlte3/templates/flask-admin/adminlte/forms.html", line 38, in template
    {{ lib.render_field(form, f, kwargs) }}
  File "/usr/local/lib/python3.10/dist-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/usr/local/lib/python3.10/dist-packages/flask_admin/templates/bootstrap4/admin/lib.html", line 146, in template
    {{ field(**kwargs) | safe }}
  File "/usr/local/lib/python3.10/dist-packages/wtforms/fields/core.py", line 176, in __call__
    return self.meta.render_field(self, kwargs)
  File "/usr/local/lib/python3.10/dist-packages/wtforms/meta.py", line 64, in render_field
    return field.widget(field, **render_kw)
  File "/usr/local/lib/python3.10/dist-packages/flask_admin/form/widgets.py", line 28, in __call__
    return super(Select2Widget, self).__call__(field, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/wtforms/widgets/core.py", line 365, in __call__
    for val, label, selected, render_kw in field.iter_choices():
ValueError: not enough values to unpack (expected 4, got 3)

To Reproduce Steps to reproduce the behavior:

  1. Sest up a brand new hiddify server with Ubuntu 22.04, Amazon LightSail (1GB plan), US-west-2 location
  2. After install, set up a domain to point to the IP (e.g. my.domain.com)
  3. Go to the admin page and add the new domain my.domain.com. Leave all settings as standard
  4. Then go to Settings > Domains and delete the existing domain there (https://www.topnaz.com/ was pre-existing for me)
  5. Now, click 'Create' to try to create a new domain or 'edit' to edit the domain added in step 3
  6. See the error above.

Expected behavior Expect to be able to load the domains

Screenshots

Screen Region 2023-10-12 at 15 45 13

Additional context Fresh install. My domain (my.domain.com) was set up using Cloudflare DNS, not routed via Cloudflare.

pjrobertson commented 1 year ago

I updated hiddifypanel (8.6.7) and this issue seemed to disappear. Don't quite understand why, but closing this now since it's working