-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ros2 bag reindex fails on SQLite3 E:26 #1029
Comments
@Benblob688 If you try to reindex normally recorded bag i.e. with normal finishing by removing metadata file, do you see the same error from reindexer? |
I have the same problem after a sudden shutdown to my computer during bag saving. I tried reindexing a normally recorded bag that doesn't have a metadata file and it works without issues. |
This is a problem with SQLite3 probably because the write to bag terminates halfway through a transaction (disclaimer I don't really know much about sql databases) However this issue can occur in any SQLite3 database and there are solutions to it. I've linked to one that was able to reformat and recover the sqlite database I also add the contents of the link in case it drops out
I think running these commands should be possible though the python sqlite3 interface |
TLDR; Assuming your bag file is called Install the application
Check for issues in db3 file in bag.
Now I have seen the above command return errors or ok with no change to the reindexing success for rosbag2.
At the prompt dump the raw contents of the db.
Use grep to extract just the relevant transactions (remember I don't know sql)
now load back into a new database:
check that the size of the database is no longer zero
Now you should be able to reindex successfully:
|
@PeterQFR Thank you so much for the recipe! As regards to the original issue I see from conversation that From our rosbag2 readme file https://github.com/ros2/rosbag2#recording-with-a-storage-configuration
|
The solution by @PeterQFR unfortunately did not work for me, but I have come across this stack overflow answer, with which I managed to repair the corrupted database.
Hope this helps future visitors |
In the case you need to reindex for different bag formats: db3: mcap: (Other supported storage formats can be found using |
Description
Firstly, I experienced the issue described by #395 where the
ros2 bag record -a
done on foxy had not saved ametadata.yaml
file because the machine's power was cut, noCrtl-C
was done on theros2 bag record
Following #395, I figured out that
ros2 bag reindex
is only available ongalactic
notfoxy
, so I followed these instructions to installgalactic
https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.htmlThen I encountered the errors described by #240 (error code 26 not 5 though) and did the following to try to rectify it:
sudo apt-get install ros-galactic-rosbag2-storage-default-plugins ros-galactic-ros2bag
This hasn't fixed the issue for me.
Expected Behavior
ros2 bag reindex <dir>
creates themetadata.yaml
file that was not created due to a power loss duringros2 bag record -a
Actual Behavior
the following error:
System (please complete the following information)
record
, galactic toreindex
The text was updated successfully, but these errors were encountered: