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

SDM DB optimizer: destroys DB of Mediamonkey app #732

Closed
Flint4 opened this Issue Feb 3, 2017 · 3 comments

Comments

2 participants
@Flint4

Flint4 commented Feb 3, 2017

Hi, I've found that SDM isn't able to optimize the DB of the app "Mediamonkey" (com.ventismedia.android.mediamonkey). SDM drops an error when trying and destroys the DB of Mediamonkey. Mediamonkey isn't starting up anymore afterwards without clearing all app data first. The problem is 100% reproducable on my phone but was difficult to investigate. I'd recommend to exclude Mediamonkey permanently from DB optimizations.

@d4rken

This comment has been minimized.

Owner

d4rken commented Feb 3, 2017

Are you sure that the action itself breaks the db? The SQL VACUUM action itself should be non destructive (according to SQL documentation). In other cases I investigated it was due to the app (which owns the db) starting and trying to access it's locked database.

You could test this by freezing the app in question, running the database tool, then unfreezing the app.

Do you have "skip running apps" enabled or disabled?

In any case if this is reproducable everytime a default exclusion would probably be the best solution.

@d4rken d4rken added this to the v4.6.1 milestone Feb 3, 2017

@Flint4

This comment has been minimized.

Flint4 commented Feb 3, 2017

I'm pretty sure. I've frozen the app and did an optimization with SDM. SDM dropped the error: {Error: no such collation sequence: UNICODE}. After that I've unfrozen the MediaMonkey app and it was not working anymore.

I've noted that SDMaid creates two files in the database location: mmstore.db-shm and mmstore.db-wal which stay in the folder after the error. If these files are already existing before I start SDM optimization, the length of mmstore.db-wal goes to zero bytes when I run the optimization. When I delete these two files manually, MediaMonkey starts as it should, but rebuilding the database.

Skip runnung apps is enabled.

@d4rken

This comment has been minimized.

Owner

d4rken commented Feb 4, 2017

The error just means that the database uses a custom sort order and thus a "normal" sql binary can't deal with unknown stuff. It would also mean that the SQL operation didn't even start. So I still don't understand how this can cause it just by running the action. If you froze the app interference shouldn't be a possible cause anymore.

Some interesting links from the mediamonkey forums.
https://www.google.de/search?q="no+such+collation+sequence:+IUNICODE"+site:www.mediamonkey.com

Anyways, the *-wal and *-shm files are created when the database mode is switched which is not something SD Maid does. On scan databases are checked for their version and "optimization" is running VACUUM.

Hmm I couldn't find any info on this behavior but I must also admit I'm not too versed in SQL.
While I would love to understand how the database breaks (from POV of MediaMonkey), due to the custom collation, SD Maid can't do anything anyways, so lets just go with the exclude.

I'll add a default (but not locked) exclusion for com.ventismedia.android.mediamonkey to the database tool.

Thanks for the ticket and details 👍

@d4rken d4rken closed this Feb 10, 2017

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