Admin API user renew updates panel DB but sing-box protocols (Hy2/TUIC/Mieru/Naive) stay stale until manual apply-users
Summary
When creating or renewing users via the Admin API (PATCH /api/v2/admin/user/{uuid}/), the panel database is updated correctly, but sing-box-based protocols (Hysteria2, TUIC, Mieru, Naive) may continue serving an old user list until apply-users / apply_configs is run manually on the server.
VLESS (Xray) works after API update because Xray can hot-reload via API. Hy2/TUIC/Mieru/Naive fail because they depend on regenerated static sing-box config files + service reload.
This makes external automation (billing panels, renewal scripts) appear successful while users cannot connect on several protocols.
Environment
- Hiddify Manager: 12.3.3
- OS: Ubuntu (multiple VPS nodes)
- Invocation: External automation via Admin API (not panel UI)
- Affected nodes: 3 independent edge servers (same version, same behavior)
Steps to reproduce
- Have an existing user with Hy2/TUIC/Mieru/Naive enabled.
- Let the user expire (or disable), then renew via Admin API:
PATCH /api/v2/admin/user/{uuid}/with updatedpackage_days,start_date,enable: true, etc.
- Confirm API returns success and
GET /api/v2/admin/user/{uuid}/shows the renewed user as enabled. - Try connecting with:
- VLESS → works
- Hysteria2 / TUIC / Mieru / Naive → auth fails / user not recognized
- On server, inspect sing-box configs:
UUID may be missing from Hy2/TUIC/Mieru/Naive inbound files, or files updated but service not reloaded.grep -rl '<uuid>' /opt/hiddify-manager/singbox/configs/*.json - Check sing-box service age:
In our case it was still running a config from 2 days earlier, despite successful API renew.systemctl show hiddify-singbox -p ActiveEnterTimestamp
Actual result
- Panel/API user record is correct (
enable=true, correctpackage_days, limits, dates). - VLESS subscriptions work immediately.
- Hy2/TUIC/Mieru/Naive subscriptions fail until manual apply.
- Automatic background apply often does not complete.
What we observed on the server
1) apply_configs can hang indefinitely (non-interactive)
apply_configs.sh → install.sh apply_configs → python -m cli_progress ... runs but never exits.
ps -forest -o pid,etime,cmd
bash apply_configs.sh
install.sh apply_configs
python -m cli_progress ... ./install.sh apply_configs --no-gui --no-log # R state, 17+ minutes
/opt/hiddify-manager/log/system/0-install.logstayed 0 bytes- No
0-install.lockpresent hiddify-singboxremained active with an oldActiveEnterTimestamp- Likely related to #5479 (cli_progress urwid loop without TTY)
2) apply-users often fails with exit 12 (install lock)
Another installation is running.... Please wait until it finishes or execute 'rm $LOCK_FILE'
exit 12
Happens when a concurrent/stuck apply_configs is running or left a stale lock.
3) Manual apply-users fixes it
After killing the stuck cli_progress process and running:
/opt/hiddify-manager/common/commander.py apply-users
systemctl restart hiddify-singbox
- Hy2/TUIC/Mieru/Naive configs regenerated with the UUID present
- Protocols started working again
Expected result
After Admin API user create/renew/update:
- Panel DB is updated (already works)
apply-usersruns reliably in background- sing-box configs are regenerated
hiddify-singboxis reloaded/restarted- All protocols (including Hy2/TUIC/Mieru/Naive) reflect the change without manual SSH intervention
Related issues
This appears to be a combination of several open bugs/limitations:
- #5479 —
apply_configs/cli_progresshangs without TTY (we hit this directly) - #5498 — background
commander(...)thread missingcmdargument, so panel-triggered apply-users silently fails - #4926 — new users not added to Hy2/TUIC sing-box JSON files
Suggested fixes
- Fix cli_progress non-TTY hang (#5479) — bypass urwid when
!sys.stdout.isatty() - Fix background commander thread (#5498) — pass
args=(base_cmd,)tocmd_in_back - After Admin API user mutations, ensure apply-users is queued and verified (and surface failures to API caller / logs)
- Consider documenting that API-only updates are not sufficient for sing-box protocols without a successful apply-users
- Add health check: compare panel user UUID set vs sing-box inbound UUID set; alert on drift
Workaround (what we implemented externally)
For anyone automating renewals via API:
# after API user update
/opt/hiddify-manager/common/commander.py apply-users
systemctl restart hiddify-singbox # if reload did not happen
With retries when exit 12 (lock held).
Happy to provide additional logs or test a patched build. This is affecting production renewals on multiple nodes.
Opened PRs for the apply hang fix:
- https://github.com/hiddify/Hiddify-Manager/pull/5506 (bypass cli_progress in utils.sh when no TTY)
- https://github.com/hiddify/cli_progress/pull/8 (same fix in cli_progress main.py)
For the background commander / apply-users silent failure (#5498), there is already an open fix: https://github.com/hiddify/hiddifypanel/pull/32
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.