Empty photo list results in IndexError: list index out of range error

Bug #342194 reported by Jamie Bennett
2
Affects Status Importance Assigned to Milestone
Entertainer Media Center
Triaged
Medium
Unassigned

Bug Description

With an empty 'Folder=' for Photographs (after previously having a path, then deleting it) the following output occurs. This does _not_ hang entertainer.

Entertainer backend starting...
Traceback (most recent call last):
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 276, in handle_keyboard_event
    self.handle_user_event(UserEvent(UserEvent.NAVIGATE_SELECT))
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 382, in handle_user_event
    self.current.handle_user_event(event)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/main.py", line 287, in handle_user_event
    self.callback("photo_albums")
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 196, in move_to_new_screen
    screen = self.create_screen(screen_type, kwargs)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 189, in create_screen
    screen = self.screen_factory.generate_screen(screen_type, data)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/factory.py", line 77, in generate_screen
    return generator_methods[screen_type](kwargs)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/factory.py", line 138, in _generate_photo_albums
    return PhotoAlbums(**kwargs)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/photo_albums.py", line 59, in __init__
    self._create_album_menu()
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/photo_albums.py", line 114, in _create_album_menu
    self.menu.get_current_menuitem().get_userdata())
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/widgets/grid_menu.py", line 231, in get_current_menuitem
    return self.items[self.logical_position]
IEntertainer backend starting...
Traceback (most recent call last):
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 276, in handle_keyboard_event
    self.handle_user_event(UserEvent(UserEvent.NAVIGATE_SELECT))
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 382, in handle_user_event
    self.current.handle_user_event(event)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/main.py", line 287, in handle_user_event
    self.callback("photo_albums")
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 196, in move_to_new_screen
    screen = self.create_screen(screen_type, kwargs)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/user_interface.py", line 189, in create_screen
    screen = self.screen_factory.generate_screen(screen_type, data)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/factory.py", line 77, in generate_screen
    return generator_methods[screen_type](kwargs)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/factory.py", line 138, in _generate_photo_albums
    return PhotoAlbums(**kwargs)
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/photo_albums.py", line 59, in __init__
    self._create_album_menu()
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/screens/photo_albums.py", line 114, in _create_album_menu
    self.menu.get_current_menuitem().get_userdata())
  File "/mnt/hgfs/jamiebennett On My Mac/Development/entertainer/entertainerlib/frontend/gui/widgets/grid_menu.py", line 231, in get_current_menuitem
    return self.items[self.logical_position]
IndexError: list index out of range
: list index out of range

Paul Hummer (rockstar)
Changed in entertainer:
assignee: nobody → rockstar
importance: Undecided → High
milestone: none → entertainer-0.4
status: New → Triaged
Revision history for this message
Paul Hummer (rockstar) wrote :

Did you make the edit WHILE the frontend was running? I can't reproduce this.

Changed in entertainer:
assignee: rockstar → nobody
importance: High → Undecided
milestone: entertainer-0.4 → none
status: Triaged → Incomplete
Revision history for this message
Matt Layman (mblayman) wrote :

I am also unable to reproduce this bug. I followed these steps to attempt to reproduce the problem:

1) Ran content manager and deleted the Images path (I verified in the file that it was actually gone).
2) Ran Entertainer, went to the photos screen, but the cache still existed so it popped up without any problems.
3) Went back to the main screen, started the content manager, cleared the Image cache.
4) Open the photo albums screen again, but this time I was greeted by the "no photos" message that is expected.

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

I didn't make the edit while entertainer was running. From memory,

1) Start with just one photo in the path
2) Exited entertainer
3) Removed the file from the file system
4) Started up again
5) Got error
6) Exited
7) Removed path from config file
8) Start Entertainer
9) Error still there
10) Rebuild cache
11) Error goes

Revision history for this message
Matt Layman (mblayman) wrote :

Jamie,

The steps you gave help me make more sense of this now. Thanks for providing that info. I'm pretty sure that the problem is that changes to the content manager are supposed to trigger a cache rebuild, but since the backend is not running when you remove it, the old cache remains.

My guess would be that you are getting the backend error messages from the content manager. Is this true? If so, then the behavior you're getting is in line with that message.

I guess we need some mechanism for the backend to test itself on startup to see how its cache compares to what content.conf dictates. I'm not totally sure how we do that, maybe we could write a file when the backend closes that keeps track of its current folders so that it could test those values against the content.conf on startup. This method sounds sort of crude to me. Does anyone else have any better ideas.

Changed in entertainer:
importance: Undecided → Medium
status: Incomplete → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.