IceWhaleTech / CasaOS

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

[Bug] After upgrade from 4.4 to 4.5 then 4.6 and docker AppData folder is not mounting correctly #1655

Open stevenhiner opened 8 months ago

stevenhiner commented 8 months ago

Describe the bug

After upgrading from 4.4 to 4.5 then immediately to 4.6, /var/lib/casaos/files/ is no longer getting mounted to /DATA/ which reset all apps to default data. It appears that casaos-local-storage.service is throwing an error and is not mounting the /DATA/ folder correctly.

To Reproduce

  1. Running CasaOS 4.4
  2. Install any App, for instance, Uptime Kuma
  3. Open Uptime Kuma, create login and configure it so it will save data
  4. ssh into server and run: curl -fsSL https://get.casaos.io/update/v0.4.5 | sudo bash
  5. reboot server
  6. Login to CasaOS and notice that there is an upgrade available for 4.6
  7. Update to 4.6 using the web UI
  8. Reboot
  9. Use menu on Uptime Kuma to check for an install updates (Likely not required but something I did)
  10. Start Uptime Kuma

Expected behavior

Uptime Kuma, and all other apps should have retained the same data they had before the upgrade. The mapping of the volumes assigned to the apps should have remained the same so the containers have access to all their original data.

Screenshots

image You can see that the two folders now contain different files. In /DATA the Uptime Kuma App has created all new data folders and default files.

image You can see here that /DATA is not mounted to anything.

Desktop (please complete the following information):

 - OS: Windows 11
 - Browser: Brave
 - Version 1.61

System Time

               Local time: Fri 2024-01-26 00:49:56 UTC
           Universal time: Fri 2024-01-26 00:49:56 UTC
                 RTC time: Fri 2024-01-26 00:49:56
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Logs

casaos-gateway.log casaos-user-service.log casaos-local-storage.log casaos-app-management.log casaos.service.log

Additional context

Output of: systemctl status casaos-local-storage.service casaos-local-storage.service.log

● casaos-local-storage.service - CasaOS Local Storage Service
     Loaded: loaded (/lib/systemd/system/casaos-local-storage.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-01-25 19:41:50 UTC; 3h 39min ago
    Process: 1100 ExecStartPre=/usr/bin/casaos-local-storage -v (code=exited, status=0/SUCCESS)
   Main PID: 1194 (casaos-local-st)
      Tasks: 8 (limit: 14193)
     Memory: 78.1M
        CPU: 48.970s
     CGroup: /system.slice/casaos-local-storage.service
             └─1194 /usr/bin/casaos-local-storage -c /etc/casaos/local-storage.conf

Jan 25 23:13:25 caladan casaos-local-storage[1194]:     "type": "scsi",
Jan 25 23:13:25 caladan casaos-local-storage[1194]:     "protocol": "SCSI"
Jan 25 23:13:25 caladan casaos-local-storage[1194]:   },
Jan 25 23:13:25 caladan casaos-local-storage[1194]:   "vendor": "TSSTcorp",
Jan 25 23:13:25 caladan casaos-local-storage[1194]:   "product": "DVD+-RW TS-H653G",
Jan 25 23:13:25 caladan casaos-local-storage[1194]:   "model_name": "TSSTcorp DVD+-RW TS-H653G",
Jan 25 23:13:25 caladan casaos-local-storage[1194]:   "revision": "DW10",
Jan 25 23:13:25 caladan casaos-local-storage[1194]:   "scsi_version": "SPC-3"
Jan 25 23:13:25 caladan casaos-local-storage[1194]: }
Jan 25 23:13:25 caladan casaos-local-storage[1194]: 2024-01-25T23:13:25.195Z        error        failed to exec shell - smartctl exec error        {"func": "service.(*diskService).SmartCTL", "file": "/home/runner/work/CasaOS-LocalStorage/CasaOS-LocalStorage/service/disk.go", "line": 149}
stevenhiner commented 8 months ago

Tried adding /var/lib/casaos/files /DATA fuse.mergerfs rw,relatime,user_id=0,group_id=0,default_permissions,allow_other 0 0 to /etc/fstab, ran rm -rf * in the /DATA folder, and rebooted. Ubuntu wouldn't boot. Pushed me into maintenance mode. I removed that line from fstab and rebooted and it's working now. Not only is ubuntu able to boot but the correct folder is mounted to /DATA and my apps work again. Not sure what happened but it seems to all be working now. Hopefully that will be some level of clue as to what went wrong after the update.