Bug 1193651

Summary: Deleting a docker-based repo shows an error in the background but the UI shows that everything is ok
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: Container ManagementAssignee: Partha Aji <paji>
Status: CLOSED ERRATA QA Contact: Kedar Bidarkar <kbidarka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: bkearney, daviddavis, ehelms, kbidarka
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/9420
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:40:27 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: 1190289    
Attachments:
Description Flags
log for creating and deleting the docker repo.
none
foreman-debug none

Description Og Maciel 2015-02-17 20:09:04 UTC
Created attachment 992869 [details]
log for creating and deleting the docker repo.

Description of problem:

When I delete an existing, un-syced docker based repository from my custom product, the UI shows that a task was triggered to delete the repo. If I move away from that page and re-visit it, the repo is indeed gone. However I am seeing a stacktrace generated in the logs when I delete the repo and I'm not sure what to make of it.

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

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.42-1.el6.noarch
* candlepin-common-1.0.21-1.el6.noarch
* candlepin-selinux-0.9.42-1.el6.noarch
* candlepin-tomcat6-0.9.42-1.el6.noarch
* elasticsearch-0.90.10-7.el6.noarch
* foreman-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-compute-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-debug-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-gce-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-libvirt-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-ovirt-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-postgresql-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-proxy-1.8.0-0.develop.201502121459git0207401.el6.noarch
* foreman-release-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* foreman-selinux-1.8.0-0.develop.201412151103gite2863e4.el6.noarch
* foreman-vmware-1.8.0-0.develop.201502121510git9edf91b.el6.noarch
* katello-2.2.0-1.201502171650git5cf9de7.el6.noarch
* katello-certs-tools-2.0.1-1.el6.noarch
* katello-common-2.2.0-1.201502171650git5cf9de7.el6.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-2.2.0-1.201502160627gite8ff373.el6.noarch
* katello-installer-base-2.2.0-1.201502160627gite8ff373.el6.noarch
* katello-repos-2.1.1-1.el6.noarch
* katello-server-ca-1.0-1.noarch
* openldap-2.4.39-8.el6.x86_64
* pulp-docker-plugins-0.2.2-1.el6.noarch
* pulp-katello-0.3-3.el6.noarch
* pulp-nodes-common-2.6.0-0.7.beta.el6.noarch
* pulp-nodes-parent-2.6.0-0.7.beta.el6.noarch
* pulp-puppet-plugins-2.6.0-0.7.beta.el6.noarch
* pulp-puppet-tools-2.6.0-0.7.beta.el6.noarch
* pulp-rpm-plugins-2.6.0-0.7.beta.el6.noarch
* pulp-selinux-2.6.0-0.7.beta.el6.noarch
* pulp-server-2.6.0-0.7.beta.el6.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-ldap_fluff-0.3.3-1.el6.noarch
* ruby193-rubygem-net-ldap-0.10.0-1.el6.noarch
* ruby193-rubygem-runcible-1.3.1-1.el6.noarch
* rubygem-hammer_cli-0.1.4-1.201502121207git0ab2866.el6.noarch
* rubygem-hammer_cli_foreman-0.1.4-1.201501221305git706b057.el6.noarch
* rubygem-hammer_cli_foreman_bootdisk-0.1.2-1.el6.noarch
* rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410gitc96619d.git.0.37f3704.el6.noarch
* rubygem-hammer_cli_gutterball-0.0.1-1.201501072024git01fe139.git.0.06e884f.el6.noarch
* rubygem-hammer_cli_import-0.10.4-1.el6.noarch
* rubygem-hammer_cli_katello-0.0.7-1.201502061831git68a34d6.git.0.9c4412d.el6.noarch
* sssd-ldap-1.11.6-30.el6.x86_64

How reproducible:


Steps to Reproduce:
1. Create a custom product
2. Add a custom docker-based repo for busybox and sync it
3. Add a custom docker-based repo for fedora/ssh and delete it while watching /var/log/foreman/production.log

Actual results:

NoMethodError: undefined method `[]' for nil:NilClass shows up in the logs


Expected results:


Additional info:

Comment 1 Og Maciel 2015-02-17 20:10:55 UTC
Created attachment 992870 [details]
foreman-debug

Comment 2 Partha Aji 2015-02-17 20:16:17 UTC
Created redmine issue http://projects.theforeman.org/issues/9420 from this bug

Comment 3 David Davis 2015-02-17 20:26:28 UTC
Was able to reproduce with a yum repo as well:

  Rendered /home/dadavis/Projects/katello/app/views/katello/api/v2/repositories/index.json.rabl within katello/api/v2/layouts/collection (1764.0ms)
NoMethodError: undefined method `[]' for nil:NilClass
/home/dadavis/Projects/katello/app/models/katello/glue/pulp/repo.rb:257:in `package_group_count'
/home/dadavis/Projects/katello/app/views/katello/api/v2/repositories/show.json.rabl:24:in `block in eval_source'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:152:in `call'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:152:in `node'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:114:in `block in compile_settings'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:113:in `each'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:113:in `compile_settings'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:58:in `block in to_hash'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:262:in `cache_results'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:49:in `to_hash'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:86:in `to_hash'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:48:in `block in render'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:380:in `cache_results'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:47:in `render'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:127:in `block in merge_engines_into_result'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:119:in `each'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:119:in `merge_engines_into_result'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:55:in `block in to_hash'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:262:in `cache_results'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:49:in `to_hash'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/multi_builder.rb:27:in `map'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/multi_builder.rb:27:in `to_a'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:88:in `to_hash'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:48:in `block in render'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:380:in `cache_results'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/engine.rb:47:in `render'
/home/dadavis/.rvm/gems/ruby-2.0.0-p594@foreman/gems/rabl-0.11.5/lib/rabl/builder.rb:124:in `block (2 levels) in merge_engines_into_result'

Comment 4 David Davis 2015-02-17 20:39:19 UTC
I'm hitting this every time I try to delete a repo from the repo index page. Doesn't seem to happen from the repo details page though.

Comment 5 Bryan Kearney 2016-03-22 22:02:12 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/9420 has been closed

Comment 6 Kedar Bidarkar 2016-05-25 11:34:12 UTC
Deletion of docker based repos was successful.

Tried with both,

a) synced docker repo content 
b) unsynced docker repo content

a) synced docker repo content
2016-05-25 07:30:49 [app] [I] Started PUT "/katello/api/v2/repositories/bulk/destroy?organization_id=1" for 10.65.223.59 at 2016-05-25 07:30:49 -0400
2016-05-25 07:30:49 [app] [I] Processing by Katello::Api::V2::RepositoriesBulkActionsController#destroy_repositories as JSON
2016-05-25 07:30:49 [app] [I]   Parameters: {"ids"=>[57], "organization_id"=>"1", "api_version"=>"v2", "repositories_bulk_action"=>{"ids"=>[57]}}
2016-05-25 07:30:49 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.32/app/views/katello/api/v2/common/bulk_async.json.rabl within katello/api/v2/layouts/resource (61.1ms)
2016-05-25 07:30:49 [app] [I] Completed 202 Accepted in 272ms (Views: 61.3ms | ActiveRecord: 28.6ms)

b) unsynced docker repo content 
2016-05-25 07:30:24 [app] [I] Started GET "/components/views/bst-modal.html" for 10.65.223.59 at 2016-05-25 07:30:24 -0400
2016-05-25 07:30:27 [app] [I] Started PUT "/katello/api/v2/repositories/bulk/destroy?organization_id=1" for 10.65.223.59 at 2016-05-25 07:30:27 -0400
2016-05-25 07:30:28 [app] [I] Processing by Katello::Api::V2::RepositoriesBulkActionsController#destroy_repositories as JSON
2016-05-25 07:30:28 [app] [I]   Parameters: {"ids"=>[58], "organization_id"=>"1", "api_version"=>"v2", "repositories_bulk_action"=>{"ids"=>[58]}}
2016-05-25 07:30:28 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.32/app/views/katello/api/v2/common/bulk_async.json.rabl within katello/api/v2/layouts/resource (89.3ms)
2016-05-25 07:30:28 [app] [I] Completed 202 Accepted in 373ms (Views: 104.9ms | ActiveRecord: 38.3ms)


VERIFIED With sa62-snap12.1

Comment 7 Bryan Kearney 2016-07-27 11:40:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501