docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.85k stars 285 forks source link

Volume mount failure after update #14129

Open andrea-reale opened 2 months ago

andrea-reale commented 2 months ago

Originally posted by @empiricompany in https://github.com/docker/for-win/issues/14126#issuecomment-2162517842


i've quit docker destop then unregister docker-desktop distro

 wsl --unregister docker-desktop
Annullamento della registrazione.
Operazione completata.
PS C:\Program Files\Docker\Docker\resources> Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Recurse

    Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss

Name                           Property
----                           --------
{0c2781b3-376f-487e-b7ac-cbdeb State            : 1
2ef197c}                       DistributionName : Ubuntu
                               Version          : 2
                               BasePath         : \\?\G:\wsl\Ubuntu
                               Flags            : 15
                               DefaultUid       : 1000
{c61c3faa-8dfd-4e8d-b380-c4f5b State            : 1
2c0f528}                       DistributionName : docker-desktop-data
                               Version          : 2
                               BasePath         : \\?\G:\wsl\Docker\data
                               Flags            : 15
                               DefaultUid       : 0

when i start Docker Desktop new docker-desktop image is being recreated in main

 Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Recurse

    Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss

Name                           Property
----                           --------
{0c2781b3-376f-487e-b7ac-cbdeb State            : 1
2ef197c}                       DistributionName : Ubuntu
                               Version          : 2
                               BasePath         : \\?\G:\wsl\Ubuntu
                               Flags            : 15
                               DefaultUid       : 1000
{5d74a824-7471-4e85-905e-7137f State            : 1
0a1e3b4}                       DistributionName : docker-desktop
                               Version          : 2
                               BasePath         : \\?\G:\wsl\Docker\main
                               Flags            : 15
                               DefaultUid       : 0
{c61c3faa-8dfd-4e8d-b380-c4f5b State            : 1
2c0f528}                       DistributionName : docker-desktop-data
                               Version          : 2
                               BasePath         : \\?\G:\wsl\Docker\data
                               Flags            : 15
                               DefaultUid       : 0

but still have the same error, i cannot start mysql image (HTTP code 400) unexpected - failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/9600bab832d53d5597f1a7f3ea6b3a07e17bd6ae3b71d3507217110581b28b0b" to rootfs at "/etc/mysql/conf.d/devilbox.cnf": mount /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/9600bab832d53d5597f1a7f3ea6b3a07e17bd6ae3b71d3507217110581b28b0b:/etc/mysql/conf.d/devilbox.cnf (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

this is my Diagnostic ID: 7668749B-AB75-45D5-B980-5DD616348E49/20240612091352

thanks for support

andrea-reale commented 2 months ago

@empiricompany can you please share a few more details about the content of your volume and the way you are intendingto attach the volume to the container (e.g., what are your -v options)?

Any other info that can help reproduce the issue would be very appreciated.

empiricompany commented 2 months ago

another container devilbox-httpd not return any error on mounting this /home/tony/devilbox/data/www⁠ -> /shared/httpd

but my /shared/httpd inside container is empty and /home/tony/devilbox/data/www⁠ is not empty

seems some issues with reference? there was some reference in docker-desktop distro that it's being deleted?

andrea-reale commented 2 months ago

there was some reference in docker-desktop distro that it's being deleted?

No, docker-desktop distro is stateless. We regularly delete and recreate it during updates or in normal operation.

Does downgrading to 4.30 or earlier help? This could help us understand if this is a regression on the new version or some other problem.

empiricompany commented 2 months ago

i've tried to downgrade to 4.30 too but not help myvers

andrea-reale commented 2 months ago

What's very surprising is that you correctly see the data from the volume explorer, which gets the data from the same place containers should. So I am suspecting something may be wrong in the containers configuration rather than the volumes per se.

Some more diagnostics that hopefully could help:

Can you run docker inspect on containers with problematic volumes and attach the output to the ticket?

Likewise, can you run docker volume inspect on problematic volumes and attach the output to the ticket, please?

Finally, and this is probably a silly question:

empiricompany commented 2 months ago

@andrea-reale this doesn't help:

  1. shutdown all my wsl, then start docker desktop
  2. disable / re-enable integration with distro

my distros

PS C:\Users\tony\Downloads> wsl --list --all --verbose
  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

distro

container devilbox-httpd-1 start regulary but mounted paths inside container are empty

/home/tony/devilbox/data/www⁠ -> /shared/httpd


❯ docker exec -it devilbox-httpd-1 /bin/bash                                                                                                                                             ─╯
bash-5.1# ls -l /shared/httpd/
total 0
docker inspect devilbox-httpd-1                                                                                    ─╯
[
    {
        "Id": "d180cc2466f262b64fde03df51cef919df113069508c62f6a2d88e3eea751b20",
        "Created": "2023-11-27T09:04:03.97331158Z",
        "Path": "/docker-entrypoint.sh",
        "Args": [],
        "State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2024-06-12T10:17:04.557948848Z",
            "FinishedAt": "2024-06-12T10:17:31.290841068Z"
        },
        "Image": "sha256:6391766f7a98c4a66045cf9d281bc168ceaab8512dfb3af8c4edf861f75faf1e",
        "ResolvConfPath": "/var/lib/docker/containers/d180cc2466f262b64fde03df51cef919df113069508c62f6a2d88e3eea751b20/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/d180cc2466f262b64fde03df51cef919df113069508c62f6a2d88e3eea751b20/hostname",
        "HostsPath": "/var/lib/docker/containers/d180cc2466f262b64fde03df51cef919df113069508c62f6a2d88e3eea751b20/hosts",
        "LogPath": "/var/lib/docker/containers/d180cc2466f262b64fde03df51cef919df113069508c62f6a2d88e3eea751b20/d180cc2466f262b64fde03df51cef919df113069508c62f6a2d88e3eea751b20-json.log",
        "Name": "/devilbox-httpd-1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/home/tony/devilbox/.devilbox/www:/var/www/default:ro",
                "/home/tony/devilbox/data/www:/shared/httpd:rw",
                "/home/tony/devilbox/cfg/nginx-stable:/etc/httpd-custom.d:rw",
                "/home/tony/devilbox/cfg/vhost-gen:/etc/vhost-gen.d:rw",
                "/home/tony/devilbox/log/nginx-stable:/var/log/httpd:rw",
                "/home/tony/devilbox/ca:/ca:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "devilbox_app_net",
            "PortBindings": {
                "443/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "443"
                    }
                ],
                "80/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "80"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "ConsoleSize": [
                0,
                0
            ],
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "private",
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": [],
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/e5e91b9a60bdfdf66beea579c2e13eb3c24e0a94183bf50d971894597097e433-init/diff:/var/lib/docker/overlay2/f2b6a5a78efe0249d8666fe762be146db251734b9b0a119951ccc18806063b9d/diff:/var/lib/docker/overlay2/933beafb76b9ed6c6ce05d9e951ffd758876b949b40d4462eabf0fa6f14d2f43/diff:/var/lib/docker/overlay2/9c3b3f198e8de431b11df52c846a5b18fa08d8d681b940167e6a27fa4b5e4d14/diff:/var/lib/docker/overlay2/08d79c308858455ee0257891954d869d4f9e83009837af8abd8661d73495e1ba/diff:/var/lib/docker/overlay2/7dff0e71d71006a77638c3233aecc271123a095ab4585faf2840279ff338e0ca/diff:/var/lib/docker/overlay2/f88ea07e5f2ffc425d459e57d75063af3d3dbea3846f48616520372d03683826/diff:/var/lib/docker/overlay2/e2132ff2c8db79900004990502ca06c38c56ec9c2236e606d9d3a8dc3aea6757/diff:/var/lib/docker/overlay2/5ddc4e485e787862f78567af706e5a58ae9ddb2327ef320fabfc99bd70923809/diff:/var/lib/docker/overlay2/691b15f20bc609bbb6129108b579d74e856ff6af171b83594bef052ca5a3e7f2/diff:/var/lib/docker/overlay2/e2e265386f486b4fb0c54d02158d2a37c14ab066df75167732075bde01e66349/diff:/var/lib/docker/overlay2/7293eeb2b54129788dd5d1d1fc5eff43589397aa48e603e87144c4d76c6aa822/diff:/var/lib/docker/overlay2/af1e2c665b650bfcc5da6989f9617c168119b4aca12a1f8654ac40fdf072f00e/diff:/var/lib/docker/overlay2/20b000b0753e4827de26f6ab40f3fdd662ea681ea5525609deb10dbd4ac32d62/diff:/var/lib/docker/overlay2/0ba31e1592b97720d907c957e659a8407f4c1ebb0e895abb0d1975b5914c35ed/diff:/var/lib/docker/overlay2/fe9b2da216210ae0f202653054e63a08b994f9da323fb072c618024e7d4d895c/diff",
                "MergedDir": "/var/lib/docker/overlay2/e5e91b9a60bdfdf66beea579c2e13eb3c24e0a94183bf50d971894597097e433/merged",
                "UpperDir": "/var/lib/docker/overlay2/e5e91b9a60bdfdf66beea579c2e13eb3c24e0a94183bf50d971894597097e433/diff",
                "WorkDir": "/var/lib/docker/overlay2/e5e91b9a60bdfdf66beea579c2e13eb3c24e0a94183bf50d971894597097e433/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/tony/devilbox/data/www",
                "Destination": "/shared/httpd",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/tony/devilbox/log/nginx-stable",
                "Destination": "/var/log/httpd",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/tony/devilbox/.devilbox/www",
                "Destination": "/var/www/default",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/tony/devilbox/ca",
                "Destination": "/ca",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/tony/devilbox/cfg/nginx-stable",
                "Destination": "/etc/httpd-custom.d",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/tony/devilbox/cfg/vhost-gen",
                "Destination": "/etc/vhost-gen.d",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "httpd",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "443/tcp": {},
                "80/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "MAIN_VHOST_ENABLE=1",
                "SVCTL_REMOTE_LOGS_ENABLE=1",
                "MAIN_VHOST_STATUS_ALIAS=/devilbox-httpd-status",
                "MASS_VHOST_SSL_GEN=1",
                "HTTP2_ENABLE=1",
                "MAIN_VHOST_BACKEND=conf:phpfpm:tcp:172.16.238.10:9000",
                "MASS_VHOST_ALIASES_ALLOW=/devilbox-api/:/var/www/default/api:http(s)?://(.*)$",
                "SVCTL_ENABLE=1",
                "MASS_VHOST_BACKEND=conf:phpfpm:tcp:172.16.238.10:9000",
                "MAIN_VHOST_SSL_CN=localhost,*.localhost,devilbox,*.devilbox,httpd",
                "MAIN_VHOST_SSL_TYPE=both",
                "TIMEZONE=UTC",
                "MASS_VHOST_BACKEND_REWRITE=file:backend.cfg",
                "SVCTL_LISTEN_PORT=9001",
                "SVCTL_PASS=mypassword",
                "WORKER_PROCESSES=auto",
                "MAIN_VHOST_SSL_GEN=1",
                "MASS_VHOST_ENABLE=1",
                "MASS_VHOST_DOCROOT_DIR=htdocs",
                "MAIN_VHOST_ALIASES_ALLOW=/devilbox-api/:/var/www/default/api, /vhost.d/:/etc/httpd",
                "MAIN_VHOST_STATUS_ENABLE=1",
                "SVCTL_LISTEN_ADDR=0.0.0.0",
                "NEW_UID=1000",
                "SVCTL_USER=supervisor",
                "WORKER_CONNECTIONS=1024",
                "MASS_VHOST_BACKEND_TIMEOUT=180",
                "MASS_VHOST_TLD_SUFFIX=.loc",
                "DOCKER_LOGS=0",
                "DEBUG_RUNTIME=1",
                "DEBUG_ENTRYPOINT=2",
                "NEW_GID=1000",
                "MASS_VHOST_TEMPLATE_DIR=.devilbox",
                "MAIN_VHOST_BACKEND_TIMEOUT=180",
                "MASS_VHOST_SSL_TYPE=both",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NGINX_VERSION=1.22.1",
                "NJS_VERSION=0.7.7",
                "PKG_RELEASE=1",
                "BUILD_DEPS=make \twget",
                "RUN_DEPS=ca-certificates \tbash \topenssl \tpy3-yaml \tshadow \tsupervisor",
                "MY_USER=nginx",
                "MY_GROUP=nginx",
                "HTTPD_START=/usr/sbin/nginx",
                "HTTPD_RELOAD=nginx -s reload",
                "HTTPD_VERSION=nginx -V 2\u003e\u00261 | head -1 | awk '{print $3}'",
                "VHOSTGEN_HTTPD_SERVER=nginx"
            ],
            "Cmd": null,
            "Image": "devilbox/nginx-stable:alpine-1.0",
            "Volumes": {
                "/ca": {},
                "/shared/httpd": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/docker-entrypoint.sh"
            ],
            "MacAddress": "02:42:ac:10:ee:0b",
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "c5aa0fffc803ae299bccc8b405fa52555b2e074a93ee00bf5b5aa30311ce7396",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.depends_on": "bind:service_started:false,php:service_started:false",
                "com.docker.compose.image": "sha256:6391766f7a98c4a66045cf9d281bc168ceaab8512dfb3af8c4edf861f75faf1e",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "devilbox",
                "com.docker.compose.project.config_files": "/home/tony/devilbox/docker-compose.yml,/home/tony/devilbox/docker-compose.override.yml",
                "com.docker.compose.project.working_dir": "/home/tony/devilbox",
                "com.docker.compose.service": "httpd",
                "com.docker.compose.version": "2.23.0",
                "desktop.docker.io/wsl-distro": "Ubuntu",
                "image": "devilbox/nginx-stable",
                "license": "MIT",
                "maintainer": "NGINX Docker Maintainers \u003cdocker-maint@nginx.com\u003e",
                "name": "cytopia's nginx stable image",
                "org.opencontainers.image.created": "2023-01-03 01:47:37+00:00",
                "org.opencontainers.image.name": "Nginx",
                "org.opencontainers.image.revision": "4d73a99c0f444c34b73ff42e8aa9615c4dbf533c",
                "org.opencontainers.image.version": "stable",
                "vendor": "devilbox"
            },
            "StopSignal": "SIGTERM"
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "fe2504b4889df1ef9f36fb90e394c4d780884cc490349846a87408886e0f2f0d",
            "SandboxKey": "/var/run/docker/netns/fe2504b4889d",
            "Ports": {},
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "devilbox_app_net": {
                    "IPAMConfig": {
                        "IPv4Address": "172.16.238.11"
                    },
                    "Links": null,
                    "Aliases": [
                        "devilbox-httpd-1",
                        "httpd",
                        "d180cc2466f2"
                    ],
                    "MacAddress": "",
                    "NetworkID": "6bca89ee8a4297fea1996a46b2cfd78ae27097b3d8e3d8bba7146e7ac6217833",
                    "EndpointID": "",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "DriverOpts": null,
                    "DNSNames": [
                        "devilbox-httpd-1",
                        "httpd",
                        "d180cc2466f2"
                    ]
                }
            }
        }
    }
]

this volume attached to devilbox-mysql-1 container

docker volume inspect devilbox_devilbox-mariadb-10.5                                                                                                                                   ─╯
[
    {
        "CreatedAt": "2024-02-07T11:42:20Z",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "devilbox",
            "com.docker.compose.version": "1.29.1",
            "com.docker.compose.volume": "devilbox-mariadb-10.5"
        },
        "Mountpoint": "/var/lib/docker/volumes/devilbox_devilbox-mariadb-10.5/_data",
        "Name": "devilbox_devilbox-mariadb-10.5",
        "Options": null,
        "Scope": "local"
    }
]

i can't locate my volume directory 2

wsl --system --distribution docker-desktop-data ls /var/lib/docker/volumes/
ls: cannot access '/var/lib/docker/volumes/': No such file or directory
wsl --system --distribution Ubuntu ls /var/lib/docker/
ls: cannot access '/var/lib/docker/': No such file or directory

but i can navigate them from Docker Desktop


this is normal? from my terminal i can navigate my distro cli

but from PowerShell i see

wsl --system --distribution Ubuntu ls /home/tony/devilbox/data/www
ls: cannot access '/home/tony/devilbox/data/www': No such file or directory
wsl --system --distribution Ubuntu ls /home/
wslg
andrea-reale commented 2 months ago

Thanks for sharing this extra info,

In relation to your attempts to share /var/lib/docker/volumes from the docker-desktop distribution or from the Ubuntu distribution. It is expected you won't find it there. That path is relative to the namespace where we run dockerd which is a bit "hidden" inside the docker-desktop distribution.

This is an internal detail that could change at any time, but if you're curious on exploring /var/lib/volumes manually you could look into /mnt/host/wsl/docker-desktop-data/version-pack-data/community/volumes.

Just to make sure: can you confirm that everything was working fine in 4.30.0 before you first updated to 4.31.0?

And one more attempt: can you please try to undo the settings.json config JSON you've made at the beginning of this thread and install the build shared in this comment? This would let us confirm or rule out whether the issue is related to having your distro in a different drive.

Thanks!

empiricompany commented 2 months ago

i don't know which version was before update to 4.31.0 but presumably was 4.30

removed from settings "customWslDistroDir": "G:\\wsl\\Docker",

wsl --shutdown

install build 154084

.\dockerdesktop154084.exe install --disable-version-check
PS C:\Users\tony\Downloads> -------------------------------------------------------------------------------->8
Version: 4.31.1 (154084)
Sha1:
Started on: 2024/06/13 15:36:04.688
Resources: C:\Users\tony\Downloads\resources
OS: Windows 10 Home
Edition: Core
Id: 2009
Build: 19045
BuildLabName: 19041.1.amd64fre.vb_release.191206-1406

fisrt docker desktop run stopped and give me this error derr

Diagnostic ID: 7668749B-AB75-45D5-B980-5DD616348E49/20240613153913

after i restart wsl manually docker desktop start but occurs always same issues on bind volume

empiricompany commented 2 months ago

i've also followed the alternative method described here without success: https://github.com/docker/for-win/issues/14118#issuecomment-2160071111

i've quit docker desktop, shutting down wsl, then i have copied my ext4.vhdx in place of docker_desktop.vhdx then restarted docker desktop i see all containers volume but always the same errors

i tried to change location from UI error

how can i overcome this issue?

Grasume commented 2 months ago

@andrea-reale ive been seeing this a bit since 4.30 launch. I can confirm that reverting back to 4.29 fixes my bindmounts that no longer work if i upgrade to 4.30

m-zanetti commented 2 months ago

I use docker compose setting shared volumes in compose.yml, not in docker desktop, and i don't have any problem even if i don't see them in docker desktop


UPDATE I use bind mounts

empiricompany commented 2 months ago

@Grasume i've also tried to downgrade to 4.29 too but issue still exist i've also tried to remove customWslDistroDir from settings

andrea-reale commented 2 months ago

@empiricompany I understand it's far from ideal but I am thinking:

Given that you can manually access the content of your volumes and, after having backed-up their content, can you try to delete them and re-create them again as well as the container using them?

Likewise for the bind mounts.

empiricompany commented 2 months ago

I did many tests but couldn't resolve it. In the end, I had to export the volumes from the Docker Desktop UI, then reset and recreate my stack with docker-compose. Then, I imported the individual volumes from the Docker Desktop UI.

But I no longer see docker-desktop-data.

wsl --list -v
  NAME              STATE           VERSION
* Ubuntu            Running         2
  docker-desktop    Running         2
 Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Recurse

    Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss

Name                           Property
----                           --------
{0c2781b3-376f-487e-b7ac-cbdeb State            : 1
2ef197c}                       DistributionName : Ubuntu
                               Version          : 2
                               BasePath         : \\?\G:\wsl\Ubuntu
                               Flags            : 15
                               DefaultUid       : 1000
{14d71ea2-878d-4c89-bfff-b4c09 State            : 1
bc265ac}                       DistributionName : docker-desktop
                               Version          : 2
                               BasePath         :
                               \\?\C:\Users\tony\AppData\Local\Docker\wsl\main
                               Flags            : 15
                               DefaultUid       : 0
dir C:\Users\tony\AppData\Local\Docker\wsl\disk

    Directory: C:\Users\tony\AppData\Local\Docker\wsl\disk

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        18/06/2024     09:57    24339546112 docker_data.vhdx
empiricompany commented 2 months ago

Now everything works, but if I attempt to move the data to another disk from the UI, it doesn't work

move

andrea-reale commented 2 months ago

Hi @empiricompany ,

sorry that you had to rebuild your setup, and I am glad that now your volumes work as expected.

Unfortunately, there is a known issue that prevents you from moving the data disk to a different drive from the UI. We are working on a fix.

In the meantime, if you wish to manually relocate the data disk you can:

  1. Quit docker destkop
  2. Backup your current docker_data.vhdx to a safe location.
  3. Edit the settings.json file. Set "customWslDistroDir": "G:\\wsl\\DockerDesktopWSL" (make sure that the directory already exists and is empty).
  4. Copy your docker_data.vhdx onto G:\wsl\DockerDesktopWSL\disk\docker_data.vhdx (make sure to keep your backup somewhere safe).
  5. Start Docker Desktop.

Let me know if that helps

empiricompany commented 2 months ago

Hi @empiricompany ,

sorry that you had to rebuild your setup, and I am glad that now your volumes work as expected.

Unfortunately, there is a known issue that prevents you from moving the data disk to a different drive from the UI. We are working on a fix.

In the meantime, if you wish to manually relocate the data disk you can:

1. Quit docker destkop

2. Backup your current `docker_data.vhdx` to a safe location.

3. Edit the  `settings.json` file. Set ` "customWslDistroDir": "G:\\wsl\\DockerDesktopWSL"` (make sure that the directory already exists and is empty).

4. Copy your `docker_data.vhdx` onto `G:\wsl\DockerDesktopWSL\disk\docker_data.vhdx` (make sure to keep your backup somewhere safe).

5. Start Docker Desktop.

Let me know if that helps

@andrea-reale I've already attempted this way, but the issue still persists