Bug 740254 - Stack trace calculating dependencies in changeset
Summary: Stack trace calculating dependencies in changeset
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high vote
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: Garik Khachikyan
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
Reported: 2011-09-21 13:14 UTC by Mike McCune
Modified: 2015-01-04 21:58 UTC (History)
3 users (show)

Fixed In Version: katello-0.1.235-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-08-22 17:57:34 UTC

Attachments (Terms of Use)

Description Mike McCune 2011-09-21 13:14:01 UTC
Steps to reproduce:

1) I setup a repo with a collection of packages
2) Promoted repo into next env
3) Added a series of packages to repo on disk, ran createrepo
4) Synced repo again into Katello
5) Went to promote a single package that was added during step 3 into a changeset.  This package had a series of dependencies that were also added in step 3.  Wanted to see those listed in the review step.
6) Saw error below:

Started GET "/katello/changesets/2/dependencies?_=1316610210722" for at Wed Sep 21 06:03:30 -0700 2011
  Processing by ChangesetsController#dependencies as 
  Parameters: {"id"=>"2", "_"=>"1316610210722"}
Setting locale: en
Setting current user thread-local variable to admin
Authorizing admin for changesets/dependencies
Resource GET request: /pulp/api/repositories/?groupid=env%3A1
Processing response: 200
Resource GET request: /pulp/api/repositories/?groupid=env%3A2
Processing response: 200
Resource GET request: /pulp/api/repositories/1316547604527-repo2-ACME_Corporation/packages/
Processing response: 200
Resource POST request: /pulp/api/services/dependencies/, {"pkgnames":["katello-0.1.83-1.git.17.fc6a2f6.fc15.noarch"],"repoids":["1316547604527-repo2-ACME_Corporation"]}
Processing response: 200
Setting current user thread-local variable to nil
Completed   in 1822ms
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.collect
#<NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.collect>
/home/mmccune/devel/katello/src/app/models/changeset.rb:123:in `calc_dependencies'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_collection.rb:431:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:216:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:216:in `each'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:216:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_proxy.rb:216:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.5/lib/active_record/associations/association_collection.rb:431:in `method_missing'
/home/mmccune/devel/katello/src/app/models/changeset.rb:93:in `calc_dependencies'
/home/mmccune/devel/katello/src/app/controllers/changesets_controller.rb:105:in `dependencies'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/abstract_controller/base.rb:150:in `process_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/action_controller/metal/rendering.rb:11:in `process_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.5/lib/abstract_controller/callbacks.rb:18:in `process_action'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:471:in `_run__2091943037__process_action__1450775643__callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/callbacks.rb:220:in `_conditional_callback_around_207750'
/home/mmccune/devel/katello/src/lib/util/threadsession.rb:77:in `thread_locals'

Comment 1 Tomas Strachota 2012-01-09 14:39:28 UTC
There's been many changes in dependency calculation since this bug was filed.
Dep. calculation works without any runtime exception in katello 0.1.171-1.

Comment 4 Garik Khachikyan 2012-02-10 14:11:22 UTC

I'm afraid but I need to reopen this issue for further investigations:

My scenario is: Let's assume we have built *some* katello packages:

Steps to do:
0. use org: ACME_Corporation
1. create env 
2. prepare provider/product/repo having file://</your/repodata/$(pwd)/here>
3. move some packages to another directory (let's say: katello, katello-all, katello-selinux)
4. createrepo ./ there
5. sync repo
6. prepare changeset and promote the content first time there
7. move back that 3 packages, recreate the repo again
8. re-sync repo
9. prepare another changest
10. add there *only* katello-0.1.230-1.el6.noarch
11. try to promote (and follow the /var/log/pulp/pulp.log)

For me it took about 10 min. and there were still processing a dependencies listing/calculation

Not sure if, let's say some of packages requires httpd, we need then go further and look for dependencies of httpd there ?

So to sumup - adding a simple package without some dependencies brings to some really long (maybe infinite?) loop there.

versions of reproducer:

Comment 5 Tomas Strachota 2012-02-12 22:53:45 UTC
Filtering already calculated dependencies was not working correctly and therefore circular dependencies were causing infinite loops.

Fixed in katello-0.1.235-1

Comment 6 Garik Khachikyan 2012-02-13 11:00:22 UTC

Really fixed now :)

I see added katello-selinux also while was adding katello package to the changeset only.

thanks Tomas for the fix.

checked against:

One note: there is a bug I've just opened which prevents syncing local repo-s until setenforce 0 is not set.

see: bz https://bugzilla.redhat.com/show_bug.cgi?id=789945

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