Open oenu opened 1 year ago
The Windows update issue currently has no solution, see #525, #482.
For the container issue, would you like to provide the output of:
$ docker image ls --format "{{.Repository}}:{{.Tag}} {{.ID}}"
In wsl
oenu@orbital:~$ docker image ls --format "{{.Repository}}:{{.Tag}} {{.ID}}"
The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.
For details about using Docker Desktop with WSL 2, visit:
https://docs.docker.com/go/wsl2/
In windows
PS C:\Users\username> docker image ls --format "{{.Repository}}:{{.Tag}} {{.ID}}"
error during connect: this error may indicate that the docker daemon is not running: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/images/json": open //./pipe/docker_engine: The system cannot find the file specified.
Sorry for the delay!
Docker wasnt started on the host machine, started it, ran the commands in both wsl and host, both returned nothing
In WSL, would u like to provide the output of:
$ topgrade --dry-run -v --only containers
Docker wasnt started on the host machine, started it, ran the commands in both wsl and host, both returned nothing
So, you do NOT have docker in WSL, but once it is started in the host, you can run the docker command even in WSL
oenu@orbital:~$ topgrade --dry-run -v --only containers
DEBUG Configuration at /home/oenu/.config/topgrade.toml
DEBUG No include paths found in /home/oenu/.config/topgrade.toml
DEBUG Loaded configuration: ConfigFile { include: Some(Include { paths: None }), misc: Some(Misc { pre_sudo: None, sudo_command: None, git_repos: None, predefined_git_repos: None, disable: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, git_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: None, yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, no_retry: None, run_in_tmux: None, cleanup: None, notify_each_step: None, accept_all_windows_updates: None, skip_notify: None, bashit_branch: None, only: None, no_self_update: None }), pre_commands: Some({}), post_commands: None, commands: Some({}), python: Some(Python { enable_pip_review: None, enable_pip_review_local: None, enable_pipupgrade: None, pipupgrade_arguments: None }), composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None, autoremove: None }), linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, dnf_arguments: None, nix_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, suse_dup: None, rpm_ostree: None, emerge_sync_flags: None, emerge_update_flags: None, home_manager_arguments: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None }), windows: Some(Windows { accept_all_updates: None, self_rename: None, open_remotes_in_new_terminal: None, enable_winget: None, wsl_update_pre_release: None, wsl_update_use_web_download: None }), npm: Some(NPM { use_sudo: None }), yarn: None, vim: None, firmware: Some(Firmware { upgrade: None }), vagrant: None, flatpak: Some(Flatpak { use_sudo: None }), distrobox: Some(Distrobox { use_root: None, containers: None }) }
DEBUG Version: 12.0.2
DEBUG OS: x86_64-unknown-linux-gnu
DEBUG Args { inner: ["topgrade", "--dry-run", "-v", "--only", "containers"] }
DEBUG Binary path: Ok("/home/oenu/.cargo/bin/topgrade")
DEBUG Self Update: false
DEBUG Detected "/usr/bin/git" as "git"
DEBUG Cannot find "pwsh"
DEBUG Cannot find "powershell"
DEBUG Path "/home/oenu/.config/emacs" doesn't exist
DEBUG Path "/home/oenu/.emacs.d" doesn't exist
DEBUG Cannot find "doas"
DEBUG Cannot find "please"
DEBUG Detected "/usr/bin/sudo" as "sudo"
DEBUG Step "Containers"
DEBUG Detected "/mnt/c/Program Files/Docker/Docker/resources/bin/docker" as "docker"
DEBUG Using container runtime '/mnt/c/Program Files/Docker/Docker/resources/bin/docker'
── 11:10:49 - Containers ───────────────────────────────────────────────────────
DEBUG Querying '/mnt/c/Program Files/Docker/Docker/resources/bin/docker image ls --format "{{.Repository}}:{{.Tag}}/{{.ID}}"' for containers
DEBUG Executing command `/mnt/c/Program Files/Docker/Docker/resources/bin/docker image ls --format '{{.Repository}}:{{.Tag}} {{.ID}}'`
DEBUG Using container ''
The application panicked (crashed).
Message: assertion failed: `(left == right)`
left: `1`,
right: `2`
Location: /home/oenu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/topgrade-12.0.2/src/steps/containers.rs:83
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
oenu@orbital:~$
some more info, looks like the docker command exists on WSL, but is aliased to a special command
oenu@orbital:~$ docker ps
The command 'docker' could not be found in this WSL 2 distro.
We recommend to activate the WSL integration in Docker Desktop settings.
For details about using Docker Desktop with WSL 2, visit:
https://docs.docker.com/go/wsl2/
((====////Same session, just started WSL on the host machine///===))
oenu@orbital:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
oenu@orbital:~$
Now
oenu@orbital:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
oenu@orbital:~$ topgrade --dry-run -v --only containers
DEBUG Configuration at /home/oenu/.config/topgrade.toml
DEBUG No include paths found in /home/oenu/.config/topgrade.toml
DEBUG Loaded configuration: ConfigFile { include: Some(Include { paths: None }), misc: Some(Misc { pre_sudo: None, sudo_command: None, git_repos: None, predefined_git_repos: None, disable: None, ignore_failures: None, remote_topgrades: None, remote_topgrade_path: None, ssh_arguments: None, git_arguments: None, tmux_arguments: None, set_title: None, display_time: None, assume_yes: None, yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, no_retry: None, run_in_tmux: None, cleanup: None, notify_each_step: None, accept_all_windows_updates: None, skip_notify: None, bashit_branch: None, only: None, no_self_update: None }), pre_commands: Some({}), post_commands: None, commands: Some({}), python: Some(Python { enable_pip_review: None, enable_pip_review_local: None, enable_pipupgrade: None, pipupgrade_arguments: None }), composer: Some(Composer { self_update: None }), brew: Some(Brew { greedy_cask: None, autoremove: None }), linux: Some(Linux { yay_arguments: None, aura_aur_arguments: None, aura_pacman_arguments: None, arch_package_manager: None, show_arch_news: None, garuda_update_arguments: None, trizen_arguments: None, pikaur_arguments: None, pamac_arguments: None, dnf_arguments: None, nix_arguments: None, apt_arguments: None, enable_tlmgr: None, redhat_distro_sync: None, suse_dup: None, rpm_ostree: None, emerge_sync_flags: None, emerge_update_flags: None, home_manager_arguments: None }), git: Some(Git { max_concurrency: None, arguments: None, repos: None, pull_predefined: None }), windows: Some(Windows { accept_all_updates: None, self_rename: None, open_remotes_in_new_terminal: None, enable_winget: None, wsl_update_pre_release: None, wsl_update_use_web_download: None }), npm: Some(NPM { use_sudo: None }), yarn: None, vim: None, firmware: Some(Firmware { upgrade: None }), vagrant: None, flatpak: Some(Flatpak { use_sudo: None }), distrobox: Some(Distrobox { use_root: None, containers: None }) }
DEBUG Version: 12.0.2
DEBUG OS: x86_64-unknown-linux-gnu
DEBUG Args { inner: ["topgrade", "--dry-run", "-v", "--only", "containers"] }
DEBUG Binary path: Ok("/home/oenu/.cargo/bin/topgrade")
DEBUG Self Update: false
DEBUG Detected "/usr/bin/git" as "git"
DEBUG Cannot find "pwsh"
DEBUG Cannot find "powershell"
DEBUG Path "/home/oenu/.config/emacs" doesn't exist
DEBUG Path "/home/oenu/.emacs.d" doesn't exist
DEBUG Cannot find "doas"
DEBUG Cannot find "please"
DEBUG Detected "/usr/bin/sudo" as "sudo"
DEBUG Step "Containers"
DEBUG Detected "/usr/bin/docker" as "docker"
DEBUG Using container runtime '/usr/bin/docker'
── 11:14:41 - Containers ───────────────────────────────────────────────────────
DEBUG Querying '/usr/bin/docker image ls --format "{{.Repository}}:{{.Tag}}/{{.ID}}"' for containers
DEBUG Executing command `/usr/bin/docker image ls --format '{{.Repository}}:{{.Tag}} {{.ID}}'`
DEBUG Containers to inspect: []
DEBUG /home/oenu/.ideavimrc does not exists
DEBUG /home/oenu/.intellimacs does not exists
DEBUG /home/oenu/.zshrc does not exists
DEBUG /home/oenu/.config/fish does not exists
DEBUG /home/oenu/.config/openbox does not exists
DEBUG /home/oenu/.config/bspwm does not exists
DEBUG /home/oenu/.config/i3 does not exists
DEBUG /home/oenu/.config/sway does not exists
── 11:14:41 - Summary ──────────────────────────────────────────────────────────
Containers: OK
DEBUG Desktop notification: Topgrade finished successfully
oenu@orbital:~$
Looks like an issue with detecting whether docker is running on the WSL install, probably needs a deeper check like --version or smt rather than which
Eg. WIth Docker desktop running on the host machine
oenu@orbital:~$ which docker
/usr/bin/docker
oenu@orbital:~$
With docker stopped on the host machine
oenu@orbital:~$ which docker
/mnt/c/Program Files/Docker/Docker/resources/bin/docker
oenu@orbital:~$
Done in the same session
Attached is entire session, info above for when Docker run or stopped
Attempted to write a fix (I do not know rust that well) https://github.com/oenu/topgrade/commit/0e941db0fde5c3cc8780dbc8dcd630e8ed97063d https://github.com/oenu/topgrade/commit/fa943eab471420cc099016bb352f6128f74b5a1f
This docker binary is on your host, but it is actually in the $PATH
of your WSL:
DEBUG Detected "/mnt/c/Program Files/Docker/Docker/resources/bin/docker" as "docker"
When the docker started, then you will have a docker
command under /usr/bin
(in WSL):
DEBUG Detected "/usr/bin/docker" as "docker"
And it seems that if the docker on your host is started, within the WSL, Topgrade can update it without any issues.
Looks like Microsoft aims to make the Windows host and the WSL fully integrated. Currently, I have the following questions to investigate:
Should we update such commands in Windows or WSL
prefer Windows since it is where the actual command is installed
Within WSL, is there any way we can know if a tool is installed natively in the WSL or is actually installed on the Windows host, then exported to WSL
If the binary is in the Windows partition (under "/mnt/c"), then it is easy to determine, but if a binary will be created under "/bin" (or other Linux bin paths), how can we tell if this is a WSL native app or not?
This is actually the first issue that reports such problems to Topgrade, are there any other commands (tools) that are also suffering from this issue
BTW, thanks for attempting to get it fixed:), but I think we need further investigation now
Yeah I figured out the hacky warning script they put in was the cause of the issue, but my rust skills are woeful, hopefully it's the thought that counts 😅
The Windows update issue currently has no solution, see #525, #482.
For the container issue, would you like to provide the output of:
$ docker image ls --format "{{.Repository}}:{{.Tag}} {{.ID}}"
v12.0.2
Erroneous Behavior
Running from admin Powershell 7, have ubuntu installed via wsl2
Expected Behavior
Steps to reproduce
topgrade -y
Problem persists without calling from topgrade