Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

Empty bag file corrupt after rosbag --reindex #1099

@jhpanetta

Description

@jhpanetta

After running rosbag reindex on the attached (empty/no messages) unindexed.bag file, the resulting file causes a traceback when fed to rosbag info. rosbag version is 1.11.20

To reproduce:

$ unzip rosbag_reindex_issue.zip
$ rosbag info unindexed.bag
ERROR bag unindexed: unindexed.bag.  Run rosbag reindex.
$ rosbag reindex unindexed_bag
$ rosbag info unindexed.bag
Traceback (most recent call last):
  File "/path/redacted/rosbag/scripts/rosbag_bin.py", line 35, in <module>
    rosbag.rosbagmain()
  File "/path/redacted/rosbag/src/rosbag/rosbag_main.py", line 863, in rosbagmain
    cmds[cmd](argv[2:])
  File "/path/redacted/rosbag/src/rosbag/rosbag_main.py", line 149, in info_cmd
    print(b)
  File "/path/redacted/rosbag/src/rosbag/bag.py", line 628, in __str__
    start_stamp = min([index[ 0].time.to_sec() for index in self._connection_indexes.values()])
IndexError: list index out of range

rosbag_reindex_issue.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions