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
Other
5.57k stars 660 forks source link

inactive haproxy #3895

Open noobogami opened 3 months ago

noobogami commented 3 months ago

yesterday I installed hiddify on a new server and it was working fine but today when I check hiddify status it shows this:

- Services Status:
    hiddify-cli                   inactive
    hiddify-redis                 active
    ss-faketls                    active
    hiddify-ssh-liberty-bridge    active
    hiddify-haproxy               inactive
    hiddify-panel                 inactive
    hiddify-nginx                 active
    hiddify-singbox               inactive
    wg-quick@warp                 active
    mtproto-proxy                 active

tried to restart but even though it write

----------------------------------------------------------------
Name                           Old Status           New Status
hiddify-cli                    inactive    --->     active
hiddify-redis                  active      --->     active
ss-faketls                     active      --->     active
hiddify-ssh-liberty-bridge     active      --->     active
Job for hiddify-haproxy.service failed because the control process exited with error code.
See "systemctl status hiddify-haproxy.service" and "journalctl -xeu hiddify-haproxy.service" for details.
hiddify-haproxy                inactive    --->   inactive
hiddify-nginx                  active      --->     active
hiddify-singbox                inactive    --->     active
wg-quick@warp                  active      --->     active
mtproto-proxy                  active      --->     active
hiddify-panel                  inactive    --->   inactive
----------------------------------------------------------------

status won't change and still services that were inactive remain inactive

result of performing systemctl status hiddify-haproxy.service

● hiddify-haproxy.service - HAProxy Load Balancer
     Loaded: loaded (/etc/systemd/system/hiddify-haproxy.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2024-03-25 11:59:03 +0330; 2s ago
       Docs: man:haproxy(1)
             file:/usr/share/doc/haproxy/configuration.txt.gz
    Process: 203753 ExecStartPre=/usr/sbin/haproxy -Ws -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=1/FAILURE)
        CPU: 47ms

Mar 25 11:59:03 air-ssh systemd[1]: hiddify-haproxy.service: Control process exited, code=exited, status=1/FAILURE
Mar 25 11:59:03 air-ssh systemd[1]: hiddify-haproxy.service: Failed with result 'exit-code'.
Mar 25 11:59:03 air-ssh systemd[1]: Failed to start HAProxy Load Balancer.

result of performing journalctl -xeu hiddify-haproxy.service

Mar 25 11:59:54 air-ssh systemd[1]: Starting HAProxy Load Balancer...
░░ Subject: A start job for unit hiddify-haproxy.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit hiddify-haproxy.service has begun execution.
░░
░░ The job identifier is 1392606.
Mar 25 11:59:54 air-ssh haproxy[203874]: HAProxy version 2.9.6-1ppa1~jammy 2024/03/01 - https://haproxy.org/
Mar 25 11:59:54 air-ssh haproxy[203874]: Status: stable branch - will stop receiving fixes around Q1 2025.
Mar 25 11:59:54 air-ssh haproxy[203874]: Known bugs: http://www.haproxy.org/bugs/bugs-2.9.6.html
Mar 25 11:59:54 air-ssh haproxy[203874]: Running on: Linux 5.15.0-92-generic #102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024 x86_64
Mar 25 11:59:54 air-ssh haproxy[203874]: Usage : haproxy [-f <cfgfile|cfgdir>]* [ -vdVD ] [ -n <maxconn> ] [ -N <maxpconn> ]
Mar 25 11:59:54 air-ssh haproxy[203874]:         [ -p <pidfile> ] [ -m <max megs> ] [ -C <dir> ] [-- <cfgfile>*]
Mar 25 11:59:54 air-ssh haproxy[203874]:         -v displays version ; -vv shows known build options.
Mar 25 11:59:54 air-ssh haproxy[203874]:         -d enters debug mode ; -db only disables background mode.
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dM[<byte>,help,...] debug memory (default: poison with <byte>/0x50)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dt activate traces on stderr
Mar 25 11:59:54 air-ssh haproxy[203874]:         -V enters verbose mode (disables quiet mode)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -D goes daemon ; -C changes to <dir> before loading files.
Mar 25 11:59:54 air-ssh haproxy[203874]:         -W master-worker mode.
Mar 25 11:59:54 air-ssh haproxy[203874]:         -Ws master-worker mode with systemd notify support.
Mar 25 11:59:54 air-ssh haproxy[203874]:         -q quiet mode : don't display messages
Mar 25 11:59:54 air-ssh haproxy[203874]:         -c check mode : only check config files and exit
Mar 25 11:59:54 air-ssh haproxy[203874]:         -cc check condition : evaluate a condition and exit
Mar 25 11:59:54 air-ssh haproxy[203874]:         -n sets the maximum total # of connections (uses ulimit -n)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -m limits the usable amount of memory (in MB)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -N sets the default, per-proxy maximum # of connections (0)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -L set local peer name (default to hostname)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -p writes pids of all children to this file
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dC[[key],line] display the configuration file, if there is a key, the file will be anonymised
Mar 25 11:59:54 air-ssh haproxy[203874]:         -de disables epoll() usage even when available
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dp disables poll() usage even when available
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dS disables splice usage (broken on old kernels)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dG disables getaddrinfo() usage
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dR disables SO_REUSEPORT usage
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dL dumps loaded object files after config checks
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dK{class[,...]} dump registered keywords (use 'help' for list)
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dr ignores server address resolution failures
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dV disables SSL verify on servers side
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dW fails if any warning is emitted
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dD diagnostic mode : warn about suspicious configuration statements
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dF disable fast-forward
Mar 25 11:59:54 air-ssh haproxy[203874]:         -dZ disable zero-copy forwarding
Mar 25 11:59:54 air-ssh haproxy[203874]:         -sf/-st [pid ]* finishes/terminates old pids.
Mar 25 11:59:54 air-ssh haproxy[203874]:         -x <unix_socket> get listening sockets from a unix socket
Mar 25 11:59:54 air-ssh haproxy[203874]:         -S <bind>[,<bind options>...] new master CLI
Mar 25 11:59:54 air-ssh systemd[1]: hiddify-haproxy.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStartPre= process belonging to unit hiddify-haproxy.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 25 11:59:54 air-ssh systemd[1]: hiddify-haproxy.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit hiddify-haproxy.service has entered the 'failed' state with result 'exit-code'.
Mar 25 11:59:54 air-ssh systemd[1]: Failed to start HAProxy Load Balancer.
░░ Subject: A start job for unit hiddify-haproxy.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit hiddify-haproxy.service has finished with a failure.
░░
░░ The job identifier is 1392606 and the job result is failed.
AmyrAhmady commented 3 months ago

Same thing here, was working and now suddenly about 30 minutes ago some of the services went down:

- Services Status:
    hiddify-cli                   inactive
    hiddify-redis                 active
    ss-faketls                    active
    hiddify-ssh-liberty-bridge    active
    hiddify-haproxy               inactive
    hiddify-panel                 inactive
    hiddify-nginx                 active
    hiddify-singbox               inactive
    wg-quick@warp                 active
    mtproxy                       active

Tried restarting the entire server, restarting hiddify, and applying configs

amir-rz commented 2 months ago

مشکل فقط با حذف و نصب مجدد پنل حل شد. نیازی به حذف دیتابیس و کانفیگ ها نیست. وارد سرور شید و از منوی hiddify پنل رو حذف کنید و مجدد دوباره نسخه جدیدو نصب کنید. Screenshot from 2024-04-03 14-31-35

atomic-dz commented 2 months ago

The main trouble is in non-starting hiddify-panel. Because of this - not generating configs for all other modules. Give those commands

cd /opt/hiddify-manager/hiddify-panel /opt/hiddify-manager/hiddify-panel/app.py

It will give you the error:

(MySQLdb.OperationalError) (1091, "Can't DROP INDEX 'name'; check that it exists") [SQL: ALTER TABLE child DROP INDEX 'name';] (Background on this error at: https://sqlalche.me/e/20/e3q8) Updating db from version 77 for node 0 Traceback (most recent call last): File "/opt/hiddify-manager/hiddify-panel/app.py", line 6, in bjoern.run(wsgi_app=hiddifypanel.create_app(), host="127.0.0.1", port=9000) File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/base.py", line 76, in create_app init_db() File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/panel/init_db.py", line 692, in init_db db_action(child.id) File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/panel/init_db.py", line 51, in _v78 root_child_unique_id = Child.query.filter(Child.name == "Root").first().unique_id AttributeError: 'NoneType' object has no attribute 'unique_id'

Don't look at MySQL error, it's not a problem. Main trouble is here:

File "/usr/local/lib/python3.10/dist-packages/hiddifypanel/panel/init_db.py", line 51, in _v78 root_child_unique_id = Child.query.filter(Child.name == "Root").first().unique_id AttributeError: 'NoneType' object has no attribute 'unique_id'

If you look at mysql table "child" you will see that "name" has NULL value.

select name from child;

+------+ | name | +------+ | NULL | +------+ 1 row in set (0.000 sec)

Just need to update it to "Root";

Screenshot_10

After this you can "Apply configs" And "Upgrade".

The panel will make all configs and will start.

Somebody, need to fix it in the update script.