I ran bagbunker scan /mnt/bags
, which seems to have successfully scanned my bag files. After that was done, I was able to go to its web page and see the listing of bag files.
After that, I ran bagbunker read-pending
, which threw an exception when it encountered an unindexed bag file:
2016-07-25 21:48:51,622 ERROR marv.storage skipped <Fileset "2014-07-25-15-37-22.orig" type="bag" dir="/mnt/bags" files=1 md5="35f259cfdb50ffcaf37454b92b19dda0"> due to exception
Traceback (most recent call last):
File "/opt/bagbunker-venv/local/lib/python2.7/site-packages/marv/storage.py", line 106, in read_pending
instance = reader[fileset.type].read(fileset)
File "/opt/bagbunker-venv/local/lib/python2.7/site-packages/marv/reader.py", line 35, in read
return self.callback(fileset)
File "/opt/bagbunker-venv/local/lib/python2.7/site-packages/bagbunker/reader.py", line 44, in reader
rbag = rosbag.Bag(file.path)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbag/bag.py", line 171, in __init__
self._open(f, mode, allow_unindexed)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbag/bag.py", line 1094, in _open
if mode == 'r': self._open_read(f, allow_unindexed)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbag/bag.py", line 1130, in _open_read
self._reader.start_reading()
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosbag/bag.py", line 2304, in start_reading
raise ROSBagUnindexedException()
ROSBagUnindexedException: Unindexed bag
That seems to have left the database in a bad state; whenever I go to bagbunker's web page, I simply see this exception:
(pysqlite2.dbapi2.OperationalError) no such table: listing_entry [SQL: u'SELECT listing_entry.id AS listing_entry_id, listing_entry.remote AS listing_entry_remote, listing_entry.fileset_id AS listing_entry_fileset_id, listing_entry.storage_id AS listing_entry_storage_id, listing_entry.type AS listing_entry_type, listing_entry.name AS listing_entry_name, listing_entry.abbr_md5 AS listing_entry_abbr_md5, listing_entry.size AS listing_entry_size, listing_entry.file_count AS listing_entry_file_count, listing_entry.status AS listing_entry_status, listing_entry.job_count AS listing_entry_job_count, listing_entry.comment_count AS listing_entry_comment_count, listing_entry.tags AS listing_entry_tags, listing_entry.starttime AS listing_entry_starttime, listing_entry.endtime AS listing_entry_endtime, listing_entry.duration AS listing_entry_duration, listing_entry.robot AS listing_entry_robot, listing_entry.use_case AS listing_entry_use_case \nFROM listing_entry']
It seems strange that this would cause a "no such table" error, so I can't be 100% certain that the unindexed bag file is what caused it, but I don't see any other errors or warnings in the log.
I realize the obvious solution to this problem is "run rosbag reindex
on your bag file!", but I actually intentionally keep around this unindexed bag file so that I can test tools I am developing to ensure that unindexed bag files do not break them. 😄 So, it would be nice if bagbunker also handled it gracefully.