Description of problem: # hammer capsule content add-lifecycle-environment --id 1 --environment-id 3 Could not add the lifecycle environment to the capsule: ActiveRecord::RecordNotFound # hammer capsule list ---|---------------------------|--------------------------------------- ID | NAME | URL ---|---------------------------|--------------------------------------- 1 | capsule | https://capsule:9090 ---|---------------------------|--------------------------------------- [root@capsule repodata]# hammer capsule content available-lifecycle-environments --id 1 ---|----------|-------------- ID | NAME | ORGANIZATION ---|----------|-------------- 3 | GPS Unix | MyOrg 1 | Library | MyOrg ---|----------|-------------- [root@capsule repodata]# hammer capsule content add-lifecycle-environment --id 1 --environment-id 3 Could not add the lifecycle environment to the capsule: ActiveRecord::RecordNotFound This is the backtrace from /root/.foreman/log/hammer.log [ERROR 2014-07-28 14:30:24 API] 404 Resource Not Found { "errors" => [ [0] "ActiveRecord::RecordNotFound" ], "displayMessage" => "ActiveRecord::RecordNotFound" } [ERROR 2014-07-28 14:30:24 Exception] ActiveRecord::RecordNotFound [ERROR 2014-07-28 14:30:24 Exception] RestClient::ResourceNotFound (404 Resource Not Found): /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit' /usr/lib/ruby/1.8/net/http.rb:543:in `start' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute' /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/resource.rb:71:in `post' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `send' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:195:in `http_call' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/api.rb:151:in `call' /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.8/lib/apipie_bindings/resource.rb:14:in `call' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in `send_request' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:154:in `send_request' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in `run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 /usr/bin/hammer:19:in `load' /usr/bin/hammer:19
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.
1. can you upload a foreman-debug as well? That would give us more information 2. Is there a registered content host with the same exact name as the Capsule? If they don't match exactly you will get a similar error.
Workaround: Ensure that Capsule is registered as a content host (using subscription manager) and that the content host has the same name as the capsule. For example, if the Capulse is named "capsule.example.com", the Content Host needs to be named "capsule.example.com"
closing due to lack of feedback if this is still occurring please provide the requested info and re-open