Closed dotysan closed 3 weeks ago
Hi @dotysan,
thank you for sharing the issue and I am sorry if it caused disruption on your work.
Be reassured that, having your docker-desktop-data
distribution around, your data is fully recoverable. I am suggesting how to at the end of this message.
In order to help make sure we properly root cause your issue:
can you tell us if you ever moved your docker-desktop-data
distribution to a non-default location? (for example with wsl --export
and wsl --import
)?
can you please run the following command?
Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss" -Recurse
It should print a table listing all your WSL
distributions with some additional information about them.
BasePath
you see for docker-desktop-data
and whether that's different from %LOCALAPPDATA%\Docker\wsl\data
(in the common case, different from C:\Users\<username>\AppData\Local\Docker\wsl\data
)? UPDATE:
The following build should address the issue in all the cases where the source of the problem is having moved the docker-desktop-data
distribution manually (not through the UI) to a different location:
Docker Desktop Installer 4.31.1 - build 154084
Please, feel free to install it, use it and share any positive or negative feedback about it.
As usual, it can be good practice to take a backup of your existing docker-desktop-data
distribution. You can do so by running the following command, which will save a backup in your current folder:
wsl.exe --export docker-desktop-data docker-desktop-data-backup.tar
I am leaving the workaround I previously suggested below struck out for archival reasons. The build above should be preferred to the workaround in all cases.
If different, please take note of the
BasePath
you see in the output of the previous command. Let's say that for example it is D:\my_custom\path\data
.Please, note that it is important that the path ends by \data
; if it doesn't please see this comment.
In order to make sure that DockerDesktop will properly recognize your distribution you'll need to update your settings.json
file. To do so:
1. Quit DockerDestkop
2. Go to
%APPDATA%\Docker
(typically, C:\Users\<username>\AppData\Roaming\Docker) and open
settings.json` with your favorite editor.3. Find an entry called
customWslDistroDir
or create a new one if that doesn't exist.4. Enter the path that you have noted down before where your
docker-desktop-data
distribution resides, without the final data
component and using double slashes as your path separator (see example below).5. Remove the old docker-desktop
distribution (note well: docker-desktop
, and not docker-desktop-data
) with. At the next startup, it will be recreated at the new path you've specified in the settings.json
at the previous step.
wsl.exe --unregister docker-desktop
6. Shut down wsl with
wsl.exe --shutdown
(note that this will also stop any other WSL distribution you might have)7. Start Docker Desktop again
* For example, let's pretend your BasePath
is D:\my_custom\path\data
; your new entry in settings.json
should look like (note again the double slashes (\\
) and the absence of the data
suffix):
...
"customWslDistroDir": "D:\\my_custom\\path",
...
Please, let us know if this workaround works - I am happy to help further if it doesn't.
@andrea-reale i've changed customWslDistroDir i now see my containars
"customWslDistroDir": "G:\\wsl\\Docker",
"dataFolder": "C:\\ProgramData\\DockerDesktop\\vm-data",
but i cannot bind volumes
(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 config
Hive: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss
Name Property
---- --------
{09b470d7-5de5-4784-8df3-79c91 State : 1
a01128f} DistributionName : docker-desktop
Version : 2
BasePath : \\?\C:\Users\tony\AppData\Local\Docker\wsl\main
Flags : 15
DefaultUid : 0
{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
i have to change dataFolder with my docker-desktop new location too?
thanks @empiricompany. Can you try to:
wsl --unregister docker-desktop
(not docker-desktop-data)wsl --shutdown
(note that this will also stop any other WSL distribution you might have)At startup Docker Desktop will re-create the docker-desktop
distribution under G:\wsl\Docker\main
. It is OK to delete the old one, as it does not hold any state. Let me know if that helps.
If the problem still persists, please share a new diagnostics ID and I'll take a further look.
@andrea-reale 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
i see my volumes
the last one "devilbox_devilbox-mariadb-10.5" show 0 size but is not empty, i can navigate into them this is used by my container mysql that return errrors
i see strange things, in my images tab could see
then i refreshed and see it correct
maybe the same thing could happen with volumes? seems is not updated
@empiricompany I think this may be a different issue. I opened a new discussion here to dive deeper.
@andrea-reale thanks for the work-around steps - is it important to have the data/ suffix, or what to do when the BasePath does not have it? i.e. something like this:
{f0f362f1-9d97-4206-a300-1f422 State : 1
20fd2e5} DistributionName : docker-desktop-data
Version : 2
BasePath : \\?\D:\Docker
Flags : 15
DefaultUid : 0
EDIT: deprecated, please, just install the development build in the comment below
Hi @schmittjoh, and thanks for highlighting this case.
Yes, the \data
suffix in the path is important. Docker Desktop assumes to find one when looking for the distribution.
If you don't have it, you can always:
1. export the content of the distribution to your current directory. Make sure there are no errors.~
> wsl.exe --export docker-desktop-data docker-desktop-data-archive.tar
2. create the data directory at your favorite location. As an example we'll use D:\Docker\data
.
> mkdir "D:\Docker\data"
3. unregister the docker-desktop-data distribution, so that you can import it again in the next step
> wsl.exe --unregister docker-desktop-data
4. import the docker-desktop-data distribution again at the new location
> wsl.exe --import docker-desktop-data "D:\Docker\data" docker-desktop-data-archive.tar
Let me know how that goes.
The following development build should solve the issue and bring the data back for those who have moved their docker-desktop-data
distribution to another location. It does not require any change in the existing settings or whatsoever:
Docker Desktop Installer - 154084 dev build
Please, try this out and feel free to report any issue.
Thank you @andrea-reale. Yes indeed this system has a small C: and large D: so many things get moved to the larger volume.
I was able to successfully perform your suggested workaround of editing settings.json with a new customWslDistroDir. And all my stuff came back!
Might I suggest you un-strike this part of your comment above?
Before starting, I recommend to take a backup of your existing
docker-desktop-data
distribution. You can do so by running the following command, which will save a backup in your current folder:wsl.exe --export docker-desktop-data docker-desktop-data-backup.tar
The following development build should solve the issue and bring the data back for those who have moved their
docker-desktop-data
distribution to another location. It does not require any change in the existing settings or whatsoever:Docker Desktop Installer - 154084 dev build
Please, try this out and feel free to report any issue.
This solved it. Ive installed it, restarted computer and start docker. All containers are now visible again after disabliing "Only show running containers"
I had the same problem after upgrading to 4.31.1. All containers were missing. Indeed, "docker-desktop-data" is on another disk. The latest build (154084) works and everything is back in order...
The following development build should solve the issue and bring the data back for those who have moved their
docker-desktop-data
distribution to another location. It does not require any change in the existing settings or whatsoever:Docker Desktop Installer - 154084 dev build
Please, try this out and feel free to report any issue.
Thanks for this. My data is now back and Docker working as expected. My question now is how do we migrate over to the new data mode?
I see your walkthrough here https://github.com/docker/for-win/issues/14118#issuecomment-2160071111
However, the ext4.vhdx
is too big for my C: drive so cannot move it into AppData so I must have it in a different drive which I currently do.
Thanks all for confirming the fix.
@Alexr03 there is no need to manually migrate right now, as Docker Desktop will keep working exactly the same with the old and new architecture. In future versions, we plan that Docker Desktop will automatically perform the migration for you taking into account all your current setting, including a drive location different than the default one.
The following development build should solve the issue and bring the data back for those who have moved their
docker-desktop-data
distribution to another location. It does not require any change in the existing settings or whatsoever:Docker Desktop Installer - 154084 dev build
Please, try this out and feel free to report any issue.
@andrea-reale I also have docker-desktop-data on another logical Drive 'D:\Docker\wsl\data' . Can I safe delete %LocalAppData%\Docker\wsl\disk\docker_data.vhdx after installing Build 154084? P.S. All my volumes, containers and images come back.
@ExchangesInc yes, you can. Thank you
I am using 4.31.1.153621 and I am loosing data in the volumes that I have for my application that I am trying to manage with docker-compose.
My docker-compose is like this:
version: "3.7"
services:
nginx:
build: docker/nginx
restart: always
hostname: "nginx"
volumes:
- tng-app:/var/www/html
ports:
- "8080:80"
depends_on:
- php
networks:
- tng-network
php:
build: docker/php
hostname: "php"
volumes:
- tng-app:/var/www/html
- ./data-backups:/var/www/html/backups
- ./data-gedcom:/var/www/html/gedcom
depends_on:
- db
networks:
- tng-network
db:
image: mariadb:lts
container_name: db
hostname: "db"
environment:
MARIADB_USER: ${DB_USER}
MARIADB_PASSWORD: ${DB_PASSWORD}
MARIADB_DATABASE: ${DB_NAME}
MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
ports:
- "3306:3306"
restart: always
volumes:
- tng-db:/var/lib/mysql
networks:
- tng-network
networks:
tng-network:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16
gateway: 172.28.0.1
volumes:
tng-app:
tng-db:
I can't tell that I loose data every time, but occasionally I boot up with docker compose up
only to realize that tng-app volume is completely empty. I have lost the installation twice already.
In docker-desktop I can see multiple volumes:
tng-app - with seems as it is still having the data that I restored two days ago but Docker claims it is not in use actually tng-genealogy_tng-app - a new volume that is now empty for some reason tng-genealogy_tng-db - a volume that seems like it is still having my database data, but I am not completely sure.
How did I end up loosing data just now:
docker compose up -d
to run the application in daemon mode only to realize that all my data are lost:E:\DevelopmentE\docker\tng-genealogy>docker exec -ti tng-genealogy-php-1 bash
php:/var/www/html# ls
backups custom-backups gedcom
php:/var/www/html#
It seems to me that there is some change in behavior on how this version of Docker Desktop maintains the volumes and when it is using defaults like in this example:
volumes:
tng-app:
tng-db:
... he erases and recreates volumes every time You start up the application.
Is there any way to force persistence in this scenario?
Update:
I updated to the version: Docker Desktop Installer - 154084 dev build
I will try to recreate the application again, using volumes, and try again. It seems like the only safe way to use this, current version is using volumes as links to the local Windows folders.
Hi @xlavs ,
sorry about this behaviour. I think that what you are describing is independent on the issue discussed in this ticket (likely a separate problem).
Would you mind opening a new ticket with the information you have provided here, please, so that we can take a look into it?
In addition to the information you have already given it would be great if:
Thank you.
- even more ideally, if you could describe a simplified setup that we could replicate to replicate and address the issue.
I am now running a 154084 dev build. I will test my application there now and if that happens I will try to make a simpler setup to replicate this behavior. Once I will have the situation to replicate I will open a new ticket,
Thank You!
The following development build should solve the issue and bring the data back for those who have moved their
docker-desktop-data
distribution to another location. It does not require any change in the existing settings or whatsoever: Docker Desktop Installer - 154084 dev build Please, try this out and feel free to report any issue.This solved it. Ive installed it, restarted computer and start docker. All containers are now visible again after disabliing "Only show running containers"
Of all the awnsers, in my case,this was the one that resolved the problem! Thanks a lot!
Description
After upgrading from 4.30.0 (149282) to 4.31.1 (153621), there are no containers, images and volumes visible in the UI.
Reproduce
Expected behavior
Where'd my stuff go?!?
docker version
docker info
Diagnostics ID
1F426F3F-E329-4D5D-A1B5-EE0B70E796AB/20240612013103
Additional Info
I can see my old docker-desktop-data WSL distro is full of stuff. Hopefully all my lost stuff!