Skip to content
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

Broker corrupts persistent database mosquitto.db #424

Closed
codami opened this issue Apr 12, 2017 · 4 comments
Closed

Broker corrupts persistent database mosquitto.db #424

codami opened this issue Apr 12, 2017 · 4 comments

Comments

@codami
Copy link

codami commented Apr 12, 2017

It can be easily reproduced like this:

  1. given you have the following config;
persistence true
persistence_file mosquitto.db
persistence_location D:\
log_dest file D:\mosquitto.log
log_type all 
  1. start the broker
    mosquitto.exe -c mosquitto.conf

  2. start a client with a persistent session that subscribes to SYS topics
    start mosquitto_sub.exe -i Client1 -c -q 2 -t $SYS/broker/# -C 10

  3. wait for around 15 seconds

  4. stop the broker

  5. start the broker again

The broker fails to start with:

1492007506: Error restoring persistent database, message store corrupt.
1492007506: Error: Couldn't open database.

The log file and corrupted db file are here: files.zip

ralight added a commit that referenced this issue Apr 13, 2017
Fix mosquitto.db from becoming corrupted due to client messages being
persisted with no stored message.

Thanks to codami.

Bug: #424
@ralight
Copy link
Contributor

ralight commented Apr 13, 2017

Thanks for the good writeup. I think this has been fixed in the commit I just made. Are you able to test it for yourself?

@codami
Copy link
Author

codami commented Apr 13, 2017

It works fine now, thanks!

@ralight
Copy link
Contributor

ralight commented Apr 14, 2017

Great, it'll be part of the next release. Thanks for feeding back.

@ralight ralight closed this as completed Apr 14, 2017
@Markuzzzz
Copy link

If i follow fixes-next there is no due date. In which release 1.x.x.x will this be fixed?

@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants