4 bugs in 13.0.3: sub_link_only breaks all subscriptions, broken cert filename in sync_tls_store, apply_configs can't fix missing units, domain delete crashes without Cloudflare zone

Author: AK7272Created Sep 27, 2026Updated Sep 27, 2026

Describe the bug Hiddify Manager 13.0.3 — 4 bugs found during a real troubleshooting session

Version: 13.0.3 (fresh install, also reproduced after 3x full reinstall) OS: Ubuntu, non-Docker (bare-metal) install

These four issues were found in a single session while debugging a subscription that only returned one working proxy. Posting them together since they were discovered on the same box, but happy to split into separate issues if maintainers prefer.

  1. A single sub_link_only domain silently breaks subscriptions on every other domain

Impact: High — silently breaks subscription delivery, no error logged anywhere.

In hiddifypanel/panel/user/user.py, _render_core_config():

python if Domain.child_has_sub_link_only(0) and not db_domain.is_sub_link_only(): return error_status_config(core, _("This domain %(domain_name)s is invalid", domain_name=request.host))

If any domain in the panel has mode sub_link_only, every subscription request coming through a domain that is not itself sub_link_only (e.g. direct, cdn, worker) is rejected. Instead of the real config bundle, the client receives a single dummy proxy entry whose remark is literally the error text ("This domain X is invalid").

Nothing is logged to hiddify_panel.err.log or journalctl -u hiddify-panel when this happens — the response looks superficially valid (200 OK, base64 payload, one proxy entry), which makes it very hard to diagnose. TLS, certificates, and all backend services can be perfectly healthy while this happens.

Steps to reproduce:

Add any domain with mode sub_link_only. Request the subscription link via a different domain (mode direct, etc.). Response contains one fake proxy with the "invalid domain" message instead of the real config list.

Expected: sub_link_only should only affect what that specific domain serves. It should not affect subscription requests made through other, unrelated domains. At minimum this should be logged/surfaced clearly in the admin UI.

  1. apply_configs (DO_NOT_INSTALL=true) cannot repair missing systemd unit symlinks

Impact: Medium — turns a recoverable state into a dead end without a clear error.

In scripts/install.sh:

bash function install_run() { if [ "$DO_NOT_INSTALL" != "true" ]; then runsh install.sh $@ if [ "$MODE" != "apply_users" ] && [ "$DOCKER_MODE" != "true" ]; then systemctl daemon-reload fi fi if [ "$DO_NOT_RUN" != "true" ]; then runsh run.sh $@ fi }

apply_configs.sh runs everything with DO_NOT_INSTALL=true, which skips the install.sh step entirely for every module — that step is what creates the /etc/systemd/system/hiddify-*.service symlink and runs daemon-reload. Only run.sh executes, which for most modules (e.g. services/redis/run.sh) just does systemctl start hiddify-, assuming the unit symlink already exists.

If a prior install/update was interrupted and left one or more unit symlinks missing (e.g. after a crash, an OOM, a killed apply, etc.), apply_configs can never recover — it will fail with Unit ... not found indefinitely, every single time, with no actionable message pointing at the real cause (missing symlink). Only a full install.sh run (not apply-only) recreates the symlinks.

Suggested fix: in apply_configs mode, still check whether the unit symlink exists before calling run.sh, and (re)create it + daemon-reload if missing, even though the module itself isn't being reinstalled.

  1. sync_tls_store writes HAProxy's combined cert under the wrong filename (cert_utils.sh.* instead of .*)

Impact: High — causes ERR_CERT_AUTHORITY_INVALID on the panel/subscription domain even though a valid Let's Encrypt cert was actually issued.

After acme.sh successfully issues/renews a certificate (confirmed valid in acme.log, and confirmed correctly installed for nginx under data/ssl/.crt / .crt.key), the hook that's supposed to build HAProxy's combined cert+key bundle:

[Date] Running reload cmd: bash -c 'source .../utils.sh && source .../services/acme.sh/utils.sh && sync_tls_store ""' [Date] Reload successful

...instead produced files named:

/opt/hiddify-manager/data/ssl/cert_utils.sh.crt /opt/hiddify-manager/data/ssl/cert_utils.sh.crt.key

i.e. the script's own filename (cert_utils.sh) leaked into the output filename instead of the actual domain name. HAProxy's crt directive then can't find a matching bundle for the SNI it receives and falls back to a default self-signed certificate (observed issuer: C=GB, ST=London, L=London, O=Google Trust Services LLC, CN=cert_utils.sh — note the CN is literally the script filename, and the issuer fields don't match how Google Trust Services actually issues certs).

End users hit ERR_CERT_AUTHORITY_INVALID in the browser even though nginx on the very same box serves the correct, valid Let's Encrypt cert for the same domain — because HAProxy sits in front of nginx and terminates TLS first with the broken fallback cert.

Workaround used: manually concatenate the acme.sh-issued fullchain + key per domain into data/ssl/.pem and systemctl reload hiddify-haproxy.

Suggested fix: find and fix the variable substitution in sync_tls_store (or the cert_utils.sh helper it sources) that's producing the script's own name instead of the $domain parameter.

  1. Deleting a domain crashes with AttributeError: 'NoneType' object has no attribute 'id' when no Cloudflare zone is configured

Impact: Medium — makes it impossible to delete a domain from the admin UI if Cloudflare isn't fully set up for it.

File ".../hiddifypanel/panel/admin/DomainAdmin.py", line 425, in on_model_delete if not hutils.network.cf_api.delete_dns_record(model.domain): File ".../hiddifypanel/hutils/network/cf_api.py", line 56, in delete_dns_record records = [__get_dns_record(zone, domain,"A"),__get_dns_record(zone, domain,"AAAA")] File ".../hiddifypanel/hutils/network/cf_api.py", line 78, in __get_dns_record dns_records = __cf.dns.records.list(zone_id=zone.id) AttributeError: 'NoneType' object has no attribute 'id'

DomainAdmin.on_model_delete unconditionally calls hutils.network.cf_api.delete_dns_record(model.domain), which looks up the matching Cloudflare zone and calls .id on it without checking for None first. If the domain being deleted has no matching Cloudflare zone (e.g. it's a plain domain not managed through the panel's Cloudflare integration), deletion fails with a 500 instead of simply skipping the DNS cleanup step.

Workaround used: delete the row directly from the domain table (and related show_domain / domain_custom_proxy rows) via MySQL, bypassing the admin UI's delete path.

Suggested fix: add a if zone is None: return True (or equivalent early-return/skip) in delete_dns_record / __get_dns_record before dereferencing zone.id.

To Reproduce BUG1: Steps to reproduce:

Add any domain with mode sub_link_only. Request the subscription link via a different domain (mode direct, etc.). Response contains one fake proxy with the "invalid domain" message instead of the real config list.

Expected behavior BUG1: Expected: sub_link_only should only affect what that specific domain serves. It should not affect subscription requests made through other, unrelated domains. At minimum this should be logged/surfaced clearly in the admin UI.

Additional context BUG2 Suggested fix: in apply_configs mode, still check whether the unit symlink exists before calling run.sh, and (re)create it + daemon-reload if missing, even though the module itself isn't being reinstalled.

BUG3 Workaround used: manually concatenate the acme.sh-issued fullchain + key per domain into data/ssl/.pem and systemctl reload hiddify-haproxy.

Suggested fix: find and fix the variable substitution in sync_tls_store (or the cert_utils.sh helper it sources) that's producing the script's own name instead of the $domain parameter.

BUG4 Workaround used: delete the row directly from the domain table (and related show_domain / domain_custom_proxy rows) via MySQL, bypassing the admin UI's delete path.

Suggested fix: add a if zone is None: return True (or equivalent early-return/skip) in delete_dns_record / __get_dns_record before dereferencing zone.id.