Bug 1318741

Summary: Updating ostree repo name or URL throws: undefined method `name' for nil:NilClass
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: RepositoriesAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, bkearney
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-13 20:58:24 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:
Bug Depends On:    
Bug Blocks: 1321771    

Description Sachin Ghai 2016-03-17 16:13:40 UTC
Description of problem: I was trying to update ostree repo name and URL and on updating any of them, following error :

2]# hammer -u admin -p changeme repository update  --organization-id 1 --name custom_ostree --new-name custom_ostree_rhel --product ostree
Could not update the repository:
  undefined method `name' for nil:NilClass


production.log:
==============
2016-03-17 07:54:04 [app] [I] Started PUT "/katello/api/v2/repositories/33?organization_id=1" for 10.65.193.200 at 2016-03-17 07:54:04 -0400
2016-03-17 07:54:04 [app] [I] Processing by Katello::Api::V2::RepositoriesController#update as JSON
2016-03-17 07:54:04 [app] [I]   Parameters: {"content_type"=>"ostree", "docker_upstream_name"=>nil, "mirror_on_sync"=>true, "unprotected"=>true, "full_path"=>"http://cloud-qe-19.idmqe.lab.eng.bos.redhat.com/pulp/repos/Default_Organization/Library/custom/ostree/custom_ostree", "checksum_type"=>nil, "container_repository_name"=>nil, "download_policy"=>nil, "url"=>"http://download.eng.bos.redhat.com/rel-eng/Atomic-7.2-install_tree-20160218.0/", "relative_path"=>"Default_Organization/Library/custom/ostree/custom_ostree", "major"=>nil, "minor"=>nil, "gpg_key_id"=>nil, "content_id"=>nil, "content_view_version_id"=>1, "library_instance_id"=>nil, "product_type"=>"custom", "promoted"=>false, "ostree_branches"=>nil, "organization"=>{"name"=>"Default Organization", "label"=>"Default_Organization", "id"=>1}, "created_at"=>"2016-03-17 16:54:36 +0530", "updated_at"=>"2016-03-17 16:54:36 +0530", "id"=>"33", "name"=>"custom_ostree1", "label"=>"custom_ostree", "product"=>{"id"=>7, "cp_id"=>"1458203100867", "name"=>"ostree", "sync_plan"=>["name", "description", "sync_date", "interval", "next_sync"]}, "last_sync"=>{"id"=>"bda56e52-e9fe-448e-8589-56aba78e360b", "username"=>"admin", "started_at"=>"2016-03-17 16:55:51 +0530", "ended_at"=>"2016-03-17 16:55:52 +0530", "state"=>"stopped", "result"=>"warning", "progress"=>1}, "content_counts"=>{"docker_manifest"=>0, "docker_tag"=>0, "rpm"=>0, "package"=>0, "package_group"=>0, "erratum"=>0, "puppet_module"=>0}, "last_sync_words"=>"27 minutes", "gpg_key"=>nil, "environment"=>{"id"=>1}, "permissions"=>{"deletable"=>true}, "organization_id"=>"1", "api_version"=>"v2", "repository"=>{"id"=>"33", "name"=>"custom_ostree1", "created_at"=>"2016-03-17 16:54:36 +0530", "updated_at"=>"2016-03-17 16:54:36 +0530", "major"=>nil, "minor"=>nil, "gpg_key_id"=>nil, "library_instance_id"=>nil, "content_id"=>nil, "label"=>"custom_ostree", "content_view_version_id"=>1, "relative_path"=>"Default_Organization/Library/custom/ostree/custom_ostree", "url"=>"http://download.eng.bos.redhat.com/rel-eng/Atomic-7.2-install_tree-20160218.0/", "unprotected"=>true, "content_type"=>"ostree", "checksum_type"=>nil, "docker_upstream_name"=>nil, "mirror_on_sync"=>true, "download_policy"=>nil}}
2016-03-17 07:54:04 [foreman-tasks/action] [E] undefined method `name' for nil:NilClass (NoMethodError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.7/app/lib/actions/katello/repository/update.rb:16:in `plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/action.rb:461:in `block (3 levels) in execute_plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.10/lib/dynflow/middleware/stack.rb:26:in `call'



Version-Release number of selected component (if applicable):
sat6.2 snap4

How reproducible:
always

Steps to Reproduce:
1. create ostree repo
2. update name/URL
3.

Actual results:
 undefined method `name' for nil:NilClass

Expected results:
repo name/URL should be updated successfully

Additional info:

Comment 7 Brad Buckingham 2016-12-13 20:58:24 UTC
The issue raised by this bugzilla no longer appears in Satellite 6.2.4; therefore, going to close it.  Please feel free to re-open if there are any concerns or issues observed.


hammer> repository update --organization-id 1 --name ostree-zoo --new-name ostree-zoo-new --product ostree
[Foreman] Password for admin: 
Repository updated


hammer> repository info --organization-id 1 --name ostree-zoo-new --product ostree
ID:                 5
Name:               ostree-zoo-new
Label:              ostree-zoo
Organization:       Default Organization
Red Hat Repository: no
Content Type:       ostree
URL:                https://partha.fedorapeople.org/test-repos/ostree-zoo/
Publish Via HTTP:   no
Published At:       https://sat-snap-rhel7.example.com/pulp/ostree/web/Default_Organization/Library/custom/ostree/ostree-zoo
Relative Path:      Default_Organization/Library/custom/ostree/ostree-zoo
Download Policy:    
Product:            
    ID:   162
    Name: ostree
GPG Key:            

Sync:               
    Status: Not Synced
Created:            2016/12/13 20:51:51
Updated:            2016/12/13 20:53:11
Content Counts:     
    OSTree Branches: 0



hammer> repository update --organization-id 1 --name ostree-zoo-new --product ostree --url http://download.eng.bos.redhat.com/rel-eng/Atomic-7.2-tree-20160506.1/ostree/repo/
Repository updated



hammer> repository info --organization-id 1 --name ostree-zoo-new --product ostreeID:                 5
Name:               ostree-zoo-new
Label:              ostree-zoo
Organization:       Default Organization
Red Hat Repository: no
Content Type:       ostree
URL:                http://download.eng.bos.redhat.com/rel-eng/Atomic-7.2-tree-20160506.1/ostree/repo/
Publish Via HTTP:   no
Published At:       https://sat-snap-rhel7.example.com/pulp/ostree/web/Default_Organization/Library/custom/ostree/ostree-zoo
Relative Path:      Default_Organization/Library/custom/ostree/ostree-zoo
Download Policy:    
Product:            
    ID:   162
    Name: ostree
GPG Key:            

Sync:               
    Status: Not Synced
Created:            2016/12/13 20:51:51
Updated:            2016/12/13 20:55:06
Content Counts:     
    OSTree Branches: 0