vfsfitvnm / ViMusic

An Android application for streaming music from YouTube Music.
GNU General Public License v3.0
9.18k stars 921 forks source link

All songs dissapeared #984

Open SoMir0 opened 1 year ago

SoMir0 commented 1 year ago

Steps to reproduce the bug

Open app Look up a song App crashed Songs are gone

Expected behavior

My songs should show up

Actual behavior

I had 2 playlists, many offline songs, favorites, and they're all gone

Screenshots/Screen recordings

Screenshot_20230228-125223_ViMusic Screenshot_20230228-125219_ViMusic Screenshot_20230228-125212_ViMusic

Logs

No response

ViMusic version

0.5.4

Android version

Android 10

Additional information

It says the cache is still there, but nothing shows up.

vfsfitvnm commented 1 year ago

Could you paste the logcat here? Tutorial: https://riptutorial.com/adb/example/14878/displaying-and-filtering-with-logcat Command: adb logcat it.vfsfitvnm.vimusic:*

SoMir0 commented 1 year ago

I don't think this is right - it keeps printing stuff, I can't even scroll all the way up

https://pastebin.com/cunr4ps2

vfsfitvnm commented 1 year ago

Would you try this one instead? adb shell "logcat | grep it.vfsfitvnm.vimusic"

SoMir0 commented 1 year ago

Now it doesn't show anything. Just to be clear, the app doesn't crash anymore, it crashed once and now all the music is gone, but it says the cache is still there.

8itlew7r commented 1 year ago

I had the same issue as @SoMir0. Here's the crash report from logcat, you can use Logcat Reader (https://play.google.com/store/apps/details?id=com.dp.logcatapp&hl=en_US&gl=US) to read it.

ViMusic v0.5.4 Device: Xiaomi M2006C3LG, Brand:Redmi Android Target: 10.0 (SDK 29 Q) Display: 720x1448 - xhdpi CPU ABI: armeabi-v7a, armeabi

https://nopaste.ml/#XQAAAQCbdgAAAAAAAAAeaAQNhvNGQKSUW/nyI4EKXY7oXQYkvxiGtH95aejPYGx8LJoAT/4NNfGZSQllFkjzeF+JxDHT2eFI7LMXlB1Q1is/FnNBCNn6E3Cq0Qs/1ERWzMp7PsP3NmfB8Kdk4tcQPkDxL3KZp+x02UdZdLZFyZK/CNNUzHTv8gjGW/WL+9U5RwINzSyUynCl7WkOZwh2qqoPKG28e3+GjuafrkE6o2sopkrObjnU6SQHDbt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ELDFsY01Fjw1d1Hyxmg8q7r51wFTmUGZOrF6PYULbM7gqFx5hMnkA8lcApwl+ZbDoO/L5MRQepyyvC3U7H5tF6FLTHY3CJClAl4jSnbxHzvJPfYNwr4NwNdg6sDHSBVUkljJf+30LLL4XSg0zEPl3uRdC60CtSg2elvutAyTWs+T0UYb0UjcNPuQb6l0rGfoba8m7SSRnm6BFFdNzVVao22ti4ybFXpaBiQoKx8iA17FAypRMBjO4spX/2u45MdpyQ6E3qfJWkTelkH0r1hgUDrrLhm8w1Gj6lsX2AN62xkOWL0CsdUDjXThoiQP92hye0vIbTguZspGE6f+/qoRqbHNeDh+jbR1Xs1XZuaHxoIjK1FY0gef4/NPfKh2qRL6bazaQBvEV9bJQpaZWNQACOwKQLAe74Q8PEVDrluRjaucmUWLtL/Digs8fZlLWdPURHsbUaQuPkeHjlbEd96POTQIDh+GWCea7X4j2fo8v+tXZUUAwg0liaxZsRGSbwkk3hJ8A840gTJoOkwSnYHWRP1iu0pqGsPr9eaYgxonhkxxcON9XwDlDmrWgCkwkFEkcMIGMXiU3G2ztxBUQEfPoqswDHv0ugo3FSEj91kiFOrabs7O9BmleATuQAW9ITkQW1zV2PH+xa8ID/PyZtjf1xeWta+oLyVDVPb/bN7RtWUKWiXC+mf2vwsBZIPUAoCRLsaEpKkBIkKcVUN6R4390RENinIoqjz+05sFXR0/oAJfaMEwAhA/91rFUFKBpUjLWxTXIrn16DzqFysBX9VLQHqb+zM+0B7BCq6SKGIR9gCwNsgkcRSceD++9aBm+8Atu9H/r7W2dQge3h8i2//FIT55656FcG8DCqURA5ppCY6eoyFIlXsGAu8MQajjr1M56DwblNc49FHfyVxykIahOAsxYbT+zNkml9y0YwxRE80QI6jfA+g01NIQhyTfUgW/clCG1U//XmIWhBt/6z/TY=

vfsfitvnm commented 1 year ago

@8itlew7r Thanks, that's helpful. There are three crashes, actually. I think the one which caused the database to be erased is the following:

java.lang.IllegalStateException: Cannot perform this operation because there is no current transaction.
    at android.database.sqlite.SQLiteSession.throwIfNoTransaction(SQLiteSession.java:917)
    at android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:400)
    at android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:585)
    at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.endTransaction(FrameworkSQLiteDatabase.java:2)
    at androidx.room.RoomDatabase.j(RoomDatabase.java:9)
    at androidx.room.RoomDatabase.endTransaction(RoomDatabase.java:0)
    at it.vfsfitvnm.vimusic.Database_Impl.insert(Database_Impl.java:0)
    at it.vfsfitvnm.vimusic.Database$Companion.insert(Database.java:12)
    at it.vfsfitvnm.vimusic.Database$DefaultImpls.insert$default(Database.java:0)
    at it.vfsfitvnm.vimusic.service.PlayerService$createDataSourceFactory$1$urlResult$2$1$3.invoke(PlayerService.java:0)
    at it.vfsfitvnm.vimusic.service.PlayerService$createDataSourceFactory$1$urlResult$2$1$3.invoke(PlayerService.java:0)
    at it.vfsfitvnm.vimusic.DatabaseKt.query$lambda$0(Database.kt:0)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)

The others are:

java.lang.SecurityException: Caller it.vfsfitvnm.vimusic:1411374 cannot post for pkg it.vfsfitvnm.vimusic in user 14
    at android.os.Parcel.createException(Parcel.java:2074)  at android.os.Parcel.readException(Parcel.java:2042)
    at android.os.Parcel.readException(Parcel.java:1990)
    at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:2776)
    at android.app.NotificationManager.notifyAsUser(NotificationManager.java:497)
    at android.app.NotificationManager.notify(NotificationManager.java:447)
    at android.app.NotificationManager.notify(NotificationManager.java:423)
    at it.vfsfitvnm.vimusic.service.PlayerService.onEvents(PlayerService.java:0)
    at androidx.media3.exoplayer.ExoPlayerImpl.lambda$new$0(ExoPlayerImpl.java:0)
    at androidx.media3.common.util.ListenerSet$ListenerHolder.iterationFinished(ListenerSet.java:0)
    at androidx.media3.common.util.ListenerSet.handleMessage(ListenerSet.java:0)
    at android.os.Handler.dispatchMessage(Handler.java:103)
    at android.os.Looper.loop(Looper.java:225)
    at android.app.ActivityThread.main(ActivityThread.java:7563)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:994)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.server.notification.NotificationManagerService.resolveNotificationUid(NotificationManagerService.java:5088)
    at com.android.server.notification.NotificationManagerService.enqueueNotificationInternal(NotificationManagerService.java:4778)
    at com.android.server.notification.NotificationManagerService$10.enqueueNotificationWithTag(NotificationManagerService.java:2410)
    at android.app.INotificationManager$Stub.onTransact(INotificationManager.java:1064)
    at android.os.Binder.execTransactInternal(Binder.java:1021)

and

java.lang.IndexOutOfBoundsException: Index -1, size 1
    at androidx.compose.foundation.lazy.layout.MutableIntervalList.checkIndexBounds(MutableIntervalList.java:0)
    at androidx.compose.foundation.lazy.layout.MutableIntervalList.c(MutableIntervalList.java:1)
    at androidx.compose.foundation.lazy.layout.DefaultLazyLayoutItemsProvider.c(DefaultLazyLayoutItemsProvider.java:5)
    at androidx.compose.foundation.lazy.LazyListItemProviderImpl.getKey(LazyListItemProviderImpl.java:2)
    at androidx.compose.foundation.lazy.layout.DefaultDelegatingLazyLayoutItemProvider.getKey(DefaultDelegatingLazyLayoutItemProvider.java:8)
    at androidx.compose.foundation.lazy.LazyListItemProviderKt$rememberLazyListItemProvider$1$1.getKey(LazyListItemProvider.kt:2)
    at androidx.compose.foundation.lazy.LazyMeasuredItemProvider.a(LazyMeasuredItemProvider.java:7)
    at androidx.compose.foundation.lazy.LazyListMeasureKt.measureLazyList-nXYdgZc(LazyListMeasure.kt:0)
    at it.vfsfitvnm.compose.reordering.ReorderingLazyListKt$rememberLazyListMeasurePolicy$1$1.invoke-0kLqBqw(ReorderingLazyList.kt:0)
    at it.vfsfitvnm.compose.reordering.ReorderingLazyListKt$rememberLazyListMeasurePolicy$1$1.invoke(ReorderingLazyList.kt:0)
    at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$1$2$1.invoke-0kLqBqw(LazyLayout.kt:0)
    at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$1$2$1.invoke(LazyLayout.kt:0)
    at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(LayoutNodeSubcompositionsState.java:0)
    at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.java:0)
    [continues]

Not sure how I could reproduce them, to be honest :/

8itlew7r commented 1 year ago

Thanks, that's helpful.

I don't know how to like or thumbs up your comment, but I'm glad I could help, and I hope it helps solve this problem because it just removes my old songs, which is not that big a deal.

vfsfitvnm commented 1 year ago

it just removes my old songs, which is not that big a deal.

@8itlew7r oh, maybe your problem is different (the stack trace is still helpful btw) - OP said the application crashed and - when it was reopened - the data got completely erased.

8itlew7r commented 1 year ago

@8itlew7r oh, maybe your problem is different

I'm sorry, the words I used are confusing.

OP said the application crashed and - when it was reopened - the data got completely erased.

But no, I think we have the same issue and the data isn't completely erased because cache is still there, but like the OP said, nothing shows up.

Anyway, I won't waste any more of your time; I know you've got this!

Jarletoss commented 1 year ago

The same thing happened to me today! A 1200 song playlist + offline songs disappeared when the app crashed today, i hope theres a fix soon cause im going on a long trip in a few days and music is my everything on long rides Ill remake my playlists again, just sad that ill have to do it over again

ikanakova commented 1 year ago

I think it could be solved if the application created, for example, a daily automatic backup. We would then lose a few songs at most, but not everything.

8itlew7r commented 1 year ago

So I just noticed that after listening to songs in the default offline playlist because I don't have Wi-Fi, the database gets corrupted again, so maybe there is a pattern going on? I've been using your app for a few months now, but this only happened after listening offline for a long time.

vfsfitvnm commented 1 year ago

If you have a backup hanging around (and, most importantly, you are still using this app after this embarrassing problem), you can recover it via:

sqlite3 corrupted.db ".recover" | sqlite3 recovered.db
8itlew7r commented 1 year ago

It crashes again but I had the logcat of the pid, I'm hoping it might help.

Log file: https://tny.lv/logfile Password: https://tny.lv/logpass

8itlew7r commented 1 year ago

I've noticed that everytime my phone is low on storage the offline songs disappear, maybe that's when corruption is triggered?