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 1218409 - Foreman docker CLI errors are not being reported correctly
Summary: Foreman docker CLI errors are not being reported correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Martin Bacovsky
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1218411 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-04 20:17 UTC by David Davis
Modified: 2017-02-23 20:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 16:02:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 10386 0 None None None 2016-04-22 15:07:21 UTC

Description David Davis 2015-05-04 20:17:09 UTC
Description of problem:

When I try to create a container twice, I get "Error: 422 Unprocessable Entity" but it doesn't tell me the actual validation error. The API is using the error template in foreman so I am not sure why the error isn't being displayed in the CLI.

$  hammer docker container create --name container1  --compute-resource-id 1 --repository-name redis --tag latest --command bash
Sucssefully created container.
$  hammer docker container create --name container1  --compute-resource-id 1 --repository-name redis --tag latest --command bash
Could not create the container:
  Error: 422 Unprocessable Entity

Comment 2 David Davis 2015-05-04 20:27:05 UTC
*** Bug 1218411 has been marked as a duplicate of this bug. ***

Comment 3 Martin Bacovsky 2015-05-05 20:32:19 UTC
Created redmine issue http://projects.theforeman.org/issues/10386 from this bug

Comment 4 Martin Bacovsky 2015-05-05 20:43:33 UTC
It seems that error handling does not inherit with command and is defined on module level. HammerCLIForemanDocker should specify error handling class. It fallbacks to the default otherwise.

PR submitted upstream.

Comment 5 Bryan Kearney 2015-05-06 08:05:50 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10386 has been closed

Comment 7 Tazim Kolhar 2015-05-21 12:14:08 UTC
here this bz is dependent on 
https://bugzilla.redhat.com/show_bug.cgi?id=1221387
hence once this is verified can proceed further
thanks

Comment 8 Tazim Kolhar 2015-05-22 07:57:28 UTC
this bz is dependent on https://bugzilla.redhat.com/show_bug.cgi?id=1224085
hence once this is verified can proceed further
thanks

Comment 9 Tazim Kolhar 2015-07-15 11:26:28 UTC
VERIFIED:

# rpm -qa | grep foreman
foreman-proxy-1.7.2.5-1.el7sat.noarch
ibm-hs22-05.rhts.eng.brq.redhat.com-foreman-client-1.0-1.noarch
ibm-hs22-05.rhts.eng.brq.redhat.com-foreman-proxy-1.0-2.noarch
foreman-gce-1.7.2.30-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
foreman-debug-1.7.2.30-1.el7sat.noarch
foreman-postgresql-1.7.2.30-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.17-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el7sat.noarch
foreman-1.7.2.30-1.el7sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.18-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.0-8.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el7sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.9-1.el7sat.noarch
ibm-hs22-05.rhts.eng.brq.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-compute-1.7.2.30-1.el7sat.noarch
foreman-vmware-1.7.2.30-1.el7sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
foreman-libvirt-1.7.2.30-1.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.8-1.el7sat.noarch
puppet-foreman_scap_client-0.3.3-9.el7sat.noarch
foreman-selinux-1.7.2.13-1.el7sat.noarch
foreman-ovirt-1.7.2.30-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch

steps:
#  hammer -d -v docker container create --name container1  --compute-resource-id 3 --repository-name rhel --tag latest --command bash
[ INFO 2015-07-15 13:20:02 Init] Initialization of Hammer CLI (0.1.4.11) has started...
[DEBUG 2015-07-15 13:20:02 Init] Running at ruby 2.0.0-p598
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2015-07-15 13:20:02 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2015-07-15 13:20:03 Connection] Registered: foreman
[DEBUG 2015-07-15 13:20:03 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2015-07-15 13:20:03 Modules] Extension module hammer_cli_foreman (0.1.4.14) loaded
[ INFO 2015-07-15 13:20:03 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.2.7) loaded
[ INFO 2015-07-15 13:20:03 Modules] Extension module hammer_cli_foreman_discovery (0.0.1.10) loaded
[ INFO 2015-07-15 13:20:03 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2015-07-15 13:20:03 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2015-07-15 13:20:03 Modules] Extension module hammer_cli_gutterball (0.0.1.3) loaded
[ INFO 2015-07-15 13:20:03 Modules] Extension module hammer_cli_import (0.10.18) loaded
[ INFO 2015-07-15 13:20:03 Modules] Extension module hammer_cli_katello (0.0.7.17) loaded
[DEBUG 2015-07-15 13:20:03 Init] Using locale 'en'
[DEBUG 2015-07-15 13:20:03 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.4.11/locale'
[DEBUG 2015-07-15 13:20:03 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2015-07-15 13:20:03 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.4.14/locale'
[DEBUG 2015-07-15 13:20:03 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[DEBUG 2015-07-15 13:20:03 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.3.9/locale'
[DEBUG 2015-07-15 13:20:03 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.7.17/locale'
[ INFO 2015-07-15 13:20:03 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true}
[ WARN 2015-07-15 13:20:03 HammerCLIForemanDocker::DockerRegistryCommand] Resource 'registries' does not exist in the API
[ INFO 2015-07-15 13:20:03 HammerCLIForemanDocker::DockerCommand] Called with options: {}
[ INFO 2015-07-15 13:20:03 HammerCLIForemanDocker::DockerContainerCommand] Called with options: {}
[ INFO 2015-07-15 13:20:03 HammerCLIForemanDocker::DockerContainerCommand::CreateCommand] Called with options: {"option_compute_resource_id"=>"3", "option_name"=>"container1", "option_repository_name"=>"rhel", "option_tag"=>"latest", "option_command"=>"bash"}
[ INFO 2015-07-15 13:20:03 API] POST /docker/api/v2/containers
[DEBUG 2015-07-15 13:20:03 API] Params: {
    "container" => {
                         "name" => "container1",
          "compute_resource_id" => "3",
              "repository_name" => "rhel",
                          "tag" => "latest",
                      "command" => "bash",
        "environment_variables" => {}
    }
}
[DEBUG 2015-07-15 13:20:03 API] Headers: {}
[Foreman] Username: admin
[Foreman] Password for admin: 
[DEBUG 2015-07-15 13:20:20 API] Response: {
          "attach_stderr" => nil,
           "attach_stdin" => nil,
          "attach_stdout" => nil,
             "capsule_id" => nil,
                "command" => "bash",
    "compute_resource_id" => 3,
                "cpu_set" => nil,
             "cpu_shares" => nil,
             "created_at" => "2015-07-15T11:20:17Z",
             "entrypoint" => nil,
                     "id" => 1,
                 "memory" => nil,
                   "name" => "container1",
            "registry_id" => nil,
        "repository_name" => "rhel",
                    "tag" => "latest",
                    "tty" => nil,
             "updated_at" => "2015-07-15T11:20:17Z",
                   "uuid" => "7bf6bb988fbd0a36257760ec93e9e0c373863bb9c0bfbaf8788aca7697d5cd3d"
}
[DEBUG 2015-07-15 13:20:20 API] Response headers: {
                   :date => "Wed, 15 Jul 2015 11:20:08 GMT",
                 :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
        :foreman_version => "1.7.2",
    :foreman_api_version => "2",
        :x_ua_compatible => "IE=Edge,chrome=1",
          :cache_control => "max-age=0, private, must-revalidate",
           :x_request_id => "7dfc4db8d366e301cfc167d83810573a",
              :x_runtime => "11.155161",
           :x_rack_cache => "invalidate, pass",
           :x_powered_by => "Phusion Passenger 4.0.18",
             :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWNkNmMwY2Y4MDg5ZDRmZGUzZjVhZmU4ZDQ4ZDkwMzQzBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--7f27217a43379b5ff25aaa2e2277b8232a125abb; path=/; secure; HttpOnly"
    ],
               :location => "https://localhost/containers/1",
                   :etag => "\"10d6e480339e17aef62dbd4062c3cfe5\"",
                 :status => "201 Created",
      :transfer_encoding => "chunked",
           :content_type => "application/json; charset=utf-8"
}
Docker container created

Comment 10 Bryan Kearney 2015-08-12 16:02:46 UTC
This bug was fixed in Satellite 6.1.1 which was delivered on 12 August, 2015.


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