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 1218411 - Provisioning the same container name twice from the CLI it just gives "422 Unprocessable Entity"
Summary: Provisioning the same container name twice from the CLI it just gives "422 Un...
Keywords:
Status: CLOSED DUPLICATE of bug 1218409
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Katello Bug Bin
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-04 20:22 UTC by Elyézer Rezende
Modified: 2017-02-23 20:05 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-04 20:27:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Elyézer Rezende 2015-05-04 20:22:45 UTC
Description of problem:

When provisioning the same container name twice from CLI it returns the message "422 Unprocessable Entity". It should expose the message returned by API: "Name has already been taken"


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

Satellite-6.1.0-RHEL-7-20150429.2


How reproducible:
Aways


Steps to Reproduce:
1. hammer -u admin -p changeme docker container create --name hello --command bash --repository-name busybox --tag latest --compute-resource-id 1
2. hammer -v -d -u admin -p changeme docker container create --name hello --command bash --repository-name busybox --tag latest --compute-resource-id 1

Actual results:
A non clear message is being displayed

Expected results:
A better message should be displayed. API returns "Name has already been taken"

Additional info:

 hammer -v -d -u admin -p changeme docker container create --name hello --command bash --repository-name busybox --tag latest --compute-resource-id 1
[ INFO 2015-05-04 16:04:54 Init] Initialization of Hammer CLI (0.1.4.9) has started...
[DEBUG 2015-05-04 16:04:54 Init] Running at ruby 2.0.0-p598
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2015-05-04 16:04:54 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2015-05-04 16:04:55 Connection] Registered: foreman
[DEBUG 2015-05-04 16:04:55 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2015-05-04 16:04:55 Modules] Extension module hammer_cli_foreman (0.1.4.10) loaded
[ INFO 2015-05-04 16:04:55 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.2.6) loaded
[ INFO 2015-05-04 16:04:55 Modules] Extension module hammer_cli_foreman_discovery (0.0.1.8) loaded
[ INFO 2015-05-04 16:04:55 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2015-05-04 16:04:55 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2015-05-04 16:04:55 Modules] Extension module hammer_cli_import (0.10.6.5) loaded
[ INFO 2015-05-04 16:04:55 Modules] Extension module hammer_cli_katello (0.0.7.9) loaded
[DEBUG 2015-05-04 16:04:55 Init] Using locale 'en'
[DEBUG 2015-05-04 16:04:55 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.4.9/locale'
[DEBUG 2015-05-04 16:04:55 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2015-05-04 16:04:55 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.4.10/locale'
[DEBUG 2015-05-04 16:04:55 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[DEBUG 2015-05-04 16:04:55 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.3.2/locale'
[DEBUG 2015-05-04 16:04:55 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker@system' loaded from '/usr/share/locale'
[DEBUG 2015-05-04 16:04:55 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.7.9/locale'
[ INFO 2015-05-04 16:04:55 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2015-05-04 16:04:55 HammerCLIForemanDocker::DockerCommand] Called with options: {}
[ INFO 2015-05-04 16:04:55 HammerCLIForemanDocker::DockerContainerCommand] Called with options: {}
[ INFO 2015-05-04 16:04:55 HammerCLIForemanDocker::DockerContainerCommand::CreateCommand] Called with options: {"option_compute_resource_id"=>"1", "option_name"=>"hello", "option_repository_name"=>"busybox", "option_tag"=>"latest", "option_command"=>"bash"}
[ INFO 2015-05-04 16:04:55 API] POST /docker/api/v2/containers
[DEBUG 2015-05-04 16:04:55 API] Params: {
    "container" => {
                         "name" => "hello",
          "compute_resource_id" => "1",
              "repository_name" => "busybox",
                          "tag" => "latest",
                      "command" => "bash",
        "environment_variables" => {}
    }
}
[DEBUG 2015-05-04 16:04:55 API] Headers: {}
[DEBUG 2015-05-04 16:04:55 API] 422 Unprocessable Entity
{
           "errors" => {
        "name" => [
            [0] "has already been taken"
        ]
    },
    "full_messages" => [
        [0] "Name has already been taken"
    ]
}
[ERROR 2015-05-04 16:04:55 Exception] Error: 422 Unprocessable Entity
Could not create the container:
  Error: 422 Unprocessable Entity
[ERROR 2015-05-04 16:04:55 Exception]

RestClient::UnprocessableEntity (422 Unprocessable Entity):
    /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
    /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
    /usr/share/ruby/net/http.rb:852:in `start'
    /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
    /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    /usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:67:in `post'
    /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:279:in `call_client'
    /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:210:in `http_call'
    /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:160:in `call'
    /usr/share/gems/gems/apipie-bindings-0.0.11/lib/apipie_bindings/resource.rb:14:in `call'
    /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /usr/share/gems/gems/hammer_cli_foreman-0.1.4.10/lib/hammer_cli_foreman/commands.rb:185:in `send_request'
    /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/abstract.rb:23:in `run'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/abstract.rb:23:in `run'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/abstract.rb:23:in `run'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/share/gems/gems/hammer_cli-0.1.4.9/lib/hammer_cli/abstract.rb:23:in `run'
    /usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/share/gems/gems/hammer_cli-0.1.4.9/bin/hammer:108:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Comment 1 RHEL Program Management 2015-05-04 20:23:14 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 David Davis 2015-05-04 20:27:05 UTC

*** This bug has been marked as a duplicate of bug 1218409 ***


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