Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1510574 - Corrupt policy.json not reported in stderr or in logs
Summary: Corrupt policy.json not reported in stderr or in logs
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: docker
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Antonio Murdaca
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-07 17:13 UTC by Aaron Weitekamp
Modified: 2018-05-29 12:00 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-29 12:00:45 UTC


Attachments (Terms of Use)

Description Aaron Weitekamp 2017-11-07 17:13:33 UTC
Description of problem:
When /etc/containers/policy.json is invalid json docker pull reports "unexpected end of JSON input". It does not tell the user which json file. The logs do not tell the user that there is any error.

Version-Release number of selected component (if applicable):
$ docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: <unknown>
 Go version:      go1.8.3
 Git commit:      b5e3294/1.13.1
 Built:           Wed Aug 16 13:58:20 2017
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: <unknown>
 Go version:      go1.8.3
 Git commit:      b5e3294/1.13.1
 Built:           Wed Aug 16 13:58:20 2017
 OS/Arch:         linux/amd64
 Experimental:    false

$ cat /etc/redhat-release 
Fedora release 26 (Twenty Six)

How reproducible:
always

Steps to Reproduce:
1. mangle /etc/containers/policy.json so it is invalid
2. docker pull fedora

Actual results:
$ docker pull fedora
Using default tag: latest
Trying to pull repository registry.fedoraproject.org/fedora ... 
Trying to pull repository registry.access.redhat.com/fedora ... 
Trying to pull repository docker.io/library/fedora ... 
unexpected end of JSON input

Expected results:
unexpected end of JSON input /etc/containers/policy.json
also log something in journal for docker.service

docker.service logs

Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.646240661-05:00" level=debug msg="Calling GET /_ping"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.646421429-05:00" level=info msg="{Action=_ping, Username=aweiteka, LoginUID=19340, PID=4207}"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.646634253-05:00" level=debug msg="AuthZ request using plugin rhel-push-plugin"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.647116294-05:00" level=debug msg="AuthZ response using plugin rhel-push-plugin"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.648771227-05:00" level=debug msg="Calling POST /v1.26/images/create?fromImage=fedora&tag=latest"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.648868326-05:00" level=info msg="{Action=create, Username=aweiteka, LoginUID=19340, PID=4207}"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.648981190-05:00" level=debug msg="AuthZ request using plugin rhel-push-plugin"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649527385-05:00" level=debug msg="hostDir: /etc/docker/certs.d/registry.fedoraproject.org"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649554897-05:00" level=debug msg="hostDir: /etc/docker/certs.d/registry.fedoraproject.org"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649586393-05:00" level=debug msg="Trying to pull registry.fedoraproject.org/fedora from https://registry.fedoraproject.org v2"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649632572-05:00" level=debug msg="Trying to pull registry.fedoraproject.org/fedora from https://registry.fedoraproject.org v1"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649720224-05:00" level=debug msg="hostDir: /etc/docker/certs.d/registry.access.redhat.com"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649742891-05:00" level=debug msg="hostDir: /etc/docker/certs.d/registry.access.redhat.com"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649771167-05:00" level=debug msg="Trying to pull registry.access.redhat.com/fedora from https://registry.access.redhat.com v2"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649812930-05:00" level=debug msg="Trying to pull registry.access.redhat.com/fedora from https://registry.access.redhat.com v1"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649897758-05:00" level=debug msg="Trying to pull docker.io/fedora from https://registry-1.docker.io v2"
Nov 07 10:10:26 aweiteka-t470s dockerd-current[3113]: time="2017-11-07T10:10:26.649952003-05:00" level=debug msg="AuthZ response using plugin rhel-push-plugin"

Comment 1 Antonio Murdaca 2017-11-07 17:53:18 UTC
We need to fix this in containers/image

Comment 2 Antonio Murdaca 2017-11-08 08:20:51 UTC
Fix for c/image is here https://github.com/containers/image/pull/378/commits/0917afecc935c2d0ecbcd005c5cbba40234792f5

Waiting to be merged, I'll backport it to docker once merged.

Comment 3 Antonio Murdaca 2017-11-08 08:51:04 UTC
Back ported a fix in docker-1.13.1[-rhel]

$ docker pull alpine           
Using default tag: latest
Trying to pull repository docker.io/library/alpine ... 
invalid policy data in "/etc/containers/policy.json": unexpected end of JSON input

Comment 4 Fedora End Of Life 2018-05-03 08:19:44 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2018-05-29 12:00:45 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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