IceWhaleTech / CasaOS

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
https://casaos.io
Apache License 2.0
26.14k stars 1.42k forks source link

[Bug] Failed to run migration script. Unable to update to v.0.4.6 #1647

Closed x3llaz closed 9 months ago

x3llaz commented 9 months ago

Describe the bug

Failed to run migration script during update

To Reproduce

Steps to reproduce the behavior:

  1. Go to main CasaOS dashboard page
  2. Click on 'Settings'
  3. Scroll down to 'Update'
  4. Click on 'Update'
  5. See error "Failed to run migration script" during update.

Expected behavior

Successful update of CasaOS v0.4.5 to 0.4.6

Screenshots

https://i.imgur.com/ycEbLMT.png

Desktop:

 - OS: Debian GNU/Linux 12 (bookworm) aarch64 (Raspberry Pi 5), MX x86_64 (MX Linux), Windows 11 Pro, Android v14
 - Browser: Librewolf, Brave, Firefox, Chrome, Vivaldi
 - Version: all at the latest current version. Same bug encountered using my android phone, Raspberry Pi 5, and Linux Desktop PC

System Time

Local time: Tue 2024-01-23 20:25:46 EST
Universal time: Wed 2024-01-24 01:25:46 UTC
RTC time: Wed 2024-01-24 01:25:46
Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

Logs

Manual command update via terminal fails the same way too as shown below.

❯ sudo curl -fsSL https://get.casaos.io/update/v0.4.6 | sudo bash

   _____                 ____   _____ 
  / ____|               / __ \ / ____|
 | |     __ _ ___  __ _| |  | | (___  
 | |    / _` / __|/ _` | |  | |\___ \ 
 | |___| (_| \__ \ (_| | |__| |____) |
  \_____\__,_|___/\__,_|\____/|_____/ 

   --- Made by IceWhale with YOU ---

- OK Your hardware architecture is : aarch64
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease                                                                    
Hit:3 https://download.docker.com/linux/debian bookworm InRelease                                                                          
Hit:4 http://deb.debian.org/debian bookworm-updates InRelease       
Hit:5 http://archive.raspberrypi.com/debian bookworm InRelease
Reading package lists... Done
- INFO Configuration CasaOS Addons
Created symlink /etc/systemd/system/multi-user.target.wants/devmon@devmon.service → /lib/systemd/system/devmon@.service.
Created symlink /etc/systemd/system/default.target.wants/devmon@devmon.service → /lib/systemd/system/devmon@.service.
/tmp/casaos-installer/tmp.wv9HyFPUNg /home/pi5
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-Gateway/releases/download/v0.4.4-3-alpha5/linux-arm64-casaos-gateway-v0.4.4-3-alpha5.tar.gz...
linux-arm64-casaos-gateway-v0.4.4-3-alpha5.tar.gz       100%[============================================================================================================================>]   4.41M  4.75MB/s    in 0.9s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-MessageBus/releases/download/v0.4.4-3-alpha2/linux-arm64-casaos-message-bus-v0.4.4-3-alpha2.tar.gz...
linux-arm64-casaos-message-bus-v0.4.4-3-alpha2.tar.gz   100%[============================================================================================================================>]   6.41M  9.28MB/s    in 0.7s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-UserService/releases/download/v0.4.5/linux-arm64-casaos-user-service-v0.4.5.tar.gz...
linux-arm64-casaos-user-service-v0.4.5.tar.gz           100%[============================================================================================================================>]   6.57M  17.5MB/s    in 0.4s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-LocalStorage/releases/download/v0.4.4/linux-arm64-casaos-local-storage-v0.4.4.tar.gz...
linux-arm64-casaos-local-storage-v0.4.4.tar.gz          100%[============================================================================================================================>]  10.63M  13.9MB/s    in 0.8s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-AppManagement/releases/download/v0.4.5/linux-arm64-casaos-app-management-v0.4.5.tar.gz...
linux-arm64-casaos-app-management-v0.4.5.tar.gz         100%[============================================================================================================================>]  30.28M  29.3MB/s    in 1.0s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS/releases/download/v0.4.6/linux-arm64-casaos-v0.4.6.tar.gz...
linux-arm64-casaos-v0.4.6.tar.gz                        100%[============================================================================================================================>]   8.56M  6.38MB/s    in 1.3s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-CLI/releases/download/v0.4.4-3-alpha1/linux-arm64-casaos-cli-v0.4.4-3-alpha1.tar.gz...
linux-arm64-casaos-cli-v0.4.4-3-alpha1.tar.gz           100%[============================================================================================================================>]   3.35M  12.3MB/s    in 0.3s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-UI/releases/download/v0.4.6/linux-all-casaos-v0.4.6.tar.gz...
linux-all-casaos-v0.4.6.tar.gz                          100%[============================================================================================================================>]  11.00M  11.1MB/s    in 1.0s    
- INFO Downloading https://github.com/IceWhaleTech/CasaOS-AppStore/releases/download/v0.4.5/linux-all-appstore-v0.4.5.tar.gz...
linux-all-appstore-v0.4.5.tar.gz                        100%[============================================================================================================================>] 500.50K  --.-KB/s    in 0.1s    
- INFO Extracting linux-all-appstore-v0.4.5.tar.gz...
- INFO Extracting linux-all-casaos-v0.4.6.tar.gz...
- INFO Extracting linux-arm64-casaos-app-management-v0.4.5.tar.gz...
- INFO Extracting linux-arm64-casaos-cli-v0.4.4-3-alpha1.tar.gz...
- INFO Extracting linux-arm64-casaos-gateway-v0.4.4-3-alpha5.tar.gz...
- INFO Extracting linux-arm64-casaos-local-storage-v0.4.4.tar.gz...
- INFO Extracting linux-arm64-casaos-message-bus-v0.4.4-3-alpha2.tar.gz...
- INFO Extracting linux-arm64-casaos-user-service-v0.4.5.tar.gz...
- INFO Extracting linux-arm64-casaos-v0.4.6.tar.gz...
/home/pi5
- INFO Running /tmp/casaos-installer/tmp.wv9HyFPUNg/build/scripts/migration/script.d/01-migrate-gateway.sh...
✅ CURRENT_VERSION: v0.4.4
✅ SOURCE_VERSION: v0.4.4
✅ Migration is not needed.
- INFO Running /tmp/casaos-installer/tmp.wv9HyFPUNg/build/scripts/migration/script.d/02-migrate-user-service.sh...
✅ CURRENT_VERSION: v0.4.4
✅ SOURCE_VERSION: v0.4.4
✅ Migration is not needed.
- INFO Running /tmp/casaos-installer/tmp.wv9HyFPUNg/build/scripts/migration/script.d/03-migrate-casaos.sh...
realpath: /usr/local/bin/casaos: No such file or directory
✅ CURRENT_VERSION: v0.4.5
✅ SOURCE_VERSION: v0.4.6
🟩 ARCH: arm64
🟨 No migration path found from v0.4.5 to v0.4.6
- INFO Running /tmp/casaos-installer/tmp.wv9HyFPUNg/build/scripts/migration/script.d/04-migrate-local-storage.sh...
- FAILED Failed to run migration script

Additional context

Neofetch info:

       _,met$$$$$gg.           pi5@raspberrypi 
    ,g$$$$$$$$$$$$$$$P.   --------------- 
  ,g$$P"     """Y$$.".          OS: Debian GNU/Linux 12 (bookworm) aarch64 
 ,$$P'              `$$$.          Host: Raspberry Pi 5 Model B Rev 1.0 
',$$P       ,ggs.     `$$b:     Kernel: 6.1.0-rpi7-rpi-2712 
`d$$'     ,$P"'   .    $$$      Uptime: 11 hours, 41 mins 
 $$P      d$'     ,    $$P      Packages: 822 (dpkg) 
 $$:      $$.   -    ,d$$'       Shell: zsh 5.9 
 $$;      Y$b._   _,d$P'       Terminal: /dev/pts/0 
 Y$$.    `.`"Y$$$$P"'         CPU: (4) @ 2.400GHz 
 `$$b      "-.__                   Memory: 1232MiB / 8053MiB 
  `Y$$
   `Y$$.                                              
     `$$b.                                            
       `Y$$b.
          `"Y$b._
              `"""

I'm not sure if this is possibly caused by the storage too. I have recently changed the storage of my Raspberry Pi 5 from a USB3 SSD to an Nvme M.2 SSD (2TB Crucial P3) using the hat from Geekworm (Geekworm X1001 PCIe M.2 Key-M NVMe SSD PIP PCIe Peripheral Board for Raspberry Pi 5) and removed the USB SSD afterwards after changing the settings to make the Nvme SSD my main boot drive.

lsblk:

NAME           FSTYPE FSVER LABEL  UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
/dev/nvme0n1                                                                           
/dev/nvme0n1p1 vfat   FAT32 bootfs 5DF9-E225                             449.1M    12% /boot/firmware
/dev/nvme0n1p2 ext4   1.0   rootfs 3b614a3f-4a65-4480-876a-8a998e01ac9b    1.7T     1% /

My only storage on the Pi 5 is the 2TB Nvme SSD now. Update keeps failing at the migration part. I really want to get this update 'coz updating to 0.4.5 also broke the ability to change wallpapers for me. Let me know if you need more infos. Thanks & keep it up with CasaOS! 👍

RowdyMuncher commented 9 months ago

Exactly same here on Rpi 5

x3llaz commented 9 months ago

Exactly same here on Rpi 5

Didn't want to say this but I'm glad I'm not the only one. 😅

apstudio commented 9 months ago

Same problem on PI 5. On PI 4 is OK.

x3llaz commented 9 months ago

Same problem on PI 5. On PI 4 is OK.

Are you running a hat too with an Nvme SSD? Just curious.

apstudio commented 9 months ago

Same problem on PI 5. On PI 4 is OK.

Are you running a hat too with an Nvme SSD? Just curious.

Yes. via hat with NVME. On PI 4 is via USB to M.2 SSD.

hardaysknight commented 9 months ago

Same problem. Rpi5

PataconVP commented 9 months ago

I have the same problem and I'm not running a SSD hat

cdrmx commented 9 months ago

Hi, same problem. Raspi 5, sdcard OS. thank's for your help

turby666 commented 9 months ago

Same here pi5 with sdcard, not able to update to 4.6

x3llaz commented 9 months ago

I guess it doesn't matter if we are using a hat or not or even an Nvme SSD since even SD cards are affected. I'm tempted to just uninstall CasaOS 0.4.5 and revert it back to 0.4.3. 😅

Update: I did and went with it. I forced a downgrade to CasaOS 0.4.3 by using command:

curl -fsSL https://get.casaos.io/v0.4.4-3 | sudo bash

I didn't even have to uninstall CasaOS. I just did the command above. So far everything is working as intended. All my docker containers are launching with no errors. This also fixed the bug on 0.4.5 where I can't change the wallpaper. I won't be updating CasaOS to the latest from now on unless it's very stable and have features I need or there's an important security patch from now on. 🫤

PiBenchmark results even with CasaOS 0.4.3 running:

RandRead: 63294 - RandWrite: 265456 - Read: 175455 - Write: 193518
Enter a description of your storage and setup (Example: Kingston A400 SSD on Pi 4 using StarTech SATA to USB adapter)
Description: 2TB Crucial P3 Nvme SSD using Geekworm hat on a Raspberry Pi 5
(Optional) Enter alias to use on benchmark results.  Leave blank for completely anonymous.
Alias (leave blank for Anonymous): xellaz

     Category                  Test                      Result     
HDParm                    Disk Read                 801.31 MB/sec            
HDParm                    Cached Disk Read          815.70 MB/sec            
DD                        Disk Write                370 MB/s                 
FIO                       4k random read            167868 IOPS (671475 KB/s)
FIO                       4k random write           48761 IOPS (195047 KB/s) 
IOZone                    4k read                   175455 KB/s              
IOZone                    4k write                  193518 KB/s              
IOZone                    4k random read            63294 KB/s               
IOZone                    4k random write           265456 KB/s              

                          Score: 48146                                       

Compare with previous benchmark results at:
https://pibenchmarks.com/

For those that wants to try, the command is below:

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

😁

CorrectRoadH commented 9 months ago

Thanks for your feedback. We have fixed the bug. You can rerun the install/update script to install/update CasaOS. 😃

x3llaz commented 9 months ago

Thanks for your feedback. We have fixed the bug. You can rerun the install/update script to install/update CasaOS. 😃

Thanks! Indeed, everything is working great now! 😁