Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1209639

Summary: Bad URI error message when creating Docker container from Docker Hub page
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: Container ManagementAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Og Maciel <omaciel>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: daviddavis, mmccune, paji
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/10404
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 14:02:25 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:
Attachments:
Description Flags
Error when creating new container
none
foreman-debug
none
Searching returns strange names none

Description Og Maciel 2015-04-07 21:16:59 UTC
Created attachment 1011934 [details]
Error when creating new container

Description of problem:

Trying to create a new Docker container using the Docker Hub form is now failing with a bad URI error (see attached screenshot).

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


How reproducible:


Steps to Reproduce:
1. Create a new Docker container
2. Select the proper compute resource
3. Select the Docker Hub form
4. Type 'wordpress' and then click the 'search' button (ie. magnifying glass button)

Actual results:

The screenshot shows an error message. Also, the message says to use the "Foreman ticketing system" instead of Red Hat Bugzilla.

Expected results:


Additional info:

Comment 1 Og Maciel 2015-04-07 21:17:58 UTC
==> /var/log/messages <==
Apr  7 17:08:05 ibm-x3250m4-03 docker: time="2015-04-07T17:08:05-04:00" level="info" msg="GET /v1.15/images/search?term=fedora"
Apr  7 17:08:05 ibm-x3250m4-03 docker: time="2015-04-07T17:08:05-04:00" level="info" msg="+job search(fedora)"
Apr  7 17:08:05 ibm-x3250m4-03 docker: time="2015-04-07T17:08:05-04:00" level="info" msg="+job resolve_repository(fedora)"
Apr  7 17:08:05 ibm-x3250m4-03 docker: time="2015-04-07T17:08:05-04:00" level="info" msg="+job resolve_repository(docker.io/fedora)"
Apr  7 17:08:05 ibm-x3250m4-03 docker: time="2015-04-07T17:08:05-04:00" level="info" msg="-job resolve_repository(fedora) = OK (0)"
Apr  7 17:08:05 ibm-x3250m4-03 docker: time="2015-04-07T17:08:05-04:00" level="info" msg="-job resolve_repository(docker.io/fedora) = OK (0)"

==> /var/log/foreman/production.log <==
2015-04-07 17:08:05 [I] Processing by ImageSearchController#search_repository as TEXT
2015-04-07 17:08:05 [I]   Parameters: {"search"=>"fedora", "registry_id"=>"", "id"=>"2"}
2015-04-07 17:08:05 [I] String does not start with the prefix 'encrypted-', so ForemanDocker::Docker local_docker was not decrypted

==> /var/log/messages <==
Apr  7 17:08:06 ibm-x3250m4-03 docker: time="2015-04-07T17:08:06-04:00" level="info" msg="-job search(docker.io/fedora) = OK (0)"

==> /var/log/foreman/production.log <==
2015-04-07 17:08:06 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/foreman_docker-1.2.0.7/app/views/image_search/_repository_search_results.html.erb (23.5ms)
2015-04-07 17:08:06 [I] Completed 200 OK in 1190ms (Views: 24.2ms | ActiveRecord: 1.9ms)

==> /var/log/messages <==
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="GET /v1.15/images/docker.io:%20docker.io/fedora/json"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="+job image_inspect(docker.io: docker.io/fedora)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: No such image: docker.io: docker.io/fedora
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="-job image_inspect(docker.io: docker.io/fedora) = ERR (1)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="Handler for GET /images/{name:.*}/json returned error: No such image: docker.io: docker.io/fedora"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="HTTP Error: statusCode=404 No such image: docker.io: docker.io/fedora"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="GET /v1.15/images/docker.io:%20docker.io/fedora/json"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="+job image_inspect(docker.io: docker.io/fedora)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: No such image: docker.io: docker.io/fedora
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="-job image_inspect(docker.io: docker.io/fedora) = ERR (1)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="Handler for GET /images/{name:.*}/json returned error: No such image: docker.io: docker.io/fedora"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="HTTP Error: statusCode=404 No such image: docker.io: docker.io/fedora"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="GET /v1.15/images/docker.io:%20docker.io/fedora/json"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="+job image_inspect(docker.io: docker.io/fedora)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: No such image: docker.io: docker.io/fedora
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="-job image_inspect(docker.io: docker.io/fedora) = ERR (1)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="Handler for GET /images/{name:.*}/json returned error: No such image: docker.io: docker.io/fedora"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="HTTP Error: statusCode=404 No such image: docker.io: docker.io/fedora"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="GET /v1.15/images/docker.io:%20docker.io/fedora/json"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="+job image_inspect(docker.io: docker.io/fedora)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: No such image: docker.io: docker.io/fedora
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="info" msg="-job image_inspect(docker.io: docker.io/fedora) = ERR (1)"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="Handler for GET /images/{name:.*}/json returned error: No such image: docker.io: docker.io/fedora"
Apr  7 17:08:09 ibm-x3250m4-03 docker: time="2015-04-07T17:08:09-04:00" level="error" msg="HTTP Error: statusCode=404 No such image: docker.io: docker.io/fedora"

==> /var/log/foreman/production.log <==
2015-04-07 17:08:09 [I] Processing by ImageSearchController#auto_complete_image_tag as JSON
2015-04-07 17:08:09 [I]   Parameters: {"search"=>"docker.io: docker.io/fedora", "registry_id"=>"", "id"=>"2"}
2015-04-07 17:08:09 [I] String does not start with the prefix 'encrypted-', so ForemanDocker::Docker local_docker was not decrypted
2015-04-07 17:08:09 [W] Operation FAILED: bad URI(is not URI?): https://index.docker.io/v1/repositories/docker.io: docker.io/fedora/tags
2015-04-07 17:08:09 [I]   Rendered common/500.html.erb (3.6ms)
2015-04-07 17:08:09 [I] Completed 500 Internal Server Error in 145ms (Views: 4.1ms | ActiveRecord: 2.3ms)

Comment 2 Og Maciel 2015-04-07 21:19:55 UTC
Created attachment 1011935 [details]
foreman-debug

Comment 3 Og Maciel 2015-04-07 21:21:09 UTC
It looks like something regressed from last build, but I can't tell whether this is caused by a package change or API changes to Docker Hub.

Comment 4 Og Maciel 2015-04-07 21:30:00 UTC
Interesting that the same is not happening on a similar system with the same build, but running on RHEL 6.6. The error reported here happened on a RHEL 7.1 system.

Comment 6 Og Maciel 2015-04-08 19:54:03 UTC
Created attachment 1012402 [details]
Searching returns strange names

15:51:49 omaciel|QE: daviddavis: so, let me explain something else
15:52:11 omaciel|QE: daviddavis: I typed 'fedora'
15:52:18 omaciel|QE: and clicked the search button
15:52:33 omaciel|QE: the results returned have 'docker.io: docker.io/fedora
15:52:42 omaciel|QE: which I then select
15:52:59 omaciel|QE: the issue here is the names being displayed as valid options for me to select

Comment 7 Partha Aji 2015-04-09 15:24:20 UTC
For Beta we need to recommend using docker-1.4.1-37.el7.x86_64.rpm or docker-1.3.2-4.el7.x86_64.rpm

For GA we will probably try to get it to work with both versions or work with the latest.

Comment 8 Partha Aji 2015-05-06 23:29:11 UTC
Created redmine issue http://projects.theforeman.org/issues/10404 from this bug

Comment 9 Partha Aji 2015-05-06 23:32:34 UTC
Bug is easier stated this way
on centos 7 ->

$ docker version
Client version: 1.5.0-dev
Client API version: 1.18
Go version (client): go1.3.3

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io: docker.io/centos The official build of CentOS. 978 [OK]
docker.io: docker.io/ansible/centos7-ansible Ansible on Centos7 40 [OK]
.....

On fedora 20 ->
$ docker version
Client version: 1.5.0
Client API version: 1.17

$ docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 978 [OK]
ansible/centos7-ansible Ansible on Centos7 40 [OK]
......

Note the "docker.io: " prefix for the centos 7 name columns
http://rhelblog.redhat.com/2015/04/15/understanding-the-changes-to-docker-search-and-docker-pull-in-red-hat-enterprise-linux-7-1/ has details on why thats the case.

When you ask foreman-docker "search centos from docker hub", it gives you different names based on whether the docker compute resource is running on el7 or fedora 20. You then select an image and it shows the tags for that. Based on your selections it picks "NAME" as the repo name and chooses the tag. This works for docker compute instance running on f20 and used to work for docker instance on el7.

Anyway problem is simple -> "docker.io: docker.io/centos" is not a valid repo name. So foreman-docker has to somehow infer that "docker.io/centos" is what the repo name should be and strip out "docker.io: " while it should some how also work for "my-other-registry.com:4000/cool-repo" and not strip out "my-other-registry.com:4000".

Comment 10 Partha Aji 2015-05-19 23:58:15 UTC
https://github.com/theforeman/foreman-docker/pull/113 - should be fixed when this PR gets merged

Comment 11 Bryan Kearney 2015-05-20 10:08:49 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10404 has been closed
-------------
Partha Aji
Applied in changeset commit:foreman-docker|c36fdec1d3d287773284f8ef305782321a111e25.

Comment 13 Og Maciel 2015-05-22 14:37:22 UTC
Tested and verified that this works on current Satellite 6.1 GA SNAP 5 Compose 2 build under the following environments:

* RHEL 7.1
    * python-pulp-docker-common-0.2.5-1.el7sat.noarch
    * ruby193-rubygem-docker-api-1.17.0-1.1.el7sat.noarch
    * docker-selinux-1.6.0-11.el7.x86_64
    * ruby193-rubygem-foreman_docker-1.2.0.14-1.el7sat.noarch
    * pulp-docker-plugins-0.2.5-1.el7sat.noarch
    * docker-1.6.0-11.el7.x86_64
    * rubygem-hammer_cli_foreman_docker-0.0.3.6-1.el7sat.noarch

* RHEL 6.6
    * ruby193-rubygem-docker-api-1.17.0-1.1.el6_6sat.noarch
    * python-pulp-docker-common-0.2.5-1.el6_6sat.noarch
    * pulp-docker-plugins-0.2.5-1.el6_6sat.noarch
    * ruby193-rubygem-foreman_docker-1.2.0.14-1.el6_6sat.noarch
    * rubygem-hammer_cli_foreman_docker-0.0.3.6-1.el6_6sat.noarch
    * docker-io-1.5.0-1.el6.x86_64

Comment 14 Bryan Kearney 2015-08-11 13:28:09 UTC
This bug is slated to be released with Satellite 6.1.

Comment 15 Bryan Kearney 2015-08-12 14:02:25 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.