-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Podman Remote Client on Windows: Failed {{.Server.Version}} check #3929
Comments
Without spending time on all client-server overengineering I install podman on WSL Ubuntu 20.04 distro as my default distro and tried to run base dev container locally: C:\Users\Pavel>wsl -u root -e podman pod ls |
Podman remote issue: Podman service listens to the wrong socket |
@pfazio What is the console error? (Single quotes are only needed when run from a shell.) |
@chrmarti, please let me know if/how I can provide more detailed information -- this is my first VSCode-related GitHub issue, but with either "remote.containers.logLevel" set to info or debug, the console error is:
@PavelSosin-320, unfortunately my behavior differs from what you see when running Podman under WSL; without WSL, I can run all three commands from your post #3929 (comment) with apparent success. For further context on the use case, I am following the approach described in Red Hat's blog here: https://www.redhat.com/sysadmin/podman-clients-macos-windows. |
Indeed, I can do it now too with no problem. Maybe podman version issue or how Ubuntu 20.04 distro starts in WSL. But starting podman service is still impossible. I think 4 days is not enough to get podman.sock correction. Generation of Kubernetes YAML is still under development!Save the output of this file and use kubectl create -f to importit into Kubernetes.Created with podman-2.1.1Fromsudo podman run -dt --pod new:devcontainerfocal mcr.microsoft.com/vscode/devcontainers/basesudo podman create -dt --pod devcontainerfocal docker.io/python:latestapiVersion: v1
|
@pfazio Could you also check the Dev Container log? ( |
@chrmarti For some reason I'm not generating an actual Dev Container log file (a separate console error |
Not sure if and how we trigger that error message.
|
OK, I reached the fully functional "Remote Podman" on WSL Ubuntu 20.04 distro, the only ditro supporting systemd via workarround but I don't think that this scenario is valid. Unlike Docker engine that is server by design and
Podman is not a server. It is a toolbox for creation Cloud applications running on Kubernetes. This is Pod man, i.e tool for kick-start creation debugging and testing Kubernetes applications and services without spending mony on maintanence of Kubernetes infrastructure. It provides single pod player which can be run remotely and locally. |
@chrmarti I just tested the same scenario using CLI in my Podman-on-WSL landscape, without security, of corse and it works perfectly. It is possible to test it after Installation of Podman or Micro8k8s in Ubuntu distro and Podman Windows remote CLI for Windows after few simple steps: |
I have the same problem and the same error. Any updates on this? |
@MehrdadKhnzd Could you check the Dev Container log and post it here? ( |
@chrmarti Here your are:
I don't understand the problem. I can exactly run that command in my terminal, which works perfectly. Also, the term "The handle is invalid." seems to be a windows error, as I found lots of links for this error in various parts of Windows. I hope it helps! |
@MehrdadKhnzd Have you tried running the git command (line 3)? |
@chrmarti Yes, as it's not a git folder, it gives this error:
But it doesn't seem to be about that. Actually, it was the first time that it showed up in the third line, it's always on the second line, and if I repeat "Reopen in Container" after error, you only see the error for Podman.
|
I'm also seeing the same issue. vscode: 1.53.2 Podman 3.0.0 running on a Linux host, vscode running on windows 10. The command runs if I quote
|
The command is run without shell, so the parameters are passed directly and no quoting is required. The problem must be something else. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
I got a bit further by patching all arguments before they read podman. First of all, I noticed that there appears to be a very limited set of values that As noted above, how the command is run is crucial; VS Code seems to really want the intermediate shell. So let's give it just that: We'll write a short Python script (and maybe this step can be skipped) which does nothing but take a set of arguments, then run
import sys
import subprocess
cmd = "C:\\path\\to\\podman.exe --remote --url tcp://192.168.173.18:2566 "
cmd += ' '.join(sys.argv[1:])
subprocess.call(cmd, shell=True) Then, on your path (which must not contain @echo off
C:\\path\\to\\python.exe C:\\path\\to\\dockershim.py %* point being that at this point, the command does what it's supposed to:
Note that the At this point, VS Code will relaunch, the Dockerfile pointed to by the
This will become an actual problem if we just rely on TCP forwarding commands: Mounting will be impossible. But okay, let's see what else we might run into, so in our Python script, let's just remove the problematic part of the string to see if we can get anywhere: problematic_string = r"--mount type=bind,source=c:\Users\username\repos\remote-test,target=/workspaces/remote-test,consistency=cached --mount type=volume,src=vscode,dst=/vscode -l vsch.local.folder=c:\Users\username\repos\remote-test -l vsch.quality=stable -l vsch.remote.devPort=0"
cmd = cmd.replace(problematic_string, "") At this point, a container is actually started! The next problem one runs into is the following:
As before, by running the command standalone we can see why:
So, what do we do about that? Well, cmd = cmd.replace(" --format {{json .}} --filter event=start", "") A bit later, we run into this issue:
Since we removed these labels above, we would have to get the started container through other means. I'll just use a container I happen to know is running and which is based on if 'ps -q -a' in cmd:
print('468a584acd20')
else:
subprocess.call(cmd, shell=True) Next error is
This one is suspicious; the
Here, as above, the corresponding |
Seeing a new report on "handle is invalid" (#5545), has anyone made any progress on this issue? |
Hello there 👋🏼 Any news on this? I'm trying to build dev-servers for my teammates, this is basically blocking me... would be really good if there's a fix coming soon 😉 |
Thank you 👍🏼 Making progress. Now the volume init fails due to using a windows path in wsl:
|
With the latest podman remote client (3.4.0) on Windows, the original issue seems to be solved. It's no longer complaining about an invalid handle anymore when checking the version, without running the commands in WSL. Instead, it now has issues setting up an openSSH agent, but that might be an issue on my system. I'll clarify, and open a new issue if my problem persists. |
Hi, I have catch the similar issue, do you have any update for this, thanks.
The podman works on powershell
|
Hi, This is still an issue. Is there any update?
|
What do you get when you set |
That looks to break podman entirely @chrmarti podman version
podman ps
podman images
|
I seem to be having this issue on windows with Podman 4.2.0. When I attempt to reopen in container I get a dialog that says "Docker Desktop WSL 2 backend required". Looking at the logs I see:
This is attempting to utilize a podman install that works on windows (not installed inside a wsl2 distro). When attempting to run the
Running version without the format shows
It seems that something changed in the format parameter in podman's CLI and vscode is not comaptible with it. |
It looks like my previous post is wrong. The error seems to be because "Running on host" really means "running on WSL" even though I have "run commands on WSL" unchecked. So it's trying to run podman on WSL even though I don't have it installed in WSL.. |
Some of the discussed issues appear to be fixed in later versions of Podman. Please open new issues for any remaining problems. Thanks! |
When attempting to use the Remote - Containers extension in a manner similar to "Developing inside a container on a remote Docker host", but using Podman instead of Docker, Remote Explorer does not successfully load the list of running containers.
My Podman CLI remote client successfully accesses a remote Podman host over a tunneled SSH connection; using Podman CLI works locally (on Windows) as if the host were local (e.g.,
podman ps
works).However, when using VSCode, using Remote Explorer fails to display any containers ("Get started with containers by installing and starting Docker...", with a console error indicating a failure running
podman version --format {{.Server.Version}}
. I can reproduce that this command fails in a local PowerShell window, but surrounding the final argument with single quotes succeeds:The example in Docker's
docker version
documentation includes the quotes, but maybe Docker is more lenient than Podman?Installing the Remote - Containers extension directly on the (Linux) Podman host works as expected provided that the dockerPath is configured to use podman as per the documentation.
Steps to Reproduce:
"remote.containers.dockerPath": "podman"
{message: "Command failed: podman version --format {{.Server.Version}}", stdout: {…}, stderr: {…}, code: 1}
Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A
The text was updated successfully, but these errors were encountered: