Bug 1460097 - env from binary file secret produces invalid Docker header
Summary: env from binary file secret produces invalid Docker header
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.5.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Seth Jennings
QA Contact: Xiaoli Tian
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-09 06:19 UTC by Takayoshi Kimura
Modified: 2019-08-08 02:49 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-03 18:21:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Takayoshi Kimura 2017-06-09 06:19:57 UTC
Description of problem:

By mistake, put binary secret into container env var, container run fails with cryptic random message like:

$ oc logs hello-sinatra-3-f4v8x 
container_linux.go:247: starting container process caused "process_linux.go:291: setting cgroup config for ready process caused \"open /sys/fs/cgroup/cpu,cpuacct/system.slice/docker-ae38bec5b56d56780a990a2e9520af10861e6cc60b12373f769580feb1be5b5e.scope/cpu.shares: no such file or directory\""

container_linux.go:247: starting container process caused "process_linux.go:295: setting oom score for ready process caused \"write /proc/74956/oom_score_adj: invalid argument\""

$ oc secret new perl /usr/bin/perl
$ oc edit dc

     spec:
        containers:
        - env:
          - name: binary
            valueFrom:
              secretKeyRef:
                key: perl
                name: perl

The docker command for same works and it looks like docker filters some binary code for env:

# docker run --env "foo=`cat /usr/bin/perl`" --rm -it registry.access.redhat.com/rhel7  bash


Version-Release number of selected component (if applicable):

atomic-openshift-3.5.5.15-1.git.0.4b5f317.el7.x86_64
docker-1.12.6-16.el7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. See description
2.
3.

Actual results:

Failed with various random message, like cgroups file not found, invalid argument, invalid header, etc.

Expected results:

Better error message, or filter the binary like docker does.

Additional info:

Comment 1 Seth Jennings 2017-06-12 19:52:33 UTC
Related upstream issue:
https://github.com/kubernetes/kubernetes/issues/32432

Comment 9 Greg Blomquist 2019-07-03 18:21:36 UTC
This looks like it should be available since 3.10.  There are no customer updates in the case since before 2017, and the reported customer version was 3.4.

Closing current release.  If this issue persists with the customer, please reopen with additional information.


Note You need to log in before you can comment on or make changes to this bug.