alireza0 / s-ui

An advanced Web Panel • Built for SagerNet/Sing-Box
https://t.me/XrayUI
GNU General Public License v3.0
2.11k stars 304 forks source link

Error occurs after updating s-ui from v0.0.4 to v0.0.5 #153

Closed leic4u closed 3 weeks ago

leic4u commented 3 weeks ago

Describe the bug

Error occurs after updating s-ui from v0.0.4 to v0.0.5

To Reproduce

  1. use watchtower to update s-ui.
  2. login to s-ui panel
  3. See error

Expected behavior

Panel works correctly.

Screenshots

Clip_2024-06-10_16-02-09

alireza0 commented 3 weeks ago

You did not run the migration process, because of using another method of upgrading. It is important to run migrate command before running new version. Reocmmanded upgrade solution is one of these options:

  1. Using installation link.
  2. Using s-ui update command or choosing update from s-ui cli script's menu

To fix your problem, install previous version again and upgrade it with one of these solutions.

Manuall solution coule be also done:

  1. Downgrade to 0.0.4
  2. Run pannel once.
  3. Stop panel
  4. Replace new sui file
  5. Run migration maually by /usr/local/s-ui/sui migrate
  6. Run s-ui service again

If you are using docker-compose solution, just put migration command in Entrypoint:

entrypoint: "./sui migrate && ./sui"
leic4u commented 3 weeks ago

I added entrypoint: "./sui migrate && ./sui" to my docker-compose.yml and ran docker compose up -d to start it.

I checked docker logs s-ui and found the Migration done!. So I run the docker compose down to delete the containers.

And I changed the Entrypoint back to entrypoint: "./sui", and ran docker compose up -d to start the containers.

There are also occurs error.

Should I delete the file folder db?

alireza0 commented 3 weeks ago

It seems you forgot to downgrade first! To revert the affacts of non migrated data conversion in 0.0.5, you should first run it once with 0.0.4 and then, with changing to 0.0.5, add migration and run it once. Then all data will migrate correctly.

You should see these logs in migration process:

Migration...
Start migrating database...
Column config has type TEXT
Column inbounds has type TEXT
Column links has type TEXT
Migration done!

Deleteing db folder will cause removing all your s-ui data stored in database including clients and panel configuration. If you want to start it from scratch, there should be no problem :)

leic4u commented 3 weeks ago

Thanks bro. The message comes a little late.

I have deleted the db folder and prepare to config the panel again.😂😂

leic4u commented 3 weeks ago

A little suggestion: Maybe the migration should be auto-run when there is a update.

alireza0 commented 3 weeks ago

Yes, it is autorun in script. But you are using docker and updating docker-compose is not in docker update process. I will add it to docker-compose.yml