Bug 840482

Summary: repo delete does not delete the sync schedules.
Product: [Retired] Pulp Reporter: Preethi Thomas <pthomas>
Component: user-experienceAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: high    
Version: 2.0.6CC: jason.dobies, jconnor
Target Milestone: ---   
Target Release: Sprint 38   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-07 14:09:13 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 Preethi Thomas 2012-07-16 13:21:43 UTC
Description of problem:
Deleting a repo which has planned syncing schedules doesn't seem to be deleting the sync plans. pulp tries to run the sync at the scheduled time and traceback appears in the log.

Version-Release number of selected component (if applicable):
[root@preethi-el6-pulp ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.313-1.el6.noarch


How reproducible:


Steps to Reproduce:
1.create a repo with feed
2. create a sync schedule for the repo
3.delete the repo
4. check the log at the scheduled time for the above repo
5. checke database
  
Actual results:

traceback in the log
Expected results:


Additional info:

[root@preethi-el6-pulp ~]# pulp-admin repo list 
+----------------------------------------------------------------------+
                              Repositories
+----------------------------------------------------------------------+

Id:                 centos
Display Name:       centos
Description:        None
Content Unit Count: 0
Notes:              

Id:                 relpath-test
Display Name:       relpath-test
Description:        None
Content Unit Count: 20
Notes:              

Id:                 epel-6-x86_64
Display Name:       epel-6-x86_64
Description:        None
Content Unit Count: 9372
Notes:              

Id:                 rhel-6-x86_64-pulp
Display Name:       rhel-6-x86_64-pulp
Description:        None
Content Unit Count: 22
Notes:              

Id:                 upload-test
Display Name:       upload-test
Description:        None
Content Unit Count: 3
Notes:              

Id:                 clone-repo
Display Name:       clone-repo
Description:        None
Content Unit Count: 20
Notes:              

Id:                 srpm
Display Name:       srpm
Description:        None
Content Unit Count: 3
Notes:              

Id:                 srpm-copy
Display Name:       srpm-copy
Description:        None
Content Unit Count: 3
Notes:              


[root@preethi-el6-pulp ~]# 


From pulp.log

2012-07-16 07:30:19,775 20160:140299737233152: pulp.server.dispatch.scheduler:INFO: scheduler:101 Scheduled CallRequest: RepoSyncManager.sync(u'generic-6-x86_64-pulp', sync_config_override={}): accepted [reasons: []]
2012-07-16 07:30:19,861 20160:140299303110400: pulp.server.dispatch.task:ERROR: task:133 Missing resource(s): resource_id=generic-6-x86_64-pulp
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/dispatch/task.py", line 130, in _run
    result = call(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/pulp/server/managers/repo/sync.py", line 89, in sync
    raise MissingResource(repo_id)
MissingResource: Missing resource(s): resource_id=generic-6-x86_64-pulp
2012-07-16 07:30:19,862 20160:140299303110400: pulp.server.dispatch.task:INFO: task:163 Task 9fba5b40-cf39-11e1-9ffa-525400c5886c: CallRequest: RepoSyncManager.sync(u'generic-6-x86_64-pulp', sync_config_override={}) FAILED



database
> db.scheduled_calls.find()
{ "_id" : ObjectId("50003140196f452114000046"), "serialized_call_request" : { "control_hooks" : "(lp0\nNa.", "weight" : 2, "tags" : [
	"pulp:repository:generic-6-x86_64-pulp",
	"pulp:repository_importer:yum_importer",
	"pulp:schedule:50003140196f452114000046"
], "args" : "(lp0\nVgeneric-6-x86_64-pulp\np1\na.", "callable_name" : "RepoSyncManager.sync", "asynchronous" : false, "kwargs" : "(dp0\nS'sync_config_override'\np1\n(dp2\ns.", "execution_hooks" : "(lp0\n(lp1\na(lp2\na(lp3\na(lp4\na(lp5\na(lp6\na(lp7\na.", "call" : "cpulp.server.dispatch.pickling\nunpickle_instance_method\np0\n(S'sync'\np1\nccopy_reg\n_reconstructor\np2\n(cpulp.server.managers.repo.sync\nRepoSyncManager\np3\nc__builtin__\nobject\np4\nNtp5\nRp6\ng3\ntp7\nRp8\n.", "archive" : true, "resources" : { "repository_importer" : { "yum_importer" : "read" }, "repository" : { "generic-6-x86_64-pulp" : "update" } } }, "next_run" : ISODate("2012-08-13T10:30:00Z"), "remaining_runs" : null, "first_run" : ISODate("2012-08-13T10:30:00Z"), "schedule" : "2012-07-13T10:30:00Z/P1M", "_ns" : "scheduled_calls", "enabled" : true, "last_run" : null, "failure_threshold" : null, "consecutive_failures" : 0, "id" : "50003140196f452114000046" }
{ "_id" : ObjectId("500031db196f45211400004d"), "_ns" : "scheduled_calls", "consecutive_failures" : 4, "enabled" : true, "failure_threshold" : null, "first_run" : ISODate("2012-07-14T10:30:00Z"), "id" : "500031db196f45211400004d", "last_run" : ISODate("2012-07-16T10:30:00Z"), "next_run" : ISODate("2012-07-17T10:30:00Z"), "remaining_runs" : null, "schedule" : "2012-07-13T10:30:00Z/P1D", "serialized_call_request" : { "control_hooks" : "(lp0\nNa.", "weight" : 2, "tags" : [
	"pulp:repository:generic-6-x86_64-pulp",
	"pulp:repository_importer:yum_importer",
	"pulp:schedule:500031db196f45211400004d"
], "args" : "(lp0\nVgeneric-6-x86_64-pulp\np1\na.", "callable_name" : "RepoSyncManager.sync", "asynchronous" : false, "kwargs" : "(dp0\nS'sync_config_override'\np1\n(dp2\ns.", "execution_hooks" : "(lp0\n(lp1\na(lp2\na(lp3\na(lp4\na(lp5\na(lp6\na(lp7\na.", "call" : "cpulp.server.dispatch.pickling\nunpickle_instance_method\np0\n(S'sync'\np1\nccopy_reg\n_reconstructor\np2\n(cpulp.server.managers.repo.sync\nRepoSyncManager\np3\nc__builtin__\nobject\np4\nNtp5\nRp6\ng3\ntp7\nRp8\n.", "archive" : true, "resources" : { "repository_importer" : { "yum_importer" : "read" }, "repository" : { "generic-6-x86_64-pulp" : "update" } } } }
{ "_id" : ObjectId("500031f2196f452114000054"), "_ns" : "scheduled_calls", "consecutive_failures" : 4, "enabled" : true, "failure_threshold" : null, "first_run" : ISODate("2012-07-14T11:30:00Z"), "id" : "500031f2196f452114000054", "last_run" : ISODate("2012-07-16T11:30:00Z"), "next_run" : ISODate("2012-07-17T11:30:00Z"), "remaining_runs" : null, "schedule" : "2012-07-13T11:30:00Z/P1D", "serialized_call_request" : { "control_hooks" : "(lp0\nNa.", "weight" : 2, "tags" : [
	"pulp:repository:generic-6-x86_64-pulp",
	"pulp:repository_importer:yum_importer",
	"pulp:schedule:500031f2196f452114000054"
], "args" : "(lp0\nVgeneric-6-x86_64-pulp\np1\na.", "callable_name" : "RepoSyncManager.sync", "asynchronous" : false, "kwargs" : "(dp0\nS'sync_config_override'\np1\n(dp2\ns.", "execution_hooks" : "(lp0\n(lp1\na(lp2\na(lp3\na(lp4\na(lp5\na(lp6\na(lp7\na.", "call" : "cpulp.server.dispatch.pickling\nunpickle_instance_method\np0\n(S'sync'\np1\nccopy_reg\n_reconstructor\np2\n(cpulp.server.managers.repo.sync\nRepoSyncManager\np3\nc__builtin__\nobject\np4\nNtp5\nRp6\ng3\ntp7\nRp8\n.", "archive" : true, "resources" : { "repository_importer" : { "yum_importer" : "read" }, "repository" : { "generic-6-x86_64-pulp" : "update" } } } }

Comment 1 Jason Connor 2012-07-16 18:36:54 UTC
added removal of scheduled syncs and publishes on deleting a repo
pushed in 2c7009677055087f75e5010a8a552bf824096700
cherry-picked in to the pulp_CR-1_patches branch

Comment 2 Jeff Ortel 2012-07-18 15:28:36 UTC
build: 0.314.

Comment 3 Preethi Thomas 2012-07-24 15:31:00 UTC
verified

No traceback in the log 

[root@preethi-el6-pulp ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.317-1.el6.noarch
[root@preethi-el6-pulp ~]#

Comment 4 Preethi Thomas 2013-01-07 14:09:13 UTC
Pulp 2.0 released.