Bug 709631 - Getting KeyError: 'next_scheduled_sync' in rhui.log while checking sync status
Summary: Getting KeyError: 'next_scheduled_sync' in rhui.log while checking sync status
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 2.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: rhui-20
TreeView+ depends on / blocked
 
Reported: 2011-06-01 08:56 UTC by Sachin Ghai
Modified: 2012-05-31 12:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-31 12:56:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sachin Ghai 2011-06-01 08:56:03 UTC
Description of problem:
Getting followng error while checking sync status when sync was running for two repos. 

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 13:56:15
(updated every 50 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Enterprise Linux Server 6 Optional Releases (RPMs) (6Server-x86_64)
06-01-2011 12:49             Never                        running    

Red Hat Enterprise Linux Server 6 Releases (RPMs) (6Server-x86_64)
06-01-2011 12:30             06-01-2011 08:22             running    

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
06-01-2011 14:30             06-01-2011 13:31             finished   

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
06-01-2011 14:30             06-01-2011 13:31             finished   


                                          Connected: dhcp193-79.pnq.redhat.com
------------------------------------------------------------------------------
^Crhui (sync) => dr



------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 14:10:12
(updated every 50 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Enterprise Linux Server 6 Optional Releases (RPMs) (6Server-x86_64)

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.


------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Synchronization Status =-

   dr  display repo synchronization schedules
   sr  trigger an individual repository sync
   dc  display CDS synchronization schedules
   sc  trigger an individual CDS sync

   logout
       removes stored authentication credentials and exits

   <   move to the previous screen
   ^, home
       move to the home screen
   /, clear
       clears the screen
   ?, help
       display help
   q, quit, exit
       exit

                                          Connected: dhcp193-79.pnq.redhat.com
------------------------------------------------------------------------------
rhui (sync) => ^C

[root@dhcp193-100 noarch]# tail -f /root/.rhui/rhui.log 
    self.listen(clear=first_run)
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 92, in listen
    Shell.listen(self)
  File "/usr/lib/python2.6/site-packages/rhui/common/shell.py", line 191, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/sync.py", line 63, in repo_display
    self._sync_display('-= Repository Synchronization Status =-', self.pulp.repos_with_sync_status, False)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/sync.py", line 236, in _sync_display
    if data['next_scheduled_sync'] is None and data['sync_state'] == 'running':
KeyError: 'next_scheduled_sync'
^C
[root@dhcp193-100 noarch]# 


pulp.log:
==========

2011-06-01 14:09:20,810 [INFO][Thread-58] _process_repo_images() @ repo_sync.py:231 - No image files to import to repo..
2011-06-01 14:09:22,270 [INFO][Thread-58] add_packages_from_dir() @ repo_sync.py:204 - Loaded group info from /var/lib/pulp//repos/content/dist/rhel/rhui/server-6/releases/6Server/x86_64/optional/os/repodata/e6d289eca64761ec25a00ba4429f40aedb36c31ae89ed57f0fe648cf2e2fdfdd-comps-rhel6-Server-optional.xml
2011-06-01 14:09:22,271 [INFO][Thread-58] add_packages_from_dir() @ repo_sync.py:224 - Skipping errata imports from sync process
2011-06-01 14:09:22,392 [INFO][Thread-58] _sync() @ repo.py:1577 - Sync returned 2593 packages, 0 errata in 4769.02945614 seconds
2011-06-01 14:09:23,185 [INFO][Thread-58] _sync() @ repo.py:1588 - 0 old packages to process, 2593 new packages to process
2011-06-01 14:09:23,421 [INFO][Thread-58] _sync() @ repo.py:1602 - Examining 0 errata from repo rhel-server-6-optional-releases-6Server-x86_64
2011-06-01 14:09:23,433 [INFO][Thread-58] _sync() @ repo.py:1606 - Removing 0 old errata from repo rhel-server-6-optional-releases-6Server-x86_64
2011-06-01 14:09:23,530 [INFO][Thread-58] _sync() @ repo.py:1615 - Adding 0 new errata to repo rhel-server-6-optional-releases-6Server-x86_64


Version-Release number of selected component (if applicable):
pulp 0.181
rh-rhui-tools 2.0.25

How reproducible:
This issue seems to be a random issue. I'm not sure the steps to reproduce. But I got this error 4-5 times in 2 days.


Steps to Reproduce:
Sice its a rndom issue, no exact steps to reproduce.
  
Actual results:
KeyError: 'next_scheduled_sync' in rhui.log

Expected results:
there shouldn't be any error in rhui.log while checking sync status.

Additional info:

Comment 1 wes hayutin 2011-06-06 21:15:31 UTC
added to rhui-20 tracker

Comment 2 Jay Dobies 2011-06-16 14:42:45 UTC
This should be fixed in Pulp 0.190.

Comment 3 Sachin Ghai 2011-06-17 06:17:40 UTC
I verified this in build 0.190.

This is still reproducible. When I checked the sync status in morning, its saying

------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 11:33:04
(updated every 5 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Enterprise Linux Server 6 Optional Releases (RPMs) (6Server-x86_64)
06-17-2011 11:32             06-16-2011 19:36             running    

Red Hat Enterprise Linux Server 6 Optional Updates (RPMs) (6Server-x86_64)
06-17-2011 11:32             06-16-2011 19:37             running    

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-i386)
06-17-2011 12:18             06-16-2011 21:19             scheduled  

Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
06-17-2011 12:18             06-16-2011 21:19             scheduled  


                                         Connected: dhcp193-163.pnq.redhat.com
------------------------------------------------------------------------------


I restarted the pulp-server service, still it was showing the same status. Notice that "last sync" completed yesterday at 19:37.

So I tried to trigger the invdividual sync for other two repos (RHUI1.2) and got same error as mentioned in this defect's description.

------------------------------------------------------------------------------
rhui (sync) => sr


An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.


------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Synchronization Status =-

   dr  display repo synchronization schedules
   sr  trigger an individual repository sync
   dc  display CDS synchronization schedules
   sc  trigger an individual CDS sync

   logout
       removes stored authentication credentials and exits

   <   move to the previous screen
   ^, home
       move to the home screen
   /, clear
       clears the screen
   ?, help
       display help
   q, quit, exit
       exit

                                         Connected: dhcp193-163.pnq.redhat.com
------------------------------------------------------------------------------
rhui (sync) => exit  
[root@dhcp193-60 ~]# tail -f /root/.rhui/rhui.log 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 75, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 94, in listen
    Shell.listen(self)
  File "/usr/lib/python2.6/site-packages/rhui/common/shell.py", line 191, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/sync.py", line 92, in repo_sync
    repo_menu_items.append(select_text % (self._color_sync_state(repo), render.format_date(repo['next_scheduled_sync']), repo['name']))
KeyError: 'next_scheduled_sync'

Comment 4 Sachin Ghai 2011-06-17 06:41:33 UTC
I again restarted the pulp-server and this time..I got following using 'dr'


                                         Connected: dhcp193-163.pnq.redhat.com
------------------------------------------------------------------------------
rhui (sync) => dr













------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Repository Synchronization Status =-

Last Refreshed: 12:08:12
(updated every 5 seconds, ctrl+c to exit)

Next Sync                    Last Sync                    Last Result         
------------------------------------------------------------------------------
Red Hat Enterprise Linux Server 6 Optional Releases (RPMs) (6Server-x86_64)

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.


------------------------------------------------------------------------------
             -= Red Hat Update Infrastructure Management Tool =-


-= Synchronization Status =-

   dr  display repo synchronization schedules
   sr  trigger an individual repository sync
   dc  display CDS synchronization schedules
   sc  trigger an individual CDS sync

   logout
       removes stored authentication credentials and exits

   <   move to the previous screen
   ^, home
       move to the home screen
   /, clear
       clears the screen
   ?, help
       display help
   q, quit, exit
       exit

                                         Connected: dhcp193-163.pnq.redhat.com
------------------------------------------------------------------------------
rhui (sync) => exit
[root@dhcp193-60 ~]# tail -f /root/.rhui/rhui.log 
    self.listen(clear=first_run)
  File "/usr/lib/python2.6/site-packages/rhui/tools/shell.py", line 94, in listen
    Shell.listen(self)
  File "/usr/lib/python2.6/site-packages/rhui/common/shell.py", line 191, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/sync.py", line 63, in repo_display
    self._sync_display('-= Repository Synchronization Status =-', self.pulp.repos_with_sync_status, False)
  File "/usr/lib/python2.6/site-packages/rhui/tools/screens/sync.py", line 236, in _sync_display
    if data['next_scheduled_sync'] is None and data['sync_state'] == 'running':
KeyError: 'next_scheduled_sync'

Comment 5 Jay Dobies 2011-06-22 14:05:19 UTC
Bulk moving a bunch of sync related bugs to ON_QA to test with version 2.0.32.

Comment 6 Sachin Ghai 2011-07-04 09:33:28 UTC
Verified this with new build pulp 0.201 and rhui-tools 2.0.34.

This issue is not reproducible. I started sync for two large rhel6 repos and checked the sync status couple of times. Also I started the CDS sync in parallel.

Moving this to Verified since it is not reproducible in new build.

Comment 7 wes hayutin 2011-08-01 21:40:23 UTC
moving to release pending

Comment 8 wes hayutin 2012-05-31 12:56:38 UTC
closing out, product released


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