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.17k stars 723 forks source link

Error in accounting system. #4239

Closed heinnge closed 3 months ago

heinnge commented 3 months ago

Internal Error Stacktrace:

Error Message: Command '['sudo', '/opt/hiddify-manager/common/commander.py', 'update-wg-usage']' returned non-zero exit status 1.

Traceback (most recent call last):
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/flask/app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/flask/app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/flask_classful.py", line 303, in proxy
    response = view(**request.view_args)
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/flask_classful.py", line 271, in inner
    return fn(*args, **kwargs)
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/auth.py", line 114, in decorated_view
    return fn(*args, **kwargs)
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/panel/admin/Actions.py", line 185, in update_usage
    out_msg=f'<pre class="ltr" style="color:{color};">{json.dumps(usage.update_local_usage(),indent=2)}</pre>',
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/panel/usage.py", line 16, in update_local_usage
    res = user_driver.get_users_usage(reset=True)
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/drivers/user_driver.py", line 21, in get_users_usage
    all_usage = driver.get_all_usage(users)
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/drivers/wireguard_api.py", line 117, in get_all_usage
    all_usages = self.__sync_local_usages()
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/drivers/wireguard_api.py", line 63, in __sync_local_usages
    wg_usage = self.__get_wg_usages()
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/drivers/wireguard_api.py", line 42, in __get_wg_usages
    raw_output = commander(Command.update_wg_usage, run_in_background=False)
  File "/opt/hiddify-manager/.venv/lib/python3.10/site-packages/hiddifypanel/panel/run_commander.py", line 85, in commander
    return subprocess.check_output(base_cmd, cwd=str(current_app.config['HIDDIFY_CONFIG_PATH'])).decode()

Details:

Hiddify Version: 06-30T14:58 Python Version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] OS: Linux-5.15.0-25-generic-x86_64-with-glibc2.35 User Agent: Unknown

ReturnFI commented 3 months ago

Rebuild to Ubuntu 22.04 and install release version

heinnge commented 2 months ago

No. that doesn't solve the error.

The error lies in wg interface. it seems there are problem with wg interface.

I had to disable Wireguard in panel, and apply configs. then it works.