Bug 1123971 - hammer capsule content add-lifecycle-environment ActiveRecord::RecordNotFound
Summary: hammer capsule content add-lifecycle-environment ActiveRecord::RecordNotFound
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: GSS_Sat6Beta_Tracker, GSS_Sat6_Tracker
TreeView+ depends on / blocked
 
Reported: 2014-07-28 18:34 UTC by Andrew Schofield
Modified: 2018-12-09 18:14 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 18:03:23 UTC
Target Upstream Version:
Embargoed:
andrew.schofield: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1135646 0 unspecified CLOSED Enabling repository throws Active Record error 2021-02-22 00:41:40 UTC

Internal Links: 1135646

Description Andrew Schofield 2014-07-28 18:34:22 UTC
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

Comment 1 RHEL Program Management 2014-07-28 19:03:51 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 4 Justin Sherrill 2014-08-15 14:51:00 UTC
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.

Comment 5 Justin Sherrill 2014-08-21 18:23:00 UTC
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"

Comment 6 Justin Sherrill 2014-10-14 18:03:23 UTC
closing due to lack of feedback if this is still occurring please provide the requested info and re-open


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