Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1386569

Summary: Better error message on container start with failed sysctls
Product: Red Hat Enterprise Linux 7 Reporter: Stefan Schimanski <sttts>
Component: dockerAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: amurdaca, bbreard, dustymabe, lsm5
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-30 15:25:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1372658    

Description Stefan Schimanski 2016-10-19 09:06:29 UTC
Description of problem:

Running a container with sysctls which is rejected by the kernel gives a "System error: could not synchronise with container process." error message from the /container/<id>/start API call (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/start-a-container):

docker run -it --sysctl=kernel.shm_rmid_forced=hello ubuntu /bin/bash -c "sysctl kernel.shm_rmid_forced"                             sttts-sni
write /proc/sys/kernel/shm_rmid_forced: invalid argument
docker: Error response from daemon: Cannot start container 2424aea6711a7335b5ea1c171f544a39862fa2886240685b2b73a695a655487c: [9] System error: could not synchronise with container process.

The actual sysctl error shown above is from the container logs, not part of the error message of the API call. The later is too generic. Parsing logs in order to react properly on the error is not an option.

Compare this with e.g. the --user flags:

docker run -it -u foo ubuntu /bin/bash -c "sysctl kernel.shm_rmid_forced"                                                            sttts-sni
unable to find user foo: no matching entries in passwd file
docker: Error response from daemon: Cannot start container 7d63df9760ff964bd4a99e512c8d53777e8b59577959f47de8ad9285482fbe21: [9] System error: unable to find user foo: no matching entries in passwd file.

Here the error message is explicit.

Why is this relevant?

The Kubernetes kubelet must be able to react on sysctl errors properly, i.e. without restarting the container again and again. Instead the error should be reported to the user as an pod event. For that a proper, well known and stable error message is required. Parsing the logs for arbitrary plain text message is not a viable option here as such a message might change any time with future Docker versions or kernels.

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

v1.12

Expected results:

docker run -it --sysctl=kernel.shm_rmid_forced=hello ubuntu /bin/bash -c "sysctl kernel.shm_rmid_forced"                             sttts-sni
write /proc/sys/kernel/shm_rmid_forced: invalid argument
docker: Error response from daemon: Cannot start container 2424aea6711a7335b5ea1c171f544a39862fa2886240685b2b73a695a655487c: [9] System error: cannot write /proc/sys/kernel/shm_rmid_forced: invalid argument

Comment 2 Stefan Schimanski 2016-10-31 13:16:52 UTC
Any chance to backport this to our 1.10.x?

Comment 3 Dusty Mabe 2017-06-07 14:10:22 UTC
re-assigning to containers team, this may already be fixed