Hypfer / Valetudo

Cloud replacement for vacuum robots enabling local-only operation
https://valetudo.cloud
Apache License 2.0
6.38k stars 388 forks source link

Updating via the built in updater failed #1234

Closed LouiS22 closed 2 years ago

LouiS22 commented 2 years ago

Describe the bug

Tried updating Valetudo via the built in updater, but failed with the below error message (could be no space left on device?).

Screenshots

Vacuum Model

Roborock S5

Valetudo Version

2021.11.0

Expected behavior

Additional context

the log says the following:

[2021-11-24T14:52:05.470Z] [ERROR] Unexpected error during apply Error: ENOSPC: no space left on device, copyfile '/dev/shm/b6dd5d80-b5b1-40ee-b0df-bdbb39f74935' -> '/usr/local/bin/valetudo' at Object.copyFileSync (node:fs:2800:3) at Updater.apply (/snapshot/Valetudo/backend/lib/updater/Updater.js:112:12) at Updater.triggerApply (/snapshot/Valetudo/backend/lib/updater/Updater.js:100:14) at /snapshot/Valetudo/backend/lib/webserver/UpdaterRouter.js:41:42 at Layer.handle [as handle_request] (/snapshot/Valetudo/node_modules/express/lib/router/layer.js:95:5) at next (/snapshot/Valetudo/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/snapshot/Valetudo/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/snapshot/Valetudo/node_modules/express/lib/router/layer.js:95:5) at /snapshot/Valetudo/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/snapshot/Valetudo/node_modules/express/lib/router/index.js:335:12) at next (/snapshot/Valetudo/node_modules/express/lib/router/index.js:275:10) at Function.handle (/snapshot/Valetudo/node_modules/express/lib/router/index.js:174:3) at router (/snapshot/Valetudo/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/snapshot/Valetudo/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/snapshot/Valetudo/node_modules/express/lib/router/index.js:317:13) at /snapshot/Valetudo/node_modules/express/lib/router/index.js:284:7 { errno: -28, syscall: 'copyfile', code: 'ENOSPC', path: '/dev/shm/b6dd5d80-b5b1-40ee-b0df-bdbb39f74935', dest: '/usr/local/bin/valetudo' } [2021-11-24T14:58:09.664Z] [ERROR] Unexpected error during apply Error: ENOENT: no such file or directory, unlink '/usr/local/bin/valetudo' at Object.unlinkSync (node:fs:1718:3) at Updater.apply (/snapshot/Valetudo/backend/lib/updater/Updater.js:111:12) at Updater.triggerApply (/snapshot/Valetudo/backend/lib/updater/Updater.js:100:14) at /snapshot/Valetudo/backend/lib/webserver/UpdaterRouter.js:41:42 at Layer.handle [as handle_request] (/snapshot/Valetudo/node_modules/express/lib/router/layer.js:95:5) at next (/snapshot/Valetudo/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/snapshot/Valetudo/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/snapshot/Valetudo/node_modules/express/lib/router/layer.js:95:5) at /snapshot/Valetudo/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/snapshot/Valetudo/node_modules/express/lib/router/index.js:335:12) at next (/snapshot/Valetudo/node_modules/express/lib/router/index.js:275:10) at Function.handle (/snapshot/Valetudo/node_modules/express/lib/router/index.js:174:3) at router (/snapshot/Valetudo/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/snapshot/Valetudo/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/snapshot/Valetudo/node_modules/express/lib/router/index.js:317:13) at /snapshot/Valetudo/node_modules/express/lib/router/index.js:284:7 { errno: -2, syscall: 'unlink', code: 'ENOENT', path: '/usr/local/bin/valetudo' }

Hypfer commented 2 years ago

/usr/local/bin/ is full?

df output?

LouiS22 commented 2 years ago

/usr/local/bin$ df Filesystem 1K-blocks Used Available Use% Mounted on rootfs 173533 154769 9804 94% / /dev/root 173533 154769 9804 94% / devtmpfs 64 0 64 0% /dev none 255268 20 255248 0% /run tmpfs 30720 300 30420 1% /var tmpfs 64 0 64 0% /dev tmpfs 30720 1580 29140 5% /tmp tmpfs 102400 2560 99840 3% /run/shm /dev/mmcblk0p1 1536048 205072 1252948 14% /mnt/data /dev/mmcblk0p6 63461 5412 54773 9% /mnt/default /dev/mmcblk0p10 173533 137813 26760 84% /mnt/updbuf /dev/mmcblk0p11 15863 2193 12851 15% /mnt/reserve

Hypfer commented 2 years ago

rootfs 173533 154769 9804 94% /

Why is your rootfs this full?

Here it looks like this:

[root@rockrobo ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                  505764    138475    341177  29% /
/dev/root               505764    138475    341177  29% /
devtmpfs                    64         0        64   0% /dev
none                    255268        20    255248   0% /run
tmpfs                    30720       388     30332   1% /var
tmpfs                       64         0        64   0% /dev
tmpfs                    30720         4     30716   0% /tmp
tmpfs                   102400      2564     99836   3% /run/shm
/dev/mmcblk0p1         1584408    448640   1055284  30% /mnt/data
/dev/mmcblk0p6           63461     13408     46777  22% /mnt/default
/dev/mmcblk0p10         505764    139257    340395  29% /mnt/updbuf
/dev/mmcblk0p11          15863      1943     13101  13% /mnt/reserve

The updater should be able to handle that gracefully though

LouiS22 commented 2 years ago

I don't know :)

Hypfer commented 2 years ago

You've probably built your firmware image without checking the Resize Rootfs to 510MByte checkbox.

Please upgrade as it was done previously and don't forget to check that box.

Starting with c298e983, the updater will no longer allow updating in such situations

LouiS22 commented 2 years ago

Ok, I think I found something. /mnt/data contains a hidden folder .temp with a 80 mb .pkg file inside. Is that ok?

Hypfer commented 2 years ago

Huh. Okay. That's the first time that I'm seeing that file

[root@rockrobo .temp]# ls -lah
drwxr-xr-x    2 root     root        4.0K Feb 20  2021 .
drwxr-xr-x    8 root     root        4.0K Aug 31 16:36 ..
-rw-r--r--    1 root     root       74.5M Feb 20  2021 Update.pkg
LouiS22 commented 2 years ago

OK. Will compile a new firmware and see what happens.

LouiS22 commented 2 years ago

Problem resolved, Resize Rootfs to 510MByte was the culprit.

einfacharthur commented 2 years ago

I'd like to see this in FAQ. I had the same problem with OTA. Fixed this by building new image with checkbox Resize Rootfs to 510MByte and flashing via SSH.

https://builder.dontvacuum.me/_s5.html https://valetudo.cloud/pages/general/upgrading.html

that helped :)

liquidbear99 commented 2 years ago

Does this fix mean that the option will be applied by default in the subsequent releases and upgrades using the GUI? Or will I need to continue using the old way (after fixing this by building the new image with the box checked to resize)? (Sorry to comment in a closed thread)

rimrul commented 2 years ago

Does this fix mean that the option will be applied by default in the subsequent releases and upgrades using the GUI? Or will I need to continue using the old way (after fixing this by building the new image with the box checked to resize)?

You missunderstood what the updater does. It only updates valetudo without replacing the underlying firmware. So it doesn't touch what that checkbox does.

No re-applying (manual or automatic) needed.

liquidbear99 commented 2 years ago

Does this fix mean that the option will be applied by default in the subsequent releases and upgrades using the GUI? Or will I need to continue using the old way (after fixing this by building the new image with the box checked to resize)?

You missunderstood what the updater does. It only updates valetudo without replacing the underlying firmware. So it doesn't touch what that checkbox does.

No re-applying (manual or automatic) needed.

Ah I see. So I just need to fix that once and it shouldn't be a problem in the future when I update valetudo (and I won't need up replace the firmware again since my firmware now has that checked).

Hypfer commented 2 years ago

(and I won't need up replace the firmware again since my firmware now has that checked).

Possibly, but there are no warranties whatsoever for that.