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

Database upgrade v78 is broken

Open atomic-dz opened this issue 2 months ago • 1 comments

          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.

Originally posted by @atomic-dz in https://github.com/hiddify/Hiddify-Manager/issues/3895#issuecomment-2057727526

atomic-dz avatar Apr 15 '24 20:04 atomic-dz