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

environment variable http_proxy cannot be overridden #6017

Closed
mybigman opened this issue Apr 28, 2020 · 7 comments
Closed

environment variable http_proxy cannot be overridden #6017

mybigman opened this issue Apr 28, 2020 · 7 comments
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

@mybigman
Copy link

/kind bug

Description

--env-host as no effect
http_proxy environment variable ignored.

Steps to reproduce the issue:

  1. set http_proxy environment variable

  2. podman run -dt --name test -e "http_proxy=http://1.1.1.1:1111" alpine:latest

  3. podman exec -it test sh

  4. env

Describe the results you received:

http_proxy takes on the host value regardless.
--env-host=false also has no effect

Describe the results you expected:

to change or unset it.

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

Output of podman version:

Version:            1.8.2
RemoteAPI Version:  1
Go Version:         go1.14
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.14
  podman version: 1.8.2
host:
  BuildahVersion: 1.14.3
  CgroupVersion: v2
  Conmon:
    package: conmon-2.0.14-1.fc32.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.14, commit: a08df20e61ed6795fd25cc9e27ef452cf3259c06'
  Distribution:
    distribution: fedora
    version: "32"
  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
  MemFree: 59408179200
  MemTotal: 67410444288
  OCIRuntime:
    name: crun
    package: crun-0.13-1.fc32.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.13
      commit: e79e4de4ac16da0ce48777afb72c6241de870525
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 33772531712
  SwapTotal: 33772531712
  arch: amd64
  cpus: 24
  eventlogger: journald
  hostname: theden.localdomain
  kernel: 5.6.3-300.fc32.x86_64
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: slirp4netns-1.0.0-1.fc32.x86_64
    Version: |-
      slirp4netns version 1.0.0
      commit: a3be729152a33e692cd28b52f664defbf2e7810a
      libslirp: 4.2.0
  uptime: 122h 9m 24.56s (Approximately 5.08 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  ConfigFile: /home/champ/.config/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-0.7.8-1.fc32.x86_64
      Version: |-
        fusermount3 version: 3.9.1
        fuse-overlayfs: version 0.7.8
        FUSE library version 3.9.1
        using FUSE kernel interface version 7.31
  GraphRoot: /home/champ/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 23
  RunRoot: /run/user/1000/containers
  VolumePath: /home/champ/.local/share/containers/storage/volumes

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

podman-1.8.2-2.fc32.x86_64

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

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 28, 2020
@mheon
Copy link
Member

mheon commented Apr 28, 2020

Hmm. Sounds like a bug.

For now, --http-proxy=false should disable adding proxy-related environment variables automatically.

@rhatdan
Copy link
Member

rhatdan commented Apr 28, 2020

This works in podman 1.9

# podman run -dt --name test -e "http_proxy=http://1.1.1.1:1111" alpine:latest
5bc8aa92c0a184cc98ce0e7f10088cabfad01a2b16b848863d5a92a9b89d94f9
# podman exec -it test env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TERM=xterm
http_proxy=http://1.1.1.1:1111
container=podman
HOSTNAME=
HOME=/root

@mheon
Copy link
Member

mheon commented Apr 28, 2020

@rhatdan Nope, if it's set on the host, we can't override.

mcs@Bellerophon $ sudo su -c "export http_proxy=http://2.2.2.2:2222; podman run -dt --name test -e "http_proxy=http://1.1.1.1:1111" alpine:latest"                                                                                                    130 ↵
9a9d418c8b2881d5d089d784d0504f2919b925f232bf2010b9df4a899be32ab0
mcs@Bellerophon $ sudo podman exec -t -i 9a9d418c8b2881d5d089d784d0504f2919b925f232bf2010b9df4a899be32ab0 bash
Error: executable file not found in $PATH: No such file or directory: OCI runtime command not found error
mcs@Bellerophon $ sudo podman exec -t -i 9a9d418c8b2881d5d089d784d0504f2919b925f232bf2010b9df4a899be32ab0 sh                                                                                                                                          127 ↵
/ # printenv
HOSTNAME=
SHLVL=1
HOME=/root
container=podman
http_proxy=http://2.2.2.2:2222
TERM=xterm
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
/ # 

@mheon
Copy link
Member

mheon commented Apr 28, 2020

mcs@Bellerophon $ podman -v
podman version 1.9.0

@rhatdan
Copy link
Member

rhatdan commented Apr 28, 2020

Ok so this sounds like a containers.conf thing?

@mheon
Copy link
Member

mheon commented Apr 28, 2020

or the http_proxy flag - don't think that one is handled by containers.conf

@mheon
Copy link
Member

mheon commented May 13, 2020

Fixed in master and v1.9.2

@mheon mheon closed this as completed May 13, 2020
@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

4 participants