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 1654926

Summary: Trying to update product with gpgkey gives Value (NilClass) '' is not any of: ForemanTasks::Concerns::ActionSubject
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: Content CredentialsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0Keywords: Regression, Triaged
Target Milestone: Released   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-04 16:01:07 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:

Description Nikhil Kathole 2018-11-30 03:20:44 UTC
Description of problem:

Trying to update gpgkey of product gives error Value (NilClass) '' is not any of: ForemanTasks::Concerns::ActionSubject.


Version-Release number of selected component (if applicable):
Satellite 6.5 snap 5


How reproducible:
always

Steps to Reproduce:
1. # hammer -v -u admin -p changeme --output=csv product create --description="cRZfUAOfUsAbtFNOQlsl" --label="byMrTZxiRFxAWqKoqeZP" --name="nDyqHnxwspQgOTzyGvcE" --organization-id="1"
Message,Id,Name
Product created.,65,nDyqHnxwspQgOTzyGvcE

2.# hammer -v -u admin -p changeme --output=csv repository create --content-type="yum" --name="FHuBziZnUxTtYhY" --product-id="65" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Message,Id,Name
Repository created.,81,FHuBziZnUxTtYhY

3.# hammer -v -u admin -p changeme  repository info --id="81"
ID:                 81
Name:               FHuBziZnUxTtYhY
Label:              FHuBziZnUxTtYhY
Organization:       Default Organization
Red Hat Repository: no
Content Type:       yum
Mirror on Sync:     yes
URL:                http://inecas.fedorapeople.org/fakerepos/zoo3/
Publish Via HTTP:   yes
Published At:       http://sgi-uv20-01.rhts.eng.bos.redhat.com/pulp/repos/Default_Organization/Library/custom/byMrTZxiRFxAWqKoqeZP/FHuBziZnUxTtYhY/
Relative Path:      Default_Organization/Library/custom/byMrTZxiRFxAWqKoqeZP/FHuBziZnUxTtYhY
Download Policy:    on_demand
Product:            
    ID:   65
    Name: nDyqHnxwspQgOTzyGvcE
GPG Key:            

Sync:               
    Status: Not Synced
Created:            2018/11/30 02:44:11
Updated:            2018/11/30 02:44:12
Content Counts:     
    Packages:       0
    Source RPMS:    0
    Package Groups: 0
    Errata:         0
    Module Streams: 0

4. # hammer -v -u admin -p changeme --output=csv gpg create --key="/tmp/8xTQKuJach" --name="i5qBEgw5Z8" --organization-id="1"Message,Id,Name
GPG Key created.,2,i5qBEgw5Z8

5. # hammer -v -u admin -p changeme --output=csv product update --gpg-key="i5qBEgw5Z8" --id="65" --organization-id="1"
Could not update the product:
  Value (NilClass) '' is not any of: ForemanTasks::Concerns::ActionSubject.


Actual results:

Updating product with gpgkey gives error and 

production.log showed

2018-11-29T22:08:03 [I|app|] Started GET "/katello/api/gpg_keys?name=i5qBEgw5Z8&organization_id=1" for IP at 2018-11-29 22:08:03 -0500
2018-11-29T22:08:03 [I|app|d46a5] Processing by Katello::Api::V2::GpgKeysController#index as JSON
2018-11-29T22:08:03 [I|app|d46a5]   Parameters: {"name"=>"i5qBEgw5Z8", "organization_id"=>"1", "api_version"=>"v2", "gpg_key"=>{}}
2018-11-29T22:08:03 [I|app|d46a5] Authorized user admin(Admin User)
2018-11-29T22:08:03 [I|app|d46a5] Current user set to admin (admin)
2018-11-29T22:08:03 [I|app|d46a5]   Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0/app/views/katello/api/v2/gpg_keys/index.json.rabl within katello/api/v2/layouts/collection
2018-11-29T22:08:03 [I|app|d46a5]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0/app/views/katello/api/v2/gpg_keys/index.json.rabl within katello/api/v2/layouts/collection (9.4ms)
2018-11-29T22:08:03 [I|app|d46a5] Completed 200 OK in 37ms (Views: 8.8ms | ActiveRecord: 9.3ms)
2018-11-29T22:08:03 [I|app|] Started PUT "/katello/api/products/65" for 10.16.64.56 at 2018-11-29 22:08:03 -0500
2018-11-29T22:08:03 [I|app|966cc] Processing by Katello::Api::V2::ProductsController#update as JSON
2018-11-29T22:08:03 [I|app|966cc]   Parameters: {"gpg_key_id"=>2, "api_version"=>"v2", "id"=>"65", "product"=>{"gpg_key_id"=>2}}
2018-11-29T22:08:03 [I|app|966cc] Authorized user admin(Admin User)
2018-11-29T22:08:03 [I|app|966cc] Current user set to admin (admin)
2018-11-29T22:08:03 [I|aud|966cc] Katello::Product (65) update event on gpg_key_id , 2
2018-11-29T22:08:03 [E|bac|966cc] Value (NilClass) '' is not any of: ForemanTasks::Concerns::ActionSubject. (TypeError)
/opt/theforeman/tfm/root/usr/share/gems/gems/algebrick-0.7.3/lib/algebrick/type_check.rb:54:in `error'
/opt/theforeman/tfm/root/usr/share/gems/gems/algebrick-0.7.3/lib/algebrick/type_check.rb:26:in `Type!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.14.3/app/lib/actions/entry_action.rb:33:in `action_subject'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.9.0/app/lib/actions/katello/repository/update.rb:9:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.1/lib/dynflow/action.rb:493:in `block (3 levels) in execute_plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.1/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.1/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.1/lib/dynflow/middleware.rb:35:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.1/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.1/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.1/lib/dynflow/middleware.rb:18:in `pass'



Expected results: Successful product update with gpg key.


Additional info: This was working in 6.4.

Comment 5 Brad Buckingham 2018-12-04 16:01:07 UTC
This appears to be a duplicate of bug 1643818; therefore, closing.  If this is incorrect, please do re-open.  Thanks!

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