Hiddify-Manager icon indicating copy to clipboard operation
Hiddify-Manager copied to clipboard

Background commander fails to apply user changes due to missing thread argument

Open IlyaKochnev opened this issue 4 months ago • 4 comments

Description

User changes made in the panel are committed to the database, but the generated service configurations are not refreshed. For example, after deleting a user while Telemt is enabled, the deleted UUID remains in other/telegram/telemt/config.toml and Telemt continues accepting it.

The problem affects all background calls to commander(...), not only Telemt.

Root cause

hiddifypanel/panel/run_commander.py starts cmd_in_back without passing its required cmd argument:

t = threading.Thread(target=cmd_in_back, daemon=True)
t.start()

but the target is declared as:

def cmd_in_back(cmd):
    p = subprocess.Popen(cmd, cwd=str(os.environ['HIDDIFY_CONFIG_PATH']), start_new_session=True)
    p.wait()

Every background invocation therefore fails with:

TypeError: cmd_in_back() missing 1 required positional argument: 'cmd'

The caller returns success immediately, so the UI does not report the failure.

Steps to reproduce

  1. Install Hiddify Manager 12.3.3 and enable the Telemt Telegram proxy.
  2. Create a user and apply the configuration.
  3. Delete that user in the panel UI.
  4. Inspect other/telegram/telemt/config.toml.
  5. Inspect the panel/background-task error logs.

Actual result

  • The user is deleted from the panel/database.
  • The UUID remains in Telemt's generated config.toml.
  • The configuration modification time does not change.
  • Logs contain TypeError: cmd_in_back() missing 1 required positional argument: 'cmd'.

Expected result

The apply-users command should run in the background, regenerate configurations from the current database state, and apply the user change.

Proposed fix

Pass base_cmd to the thread target:

t = threading.Thread(target=cmd_in_back, args=(base_cmd,), daemon=True)

A pull request with this change will be linked below.

Environment

  • Hiddify Manager: 12.3.3
  • Hiddify Panel: 12.3.3
  • Installation: standard installer
  • OS: Ubuntu 22.04
  • Telegram proxy implementation: Telemt

Additional note

Telemt's add_client and remove_client methods are currently no-ops, so it relies on generated configuration updates. Telemt may also need to be reloaded/restarted after regeneration for the changed access list to take effect in the running process.

IlyaKochnev avatar Jul 11 '26 11:07 IlyaKochnev

Proposed fix: https://github.com/hiddify/HiddifyPanel/pull/32

IlyaKochnev avatar Jul 11 '26 11:07 IlyaKochnev

Yes, their last release was with errors, nothing works. And the feedback is 0. I am surprised at the attitude towards project, they would tell people to wait two or three months. Otherwise, it is unknown.

alexeyhome21 avatar Jul 12 '26 17:07 alexeyhome21

Likely related to our production issue: Admin API renew updates panel DB but sing-box protocols stay stale until manual apply-users. Background apply appears to fail silently. Details: #5505

mktwix avatar Jul 19 '26 15:07 mktwix

This issue has been resolved in the new version (v14.0.5). Please update, and if it still happens, open a new issue with your version and logs.

hiddify-com avatar Oct 25 '26 10:10 hiddify-com