Broker corrupts persistent database mosquitto.db #424

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

Comments

Projects
None yet
3 participants
@codami

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

[424]
Fix mosquitto.db from becoming corrupted due to client messages being
persisted with no stored message.

Thanks to codami.

Bug: #424
@ralight

This comment has been minimized.

Show comment
Hide comment
@ralight

ralight Apr 13, 2017

Contributor

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?

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?

@ralight ralight added this to the fixes-next milestone Apr 13, 2017

@codami

This comment has been minimized.

Show comment
Hide comment
@codami

codami Apr 13, 2017

It works fine now, thanks!

codami commented Apr 13, 2017

It works fine now, thanks!

@ralight

This comment has been minimized.

Show comment
Hide comment
@ralight

ralight Apr 14, 2017

Contributor

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

Contributor

ralight commented Apr 14, 2017

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

@ralight ralight closed this Apr 14, 2017

@Markuzzzz

This comment has been minimized.

Show comment
Hide comment
@Markuzzzz

Markuzzzz Jan 5, 2018

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment