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

podman --remote does not work #7010

Closed
Luap99 opened this issue Jul 17, 2020 · 11 comments
Closed

podman --remote does not work #7010

Luap99 opened this issue Jul 17, 2020 · 11 comments
Assignees
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.

Comments

@Luap99
Copy link
Member

Luap99 commented Jul 17, 2020

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

/kind bug

Description

podman --remote does not work.
It looks like the options --remote and --url are simply ignored.
podman-remote works

Steps to reproduce the issue:

podman --remote --url "abcd" ps -a

Describe the results you received:
list of local containers

CONTAINER ID  IMAGE                            COMMAND               CREATED      STATUS                  PORTS   NAMES
02633c480efb  docker.io/library/alpine:latest  ls -la /test          2 weeks ago  Exited (0) 2 weeks ago          sad_wozniak
29502a4d9e70  docker.io/library/alpine:latest  top                   2 weeks ago  Created                         condescending_newton

Describe the results you expected:
list of remote containers or an error if the service is not running or the url was invalid
e.g. Error: Get "http://d/v1.0.0/libpod../../../_ping": dial unix ///run/podman/podman.sock: connect: no such file or directory

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

Output of podman version:

Version:      2.1.0-dev
API Version:  1
Go Version:   go1.14.4
Git Commit:   10c5f241231a55a90a37b9f578c84a6bb23ae33e
Built:        Fri Jul 17 22:19:23 2020
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.16.0-dev
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.18, commit: '
  cpus: 16
  distribution:
    distribution: debian
    version: unknown
  eventLogger: file
  hostname: pc
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.7.0-1-amd64
  linkmode: dynamic
  memFree: 1521647616
  memTotal: 16802889728
  ociRuntime:
    name: runc
    package: 'runc: /usr/bin/runc'
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc10+dev
      commit: 3c8da9dae0f3e673839d0fe3f0d862b9b2325f1c
      spec: 1.0.2-dev
  os: linux
  remoteSocket:
    path: /run/user/1000/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.4
      commit: unknown
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 2
  swapFree: 17121406976
  swapTotal: 17125339136
  uptime: 4h 25m 16.04s (Approximately 0.17 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/paul/.config/containers/storage.conf
  containerStore:
    number: 17
    paused: 0
    running: 0
    stopped: 17
  graphDriverName: vfs
  graphOptions: {}
  graphRoot: /home/paul/.local/share/containers/storage
  graphStatus: {}
  imageStore:
    number: 13
  runRoot: /run/user/1000/containers
  volumePath: /home/paul/.local/share/containers/storage/volumes
version:
  APIVersion: 1
  Built: 1595017163
  BuiltTime: Fri Jul 17 22:19:23 2020
  GitCommit: 10c5f241231a55a90a37b9f578c84a6bb23ae33e
  GoVersion: go1.14.4
  OsArch: linux/amd64
  Version: 2.1.0-dev

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 17, 2020
@Luap99
Copy link
Member Author

Luap99 commented Jul 17, 2020

I have the same problem with my fedora 32 box with podman v2.0.2.
I did no config changes.

@Luap99
Copy link
Member Author

Luap99 commented Jul 17, 2020

Here the log-level debug version:

$ bin/podman --remote --url "abcd" ps -a --log-level debug
INFO[0000] bin/podman filtering at log level debug      
DEBU[0000] Called ps.PersistentPreRunE(bin/podman --remote --url abcd ps -a --log-level debug) 
DEBU[0000] Ignoring libpod.conf EventsLogger setting "/home/paul/.config/containers/containers.conf". Use "journald" if you want to change this setting and remove libpod.conf files. 
DEBU[0000] Reading configuration file "/usr/share/containers/containers.conf" 
DEBU[0000] Merged system config "/usr/share/containers/containers.conf": &{Containers:{Devices:[] Volumes:[] ApparmorProfile:containers-default-0.16.0 Annotations:[] CgroupNS:host Cgroups:enabled DefaultCapabilities:[CAP_AUDIT_WRITE CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_KILL CAP_MKNOD CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID CAP_SYS_CHROOT] DefaultSysctls:[] DefaultUlimits:[] DefaultMountsFile: DNSServers:[] DNSOptions:[] DNSSearches:[] EnableLabeling:false Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] EnvHost:false HTTPProxy:false Init:false InitPath: IPCNS:private LogDriver:k8s-file LogSizeMax:-1 NetNS:slirp4netns NoHosts:false PidsLimit:2048 PidNS:private SeccompProfile:/usr/share/containers/seccomp.json ShmSize:65536k TZ: Umask:0022 UTSNS:private UserNS:host UserNSSize:65536} Engine:{CgroupCheck:false CgroupManager:systemd ConmonEnvVars:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] ConmonPath:[/usr/libexec/podman/conmon /usr/local/libexec/podman/conmon /usr/local/lib/podman/conmon /usr/bin/conmon /usr/sbin/conmon /usr/local/bin/conmon /usr/local/sbin/conmon /run/current-system/sw/bin/conmon] DetachKeys:ctrl-p,ctrl-q EnablePortReservation:true Env:[] EventsLogFilePath:/run/user/1000/libpod/tmp/events/events.log EventsLogger:file HooksDir:[/usr/share/containers/oci/hooks.d] ImageDefaultTransport:docker:// InfraCommand:/pause InfraImage:k8s.gcr.io/pause:3.2 InitPath:/usr/libexec/podman/catatonit LockType:shm Namespace: NetworkCmdPath: NoPivotRoot:false NumLocks:2048 OCIRuntime:runc OCIRuntimes:map[crun:[/usr/bin/crun /usr/sbin/crun /usr/local/bin/crun /usr/local/sbin/crun /sbin/crun /bin/crun /run/current-system/sw/bin/crun] kata:[/usr/bin/kata-runtime /usr/sbin/kata-runtime /usr/local/bin/kata-runtime /usr/local/sbin/kata-runtime /sbin/kata-runtime /bin/kata-runtime /usr/bin/kata-qemu /usr/bin/kata-fc] runc:[/usr/bin/runc /usr/sbin/runc /usr/local/bin/runc /usr/local/sbin/runc /sbin/runc /bin/runc /usr/lib/cri-o-runc/sbin/runc /run/current-system/sw/bin/runc]] PullPolicy:missing Remote:false RemoteURI: RemoteIdentity: ActiveService: ServiceDestinations:map[] RuntimePath:[] RuntimeSupportsJSON:[crun runc] RuntimeSupportsNoCgroups:[crun] RuntimeSupportsKVM:[kata kata-runtime kata-qemu kata-fc] SetOptions:{StorageConfigRunRootSet:false StorageConfigGraphRootSet:false StorageConfigGraphDriverNameSet:false StaticDirSet:false VolumePathSet:false TmpDirSet:false} SignaturePolicyPath:/etc/containers/policy.json SDNotify:false StateType:3 StaticDir:/home/paul/.local/share/containers/storage/libpod StopTimeout:10 TmpDir:/run/user/1000/libpod/tmp VolumePath:/home/paul/.local/share/containers/storage/volumes} Network:{CNIPluginDirs:[/usr/libexec/cni /usr/lib/cni /usr/local/lib/cni /opt/cni/bin] DefaultNetwork:podman NetworkConfigDir:/etc/cni/net.d/}} 
DEBU[0000] Reading configuration file "/etc/containers/containers.conf" 
DEBU[0000] Merged system config "/etc/containers/containers.conf": &{Containers:{Devices:[] Volumes:[] ApparmorProfile:containers-default-0.16.0 Annotations:[] CgroupNS:host Cgroups:enabled DefaultCapabilities:[CAP_AUDIT_WRITE CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_KILL CAP_MKNOD CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID CAP_SYS_CHROOT] DefaultSysctls:[] DefaultUlimits:[] DefaultMountsFile: DNSServers:[] DNSOptions:[] DNSSearches:[] EnableLabeling:false Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] EnvHost:false HTTPProxy:false Init:false InitPath: IPCNS:private LogDriver:k8s-file LogSizeMax:-1 NetNS:slirp4netns NoHosts:false PidsLimit:2048 PidNS:private SeccompProfile:/usr/share/containers/seccomp.json ShmSize:65536k TZ: Umask:0022 UTSNS:private UserNS:host UserNSSize:65536} Engine:{CgroupCheck:false CgroupManager:systemd ConmonEnvVars:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] ConmonPath:[/usr/libexec/podman/conmon /usr/local/libexec/podman/conmon /usr/local/lib/podman/conmon /usr/bin/conmon /usr/sbin/conmon /usr/local/bin/conmon /usr/local/sbin/conmon /run/current-system/sw/bin/conmon] DetachKeys:ctrl-p,ctrl-q EnablePortReservation:true Env:[] EventsLogFilePath:/run/user/1000/libpod/tmp/events/events.log EventsLogger:file HooksDir:[/usr/share/containers/oci/hooks.d] ImageDefaultTransport:docker:// InfraCommand:/pause InfraImage:k8s.gcr.io/pause:3.2 InitPath:/usr/libexec/podman/catatonit LockType:shm Namespace: NetworkCmdPath: NoPivotRoot:false NumLocks:2048 OCIRuntime:runc OCIRuntimes:map[crun:[/usr/bin/crun /usr/sbin/crun /usr/local/bin/crun /usr/local/sbin/crun /sbin/crun /bin/crun /run/current-system/sw/bin/crun] kata:[/usr/bin/kata-runtime /usr/sbin/kata-runtime /usr/local/bin/kata-runtime /usr/local/sbin/kata-runtime /sbin/kata-runtime /bin/kata-runtime /usr/bin/kata-qemu /usr/bin/kata-fc] runc:[/usr/bin/runc /usr/sbin/runc /usr/local/bin/runc /usr/local/sbin/runc /sbin/runc /bin/runc /usr/lib/cri-o-runc/sbin/runc /run/current-system/sw/bin/runc]] PullPolicy:missing Remote:false RemoteURI: RemoteIdentity: ActiveService: ServiceDestinations:map[] RuntimePath:[] RuntimeSupportsJSON:[crun runc] RuntimeSupportsNoCgroups:[crun] RuntimeSupportsKVM:[kata kata-runtime kata-qemu kata-fc] SetOptions:{StorageConfigRunRootSet:false StorageConfigGraphRootSet:false StorageConfigGraphDriverNameSet:false StaticDirSet:false VolumePathSet:false TmpDirSet:false} SignaturePolicyPath:/etc/containers/policy.json SDNotify:false StateType:3 StaticDir:/home/paul/.local/share/containers/storage/libpod StopTimeout:10 TmpDir:/run/user/1000/libpod/tmp VolumePath:/home/paul/.local/share/containers/storage/volumes} Network:{CNIPluginDirs:[/usr/libexec/cni /usr/lib/cni /usr/local/lib/cni /opt/cni/bin] DefaultNetwork:podman NetworkConfigDir:/etc/cni/net.d/}} 
DEBU[0000] Using conmon: "/usr/libexec/podman/conmon"   
DEBU[0000] Initializing boltdb state at /home/paul/.local/share/containers/storage/libpod/bolt_state.db 
DEBU[0000] Using graph driver vfs                       
DEBU[0000] Using graph root /home/paul/.local/share/containers/storage 
DEBU[0000] Using run root /run/user/1000/containers     
DEBU[0000] Using static dir /home/paul/.local/share/containers/storage/libpod 
DEBU[0000] Using tmp dir /run/user/1000/libpod/tmp      
DEBU[0000] Using volume path /home/paul/.local/share/containers/storage/volumes 
DEBU[0000] Set libpod namespace to ""                   
DEBU[0000] [graphdriver] trying provided driver "vfs"   
DEBU[0000] Initializing event backend file              
DEBU[0000] using runtime "/usr/bin/runc"                
DEBU[0000] using runtime "/usr/bin/crun"                
WARN[0000] Error initializing configured OCI runtime kata: no valid executable found for OCI runtime kata: invalid argument 
INFO[0000] Setting parallel job count to 49             
CONTAINER ID  IMAGE                            COMMAND               CREATED      STATUS                  PORTS   NAMES
02633c480efb  docker.io/library/alpine:latest  ls -la /test          2 weeks ago  Exited (0) 2 weeks ago          sad_wozniak
29502a4d9e70  docker.io/library/alpine:latest  top                   2 weeks ago  Created                         condescending_newton
DEBU[0000] Called ps.PersistentPostRunE(bin/podman --remote --url abcd ps -a --log-level debug) 

@afbjorklund
Copy link
Contributor

I had the same problem in the Ubuntu packaging. #6598 (comment)

Since the packages don't use the make system, but hack their own build system, they are prone to when the buildtags suddently change. In this case, it was renamed from "remoteclient" to "remote" - which caused the packaging script to build a local podman:

https://src.fedoraproject.org/rpms/podman/blob/master/f/podman.spec#_468

export BUILDTAGS+=" remoteclient"
%gobuild -o bin/%{name}-remote %{import_path}/cmd/%{name} is:open ubuntu remote 

https://github.com/containers/podman/blob/v2.0.2/Makefile#L25

REMOTETAGS ?= remote exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper containers_image_openpgp

bin/podman-remote: .gopathok $(SOURCES) go.mod go.sum $(PODMAN_VARLINK_DEPENDENCIES) ## Build with podman on remote environment
	$(GO_BUILD) $(BUILDFLAGS) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "${REMOTETAGS}" -o $@ $(PROJECT)/cmd/podman

Since 911b6d8 (containers/common@6dea667)


There is also no verification of this, so this regression just keeps on happening: #5298

Most likely it needs to have a test, that podman-remote/podman --remote actually is remote.

@lsm5 : Would it be possible to add some kind of regression check to the packaging scripts ?

Maybe the packaging issues with ubuntu and fedora should be reported somewhere else...

@Luap99
Copy link
Member Author

Luap99 commented Jul 18, 2020

The thing here is that podman-remote works fine.
The problem is that podman --remote does not work. It just ignores the remote and url options and executes the command always locally.

@vrothberg vrothberg assigned jwhonce and unassigned lsm5 Jul 20, 2020
@afbjorklund
Copy link
Contributor

The problem is that podman --remote does not work. It just ignores the remote and url options and executes the command always locally.

Right, I forgot about that bug. I see the same thing, just that we used podman-remote for "compatibility".
(which doesn't really work anyway, since the remote binary is called podman on Mac and Win platforms)

@afbjorklund
Copy link
Contributor

The thing here is that podman-remote works fine.

I can't seem to get $CONTAINER_HOST to work ?

@Luap99
Copy link
Member Author

Luap99 commented Jul 21, 2020

I can't seem to get $CONTAINER_HOST to work ?

Looks like you are right. I can reproduce this.

@afbjorklund
Copy link
Contributor

Also the url does not work without adding the default socket path at the end, which is different from how DOCKER_HOST works.

It would be nice if you only had to provide ssh://<user>@<host>[:port] (and then it would assume /run/podman/podman.sock)

@afbjorklund
Copy link
Contributor

The default setup assumes that you either log in as root, or that you access a user service and a user podman socket.

Added some details on how to be able to access the system socket while still logging in as a regular user, here: #6809

@rhatdan
Copy link
Member

rhatdan commented Jul 22, 2020

PRs welcome. There is work going on in podman system connection. But we should definitely add some support for DOCKER_HOST.

@Luap99
Copy link
Member Author

Luap99 commented Jul 25, 2020

I close this because the bug is fixed with #7042.
It also looks like the $CONTAINER_HOST one is fixed with #6938.

@Luap99 Luap99 closed this as completed Jul 25, 2020
jwhonce added a commit to jwhonce/podman that referenced this issue Jul 28, 2020
The assumed format for DOCKER_HOST is <schema>://<host>[:<port>][path].

If the ssh schema is used for DOCKER_HOST, "/run/podman/podman.sock"
is appended if path is not given.  All other schemas are assumed to
resolve to a destination running a Podman service as given.

usage: `$ DOCKER_HOST=ssh://root@localhost:22 bin/podman ps --all`

Issue: containersGH-7010
Signed-off-by: Jhon Honce <jhonce@redhat.com>
jwhonce added a commit to jwhonce/podman that referenced this issue Jul 28, 2020
The assumed format for DOCKER_HOST is <schema>://<host>[:<port>][path].

If the ssh schema is used for DOCKER_HOST, "/run/podman/podman.sock"
is appended if path is not given.  All other schemas are assumed to
resolve to a destination running a Podman service as given.

usage: `$ DOCKER_HOST=ssh://root@localhost:22 bin/podman ps --all`

Issue: containersGH-7010
Signed-off-by: Jhon Honce <jhonce@redhat.com>
jwhonce added a commit to jwhonce/podman that referenced this issue Jul 30, 2020
The assumed format for DOCKER_HOST is <schema>://<host>[:<port>][path].

If the ssh schema is used for DOCKER_HOST, "/run/podman/podman.sock"
is appended if path is not given.  All other schemas are assumed to
resolve to a destination running a Podman service as given.

usage: `$ DOCKER_HOST=ssh://root@localhost:22 bin/podman ps --all`

Issue: containersGH-7010
Signed-off-by: Jhon Honce <jhonce@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Sep 12, 2020
The assumed format for DOCKER_HOST is <schema>://<host>[:<port>][path].

If the ssh schema is used for DOCKER_HOST, "/run/podman/podman.sock"
is appended if path is not given.  All other schemas are assumed to
resolve to a destination running a Podman service as given.

usage: `$ DOCKER_HOST=ssh://root@localhost:22 bin/podman ps --all`

Issue: containersGH-7010
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Sep 12, 2020
Issue: containersGH-7010
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Sep 14, 2020
Issue: containersGH-7010
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 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.
Projects
None yet
Development

No branches or pull requests

6 participants