Skip to content
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

Invalid host socket when switching rootful mode on macOS #13783

Closed
benoitf opened this issue Apr 5, 2022 · 6 comments · Fixed by #13796
Closed

Invalid host socket when switching rootful mode on macOS #13783

benoitf opened this issue Apr 5, 2022 · 6 comments · Fixed by #13796
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine macos MacOS (OSX) related

Comments

@benoitf
Copy link
Contributor

benoitf commented Apr 5, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

With podman and machines, we can configure the rootless/rootful mode.
But if I configure the machine in rootful mode, the macOS host socket is still bound to the rootless mode

Steps to reproduce the issue:

  1. Create default machine (podman machine init) + podman machine start
  2. make it rootful : podman machine set --rootful
  3. run a command like podman run docker.io/httpd
  4. Check the containers available on the host socket:
curl -s -X GET --unix-socket $HOME/.local/share/containers/podman/machine/podman-machine-default/podman.sock "http:///libpod/containers/json" | jq

the container is not listed

Describe the results you received:
the container is not listed from the podman.sock on the host

Describe the results you expected:
the container should be listed from the podman.sock as it should be mapped to the rootful socket.

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Client:       Podman Engine
Version:      4.0.3
API Version:  4.0.3
Go Version:   go1.18
Built:        Fri Apr  1 17:28:59 2022
OS/Arch:      darwin/amd64

Output of podman info --debug:

(paste your output here)

Package info (e.g. output of rpm -q podman or apt list podman):

(paste your output here)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes/No

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 5, 2022
@benoitf benoitf changed the title Invalid host socket when using rootful mode Invalid host socket when using rootful mode on macOS Apr 5, 2022
@github-actions github-actions bot added the macos MacOS (OSX) related label Apr 5, 2022
@Luap99 Luap99 added the machine label Apr 5, 2022
@Luap99
Copy link
Member

Luap99 commented Apr 5, 2022

Does it work after machine stop && machine start again? I am not sure if we can change the socket while the VM is running.

@benoitf
Copy link
Contributor Author

benoitf commented Apr 5, 2022

on restart yes. But without restart, clients using the socket will display different containers/images than the podman container or podman images CLI

If it's not possible to change the socket, probably it should imply a restart of the machine.

when restarting it'll use the right socket

INFO[0013] Socket forward established: /Users/benoitf/.local/share/containers/podman/machine/podman-machine-default/podman.sock to /run/podman/podman.sock
API forwarding listening on: /Users/benoitf/.local/share/containers/podman/machine/podman-machine-default/podman.sock

while in rootless mode

INFO[0012] Socket forward established: /Users/benoitf/.local/share/containers/podman/machine/podman-machine-default/podman.sock to /run/user/501/podman/podman.sock

@benoitf benoitf changed the title Invalid host socket when using rootful mode on macOS Invalid host socket when switching rootful mode on macOS Apr 5, 2022
@Luap99
Copy link
Member

Luap99 commented Apr 6, 2022

@baude @n1hility Is it possible to change the socket while the VM is running?

If not we should at least document this or automatically restart the machine as @benoitf suggested.

@n1hility
Copy link
Member

n1hility commented Apr 6, 2022

Right it just stages the change, you have to restart for it to take affect. It should probably print something here. Alternatively we could detect if the machine instance is running and disallow changes. IMO it doesn't make sense to automatically restart since its destructive and unexpected.

@benoitf
Copy link
Contributor Author

benoitf commented Apr 6, 2022

I'm fine also on the proposal to disallow changes on a running machine.

In all cases I'm expecting consistency between CLI and socket.

Because for now CLI may not use what is provided by the socket. (cli is switched on the fly while socket require a restart)

@n1hility
Copy link
Member

n1hility commented Apr 6, 2022

Ah yes good point that the CLI changes immediately, that points to just disallowing when running

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine macos MacOS (OSX) related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants