vdsm / virtual-dsm

Virtual DSM in a Docker container.
MIT License
2.38k stars 318 forks source link

ERROR: Failed to extract /storage/dsm.rd, reason 2 #632

Closed alansw84 closed 6 months ago

alansw84 commented 6 months ago

I have no issue to use the docker run with all the parameter, but when I try to use the docker-compose.yml, its prompted me with these error:

% docker compose up
[+] Running 1/1 ✔ Container dsm Recreated
Attaching to dsm dsm | ❯ Starting Virtual DSM for Docker v5.25... dsm | ❯ For support visit https://github.com/vdsm/virtual-dsm dsm | dsm | ❯ Install: Downloading installer... dsm | ❯ ERROR: Failed to extract /storage/dsm.rd, reason 2 dsm exited with code 0 %

Below is my docker-compose.yml: version: "3" services: dsm: container_name: dsm image: vdsm/virtual-dsm environment: DISK_SIZE: "16G" cap_add:

Thanks in advance.

kroese commented 6 months ago

Very strange! What kind of OS are you using? And what kind of filesystem is that /Users directory?

alansw84 commented 6 months ago

I'm using Mac Mini M2 Apple Silicon Chip, Macos Sonoma 14.2.1, APFS and Mac Journal, exfat, got the same error.

My docker-compose.yml version: "3" services: dsm: container_name: dsm image: vdsm/virtual-dsm environment: DISK_SIZE: "16G" cap_add:

FAT32 (error): dsm | ❯ Install: Preparing system partition... dsm | fallocate: fallocate failed: File too large dsm | truncate: failed to truncate '/storage/DSM_VirtualDSM_69057.system.img' at 4954537983 bytes: File too large dsm | ❯ ERROR: Could not allocate file /storage/DSM_VirtualDSM_69057.system.img for the system disk. dsm exited with code 0

NTFS (error): alan@Alans-Mac-mini-250 vdsm-app % docker compose up
[+] Running 2/0 ✔ Network vdsm-app_default Created 0.0s ✔ Container dsm Created 0.0s Attaching to dsm dsm | ❯ Starting Virtual DSM for Docker v5.25... dsm | ❯ For support visit https://github.com/vdsm/virtual-dsm dsm | dsm | ❯ Install: Downloading installer... dsm | ❯ ERROR: Failed to extract /storage/dsm.rd, reason 2 dsm exited with code 92 dsm | rm: cannot remove '/storage/tmp/etc/ssl/certs': Is a directory dsm | rm: cannot remove '/storage/tmp/etc/sysconfig/network-scripts': Is a directory dsm | rm: cannot remove '/storage/tmp/etc/sysconfig/networking': Is a directory dsm | rm: cannot remove '/storage/tmp/dev/net': Is a directory dsm | rm: cannot remove '/storage/tmp/run/lock': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/bin': Directory not empty dsm | rm: cannot remove '/storage/tmp/usr/sbin': Directory not empty dsm | rm: cannot remove '/storage/tmp/usr/syno/bin': Directory not empty dsm | rm: cannot remove '/storage/tmp/usr/syno/share': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/installer': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/cht': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/dan': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/hun': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/nld': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/ptb': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/ptg': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/spn': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/texts/jslib/sve': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web/webman': Is a directory dsm | rm: cannot remove '/storage/tmp/usr/syno/web_rd': Is a directory dsm | rm: cannot remove '/storage/tmp/var/crash': Is a directory dsm | rm: cannot remove '/storage/tmp/var/lib': Is a directory dsm | rm: cannot remove '/storage/tmp/var/log': Is a directory dsm | rm: cannot remove '/storage/tmp/var/packages': Is a directory dsm | rm: cannot remove '/storage/tmp/volume1': Is a directory dsm | ❯ ERROR: Status 1 while: rm -rf "$STORAGE/tmp" (line 67/9) dsm exited with code 1

Thanks.

kroese commented 6 months ago

This has something to do with the filesystem. That it cannot work on FAT32 is to be expected, because it cannot handle files larger than 4GB and the DSM system image is 4.9 GB.

On NTFS it should work, but on NTFS the script normally makes use of the containers internal /tmp and in your logs I see /storage/tmp being used, so this detection fails somehow.

Can you set:

environment:
  DEBUG: "Y"

In your compose file, and send me the very first line of the output when using the APFS or NTFS filesystems where it fails?

It should look something like this:

+++ stat -f -c %T /storage
++ FS=XXX

If I know how Docker on MacOS reports those filesystems, I can fix your problem by detecting it and using the internal /tmp in those cases during installation.

alansw84 commented 6 months ago

I'm using Mac OS Extended (Journaled) filesystem and captured the error below:

dsm | ++ error 'Failed to extract /storage/dsm.rd, reason 2' dsm | ++ printf %b%s%b '\E[1;31m❯ ' 'ERROR: Failed to extract /storage/dsm.rd, reason 2' '\E[0m\n' dsm | ❯ ERROR: Failed to extract /storage/dsm.rd, reason 2 dsm | ++ exit 92 dsm exited with code 92 dsm | +++ stat -f -c %T /storage dsm | ++ FS='UNKNOWN (0x6a656a63)' dsm | ++ [[ unknown (0x6a656a63) == \o\v\e\r\l\a\y ]] dsm | ++ [[ unknown (0x6a656a63) == \f\u\s\e ]] dsm | ++ [[ unknown (0x6a656a63) != \f\a\t ]] dsm | ++ [[ unknown (0x6a656a63) != \v\f\a\t ]] dsm | ++ [[ unknown (0x6a656a63) != \e\x\f\a\t ]] dsm | ++ [[ unknown (0x6a656a63) != \n\t\f\s ]] dsm | ++ [[ unknown (0x6a656a63) != \m\s\d\o\s* ]] dsm | ++ TMP=/storage/tmp dsm | ++ rm -rf /storage/tmp dsm | ++ mkdir -p /storage/tmp dsm | ++ ROOT_SPACE=536870912 dsm | +++ df --output=avail -B 1 / dsm | +++ tail -n 1 dsm | ++ SPACE=47401488384 dsm | ++ SPACE_MB=45206 dsm | ++ (( ROOT_SPACE > SPACE )) dsm | ++ MIN_SPACE=8589934592 dsm | +++ df --output=avail -B 1 /storage dsm | +++ tail -n 1 dsm | ++ SPACE=20950577152 dsm | ++ SPACE_GB=20 dsm | ++ (( MIN_SPACE > SPACE )) dsm | ++ '[' -t 1 ']' dsm | ++ PROGRESS=--progress=dot:giga dsm | ++ ROOT=Y dsm | ++ RDC=/storage/dsm.rd dsm | ++ '[' '!' -f /storage/dsm.rd ']' dsm | ++ '[' -f /storage/dsm.rd ']' dsm | ++ xz -dc dsm | ++ rc=1 dsm | ++ (( rc != 1 )) dsm | ++ cd /storage/tmp dsm | ++ cpio -idm dsm | ++ rc=2 dsm | ++ (( rc != 0 )) dsm | ++ ROOT=N dsm | ++ cd /storage/tmp dsm | ++ fakeroot cpio -idmu dsm | ++ rc=2 dsm | ++ (( rc != 0 )) dsm | ++ error 'Failed to extract /storage/dsm.rd, reason 2' dsm | ++ printf %b%s%b '\E[1;31m❯ ' 'ERROR: Failed to extract /storage/dsm.rd, reason 2' '\E[0m\n' dsm | ❯ ERROR: Failed to extract /storage/dsm.rd, reason 2 dsm | ++ exit 92 dsm exited with code 92

kroese commented 6 months ago

Okay I added a detection now for this filesystem. Its reported as UNKNOWN (0x6a656a63) which is a bit strange name, but in any case if you pull the latest v5.25 again it should be fixed now.

alansw84 commented 6 months ago

Yup, looks good now. Thanks a lot.