Bug 636852 - Status of a failed sync is not being reported when you run repo status
Summary: Status of a failed sync is not being reported when you run repo status
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: John Matthews
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2010-09-23 13:38 UTC by Preethi Thomas
Modified: 2011-08-16 14:20 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 14:20:09 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-09-23 13:38:38 UTC
Description of problem:

Unless you are running the repo sync with the --foreground/-F option there is no way of knowing if the sync failed unless I tailed the log.

Example here

[root@preethi ~]#  pulp-admin -u admin -p admin repo sync --id=rhel-i386-server-5
Sync for repo rhel-i386-server-5 started
Use "repo status" to check on the progress
[root@preethi ~]#  pulp-admin -u admin -p admin repo status --id=rhel-i386-server-5
Repository: rhel-i386-server-5
Number of Packages: 0


from the pulp.log

[root@preethi ~]# tail -f /var/log/pulp/pulp.log

2010-09-23 09:46:05,101 [INFO][Thread-14] sync() @ repo_sync.py:452 - Synchronizing from RHN. Host [http://satellite.rhn.redhat.com], Channel [rhel-i386-server-5]
2010-09-23 09:46:05,102 [ERROR][Thread-14] failed() @ task.py:205 - Task id:e93d4578-c718-11df-8189-002564a85a58, method_name:_sync:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/server/tasking/task.py", line 129, in run
    result = self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo.py", line 732, in _sync
    sync_packages, sync_errataids = repo_sync.sync(repo, repo_source, progress_callback)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo_sync.py", line 69, in sync
    repo_dir = synchronizer.sync(repo, repo_source, progress_callback)
  File "/usr/lib/python2.6/site-packages/pulp/server/api/repo_sync.py", line 461, in sync
    s.syncPackages(channel, savePath=dest_dir, callback=progress_callback)
  File "/usr/lib/python2.6/site-packages/grinder/RHNSync.py", line 366, in syncPackages
    packages = satDump.getChannelPackages(self.systemid, channelLabel)
  File "/usr/lib/python2.6/site-packages/grinder/SatDumpClient.py", line 105, in getChannelPackages
    dom = self.client.dump.channels(systemId, [channelLabel])
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1483, in __request
    allow_none=self.__allow_none)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1132, in dumps
    data = m.dumps(params)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 677, in dumps
    dump(v, write)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 699, in __dump
    f(self, value, write)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 703, in dump_nil
    raise TypeError, "cannot marshal None unless allow_none is enabled"
TypeError: cannot marshal None unless allow_none is enabled



So if I run the sync with --foreground option I get

[root@preethi ~]#  pulp-admin -u admin -p admin repo sync --id=rhel-i386-server-5 --foreground
Sync for repo rhel-i386-server-5 started
you can safely CTRL+C this current command and it will continue
[                                                     ] 0%
Sync: Error
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 30, in <module>
    pulpcli.PulpCore().main()
  File "/usr/lib/python2.6/site-packages/pulp/client/pulpcli.py", line 108, in main
    cmd.main()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/basecore.py", line 151, in main
    self._do_core()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/core_repo.py", line 162, in _do_core
    self._sync()
  File "/usr/lib/python2.6/site-packages/pulp/client/core/core_repo.py", line 351, in _sync
    systemExit("Error : %s" % se)
  File "/usr/lib/python2.6/site-packages/pulp/client/core/basecore.py", line 50, in system_exit
    assert isinstance(msgs, (basestring, list, tuple))
AssertionError

Comment 1 John Matthews 2011-01-04 16:50:14 UTC
To Test:

1) sudo rm -fr /var/lib/pulp/packages
2) sudo mkdir /var/lib/pulp/packages
3) sudo chmod 700 /var/lib/pulp/packages
4) Sync a repo
5) $ sudo pulp-admin -u admin -p admin repo status --id jwmb 
+------------------------------------------+
               Status for jwmb
+------------------------------------------+
Repository: jwmb
Number of Packages: 306
Last Sync: 2011-01-04 11:38:32.739000
Last Error: 2011-01-04 11:39:06.360000
OSError: [Errno 13] Permission denied: '/var/lib/pulp/packages/3f8'



Look for:
a) Last Sync should be the date/time of the last successful sync
b) Last Error is the date/time of the last error
c) below "Last Error" is the summary string from the exception

Now fix the error with us deleting 'packages'
1) sudo rm -fr /var/lib/pulp/packages
2) Resync the repo and 'packages' dir will be recreated and populated
3) $ sudo pulp-admin -u admin -p admin repo status --id jwmb 
+------------------------------------------+
               Status for jwmb
+------------------------------------------+
Repository: jwmb
Number of Packages: 306
Last Sync: 2011-01-04 11:46:51.914000

Notice that if the last sync was successful we do not display "Last Error" info.

Committ is below:
http://git.fedorahosted.org/git/?p=pulp.git;a=commit;h=3db54fb9520008a3f8f27b5cc52fb3638a1fbdc9

Comment 2 Jay Dobies 2011-01-05 19:45:18 UTC
Fixed in 0.120.

Comment 3 Preethi Thomas 2011-01-06 17:50:13 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.121-1.fc14.noarch



[root@preethi ~]# rm -rf /var/lib/pulp/packages/
[root@preethi ~]# mkdir /var/lib/pulp/packages/
[root@preethi ~]# chmod 700 /var/lib/pulp/packages/
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin repo sync --id=local -F
Sync for repository local started
You can safely CTRL+C this current command and it will continue
[                                                     ] 0%
Sync: Error
OSError: [Errno 13] Permission denied: '/var/lib/pulp/packages/79a'

[root@preethi ~]# pulp-admin repo sync --id=local
Sync for repository local started
Use "repo status" to check on the progress
[root@preethi ~]# pulp-admin repo status --id=local
+------------------------------------------+
              Status for local
+------------------------------------------+
Repository: local
Number of Packages: 1
Last Sync: 2011-01-06 12:49:59.222000
Last Error: 2011-01-06 12:52:56.413000
OSError: [Errno 13] Permission denied: '/var/lib/pulp/packages/79a'


[root@preethi ~]# rm -rf /var/lib/pulp/packages/
[root@preethi ~]# pulp-admin repo sync --id=local
Sync for repository local started
Use "repo status" to check on the progress
[root@preethi ~]# pulp-admin repo status --id=local
+------------------------------------------+
              Status for local
+------------------------------------------+
Repository: local
Number of Packages: 1
Last Sync: 2011-01-06 12:54:04.738000

[root@preethi ~]# pulp-admin repo sync --id=f13
Sync for repository f13 started
Use "repo status" to check on the progress
[root@preethi ~]# pulp-admin repo status --id=f13
+------------------------------------------+
               Status for f13
+------------------------------------------+
Repository: f13
Number of Packages: 3102
Last Sync: 2011-01-06 10:45:41.832000
Currently syncing: 0% done (96 of 3111 packages downloaded)

[root@preethi ~]# pulp-admin repo cancel_sync --id=f13
Sync for repository f13 canceled

[root@preethi ~]# pulp-admin repo status --id=f13
+------------------------------------------+
               Status for f13
+------------------------------------------+
Repository: f13
Number of Packages: 3102
Last Sync: 2011-01-06 10:45:41.832000

Comment 4 Preethi Thomas 2011-08-16 14:20:09 UTC
Closing with Community Release 15

pulp-0.0.223-4.


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