[Bug]: App crashes when downloading an audiobook #1196

Closed
opened 2026-04-24 23:52:59 +02:00 by adam · 21 comments
Owner

Originally created by @Zibbp on GitHub (Apr 24, 2025).

I have verified that the bug is not already awaiting release

Yes

What was the Problem?

Clicking the "download" button for an audiobook crashes the app when attempting to download.

Steps to Reproduce the Issue

  1. Navigate to an audiobook
  2. Click the download button

What was Expected?

The audiobook should download without crashing.

Phone Model

Samsung Galaxy S22

Phone OS

Android 14

Audiobookshelf App Version

Android App - 0.9.79

Installation Source

Google Play Store

Additional Notes

App is actually 0.9.80-beta, no option for that.

Server version: v2.20.0 in docker.

The in-application logs do not catch this. I do have ADB debug logs though.

adb logs of crash
04-23 18:22:12.883 27468 28717 D AbsDownloader: Got library item from server ce086423-0e35-4f27-b832-757a7da4c8d9
04-23 18:22:12.884 27468 28717 D AbsDownloader: downloadCacheDirectory=/data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9
04-23 18:22:12.884 27468 28717 D AbsDownloader: Starting library item download with 1 tracks
04-23 18:22:12.884 27468 28717 D AbsDownloader: Audio File Server Path /api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download | AF RelPath Ruins of the Earth Book 3 - Phantom Deadfall.m4b | LocalFolder Path  | DestName Ruins of the Earth Book 3 - Phantom Deadfall.m4b
04-23 18:22:12.884 27468 28717 D AbsDownloader: TEMP Audio file already exists, removing it from /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins of the Earth Book 3 - Phantom Deadfall.m4b
04-23 18:22:12.884 27468 28717 D DownloadItemPart: Audio File Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins%20of%20the%20Earth%20Book%203%20-%20Phantom%20Deadfall.m4b | Final Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins%20of%20the%20Earth%20Book%203%20-%20Phantom%20Deadfall.m4b | Download URI https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED
04-23 18:22:12.884 27468 28717 D AbsDownloader: TEMP Audio file already exists, removing it from /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg
04-23 18:22:12.884 27468 28717 D DownloadItemPart: Audio File Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg | Final Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg | Download URI https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/cover?token=REDACTED&raw=1
04-23 18:22:12.888 27468 28717 I DownloadItemManager: Add download item Phantom Deadfall
04-23 18:22:12.903  2652  5460 D SemWifiUsabilityStatsMonitor: onWifiUsabilityStats - seqNum 6476, isSameBssidAndFreq true
04-23 18:22:12.903 27468 28717 D DownloadItemManager: checkUpdateDownloadQueue: numPartsToGet=3, nextDownloadItemParts=2
04-23 18:22:12.903  2652  3521 I SemWifiLinkQualityMonitor: Link stat: 805 / 4 / 1.35 (31) / 288 / -63.0 || 100.0 : 288.00 / 0.5 : 0.74 / 0.55 : 0.00 / G (G) || 0.10 ms / 79.89 Mbps / N || 0 / N / 0 Y / 0 Y
04-23 18:22:12.903 27468 28717 D DownloadItemManager: Start internal download to destination path /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins of the Earth Book 3 - Phantom Deadfall.m4b from https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED
04-23 18:22:12.904 27468 28717 D DownloadItemManager: Start internal download to destination path /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg from https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/cover?token=REDACTED&raw=1
04-23 18:22:12.904 27468 27713 D DownloadItemManager: Starting watching downloads
04-23 18:22:12.931  2652  2758 E Watchdog: !@Sync: 4464 heap: 122 / 124 FD: 1206 [2025-04-23 18:22:12.930]
--------- beginning of crash
04-23 18:22:12.951 27468 28732 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
04-23 18:22:12.951 27468 28732 E AndroidRuntime: Process: com.audiobookshelf.app, PID: 27468
04-23 18:22:12.951 27468 28732 E AndroidRuntime: java.lang.ArithmeticException: divide by zero
04-23 18:22:12.951 27468 28732 E AndroidRuntime: 	at com.audiobookshelf.app.managers.BinaryFileWriter.write(InternalDownloadManager.kt:94)
04-23 18:22:12.951 27468 28732 E AndroidRuntime: 	at com.audiobookshelf.app.managers.InternalDownloadManager$download$1.onResponse(InternalDownloadManager.kt:44)
04-23 18:22:12.951 27468 28732 E AndroidRuntime: 	at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
04-23 18:22:12.951 27468 28732 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
04-23 18:22:12.951 27468 28732 E AndroidRuntime: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
04-23 18:22:12.951 27468 28732 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:1012)
04-23 18:22:12.957 27468 28731 I Process : Sending signal. PID: 27468 SIG: 9
04-23 18:22:12.957  2652 28741 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
04-23 18:22:12.961  2652  6699 D Debug   : low && ship && 3rdparty app crash, do not dump
04-23 18:22:12.961  2652  3238 I HqmInfo::c: checkAppError: list is null
04-23 18:22:12.962  2652 28743 W ActivityManager: crash : com.audiobookshelf.app,10497
04-23 18:22:12.962  6556  6556 W DMASA[D]: [d]Diagnostic is not agreed
04-23 18:22:12.963  2652  6699 W ActivityTaskManager:   Force finishing activity com.audiobookshelf.app/.MainActivity
04-23 18:22:12.963  2652  6699 D WindowManager: Transition is created, t=TransitionRecord{38ceccb id=-1 type=CLOSE flags=0x10}, caller=com.android.server.wm.TransitionController.createTransition:339 com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 com.android.server.wm.TransitionController.requestTransitionIfNeeded:730 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6986 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6979 
04-23 18:22:12.963  2652  6699 D WindowManager: SyncGroup is created, id=1284, name=Transition, caller=com.android.server.wm.BLASTSyncEngine$SyncGroup.<init>:0 com.android.server.wm.BLASTSyncEngine.prepareSyncSet:523 com.android.server.wm.BLASTSyncEngine.startSyncSet:528 com.android.server.wm.Transition.startCollecting:704 com.android.server.wm.TransitionController.moveToCollecting:360 com.android.server.wm.TransitionController.createTransition:341 com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 
04-23 18:22:12.963  2652  6699 W WindowManager: setSyncMethod, id=1284, method=0, caller=com.android.server.wm.Transition.startCollecting:706 com.android.server.wm.TransitionController.moveToCollecting:360 com.android.server.wm.TransitionController.createTransition:341 
04-23 18:22:12.963  2652  6699 V WindowManager: Start collecting in Transition: TransitionRecord{38ceccb id=1284 type=CLOSE flags=0x10}, caller=com.android.server.wm.TransitionController.createTransition:341 com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 com.android.server.wm.TransitionController.requestTransitionIfNeeded:730 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6986 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6979 
04-23 18:22:12.964  2652  6699 V WindowManager: Requesting StartTransition: TransitionRecord{38ceccb id=1284 type=CLOSE flags=0x10}, caller=com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 com.android.server.wm.TransitionController.requestTransitionIfNeeded:730 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6986 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6979 com.android.server.wm.Task.finishTopCrashedActivityLocked:6892 
04-23 18:22:12.965  3685  3742 V WindowManagerShell: Transition requested: android.os.BinderProxy@f4a6fe7 TransitionRequestInfo { type = CLOSE, triggerTask = null, remoteTransition = null, displayChange = null }
04-23 18:22:12.965  2652  6699 D ActivityTaskManager: scheduleTopResumedActivityChanged, onTop=false, r=ActivityRecord{546244c u0 com.audiobookshelf.app/.MainActivity t4519 f}}, caller=com.android.server.wm.ActivityTaskSupervisor.updateTopResumedActivityIfNeeded:2873 com.android.server.wm.TaskDisplayArea.positionChildTaskAt:569 com.android.server.wm.TaskDisplayArea.positionChildAt:485 com.android.server.wm.WindowContainer.positionChildAt:993 com.android.server.wm.Task.positionChildAt:3373 com.android.server.wm.Task.moveToFront:6140 
04-23 18:22:12.965  2652  6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4519, focused=false
04-23 18:22:12.965  2652  6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4267, focused=true
04-23 18:22:12.966  2652  6699 D SGM:FgCheckThread:   sendRunningComponentFocus(), pkgName: com.sec.android.app.launcher, userId: 0
04-23 18:22:12.966  2652  6699 D InputDispatcher: Focused application(0): ActivityRecord{8d7368e u0 com.sec.android.app.launcher/.activities.LauncherActivity t4267}
04-23 18:22:12.966  2652  3251 D SGM:FgCheckThread: onLooperPrepared(), msg: MSG_TASK_FOCUSED, pkgName: com.sec.android.app.launcher, userId: 0
04-23 18:22:12.966  2652  3251 D SGM:FgCheckThread: handleTaskFocused().
04-23 18:22:12.966  2652  3462 D AS.MultiSoundManager: mForegroundUid = 10140
04-23 18:22:12.967  2652  3251 D SGM:FgCheckThread: sendFocusOutConditionally() - mPrevNotiPkg: com.sec.android.app.samsungapps, userId: 0
04-23 18:22:12.967  2652  6699 V WindowManager: Changing focus from Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity} to null displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:581 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6910 com.android.server.wm.ActivityTaskManagerService.setLastResumedActivityUncheckLocked:6164 com.android.server.wm.ActivityRecord.moveFocusableActivityToTop:4165 
04-23 18:22:12.967  2652  3251 D SGM:FgCheckThread:   handleTaskFocused(), pkgName: com.sec.android.app.launcher, userID:0 mResumedPkgMap does not containsKey.
04-23 18:22:12.967  2652  6699 V SystemKeyManager: updateFocusedWindow() is called, 
04-23 18:22:12.967  2652  6699 I SystemKeyManager: isSystemKeyEventRequested() : focusedWindow is empty.
04-23 18:22:12.967  2652  6699 I SystemKeyManager: isSystemKeyEventRequested() : focusedWindow is empty.
04-23 18:22:12.967  2652  6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4519, focused=false
04-23 18:22:12.967  2652  6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4267, focused=true
04-23 18:22:12.967  2652  6699 D SGM:FgCheckThread:   sendRunningComponentFocus(), pkgName: com.sec.android.app.launcher, userId: 0
04-23 18:22:12.968  2652  3251 D SGM:FgCheckThread: onLooperPrepared(), msg: MSG_TASK_FOCUSED, pkgName: com.sec.android.app.launcher, userId: 0
04-23 18:22:12.968  2652  3251 D SGM:FgCheckThread: handleTaskFocused().
04-23 18:22:12.968  2652  3251 D SGM:FgCheckThread:   handleTaskFocused(), pkgName: com.sec.android.app.launcher, userID:0 mResumedPkgMap does not containsKey.
04-23 18:22:12.968  2652  3462 D AS.MultiSoundManager: mForegroundUid = 10140
04-23 18:22:12.968  2652  6699 V WindowManager: Collecting in transition 1284: Task{cb4cc95 #4519 type=standard A=10497:com.audiobookshelf.app}, caller=com.android.server.wm.Transition.collect:753 com.android.server.wm.Transition.collectExistenceChange:936 com.android.server.wm.TransitionController.collectExistenceChange:1025 com.android.server.wm.TransitionController.requestCloseTransitionIfNeeded:963 com.android.server.wm.ActivityRecord.finishIfPossible:4361 
04-23 18:22:12.968  2652  6699 D WindowManager: prepareSync <SYNC_STATE_WAITING_FOR_DRAW>, mPrepareSyncSeqId=0, win=Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity}
04-23 18:22:12.968  2652  6699 V WindowManager: Collecting in transition 1284: ActivityRecord{546244c u0 com.audiobookshelf.app/.MainActivity t4519 f}}, caller=com.android.server.wm.Transition.collect:753 com.android.server.wm.TransitionController.collect:975 com.android.server.wm.ActivityRecord.setVisibility:6429 com.android.server.wm.ActivityRecord.setVisibility:6381 com.android.server.wm.ActivityRecord.finishIfPossible:4440 
04-23 18:22:12.968  2652  6699 D WindowManager: VisibleRequested updated, r=ActivityRecord{546244c u0 com.audiobookshelf.app/.MainActivity t4519 f}}
04-23 18:22:12.972  2652  3993 V WindowManager: Starting Transition 1284, caller=com.android.server.wm.WindowOrganizerController.startTransition:384 com.android.server.wm.WindowOrganizerController.startTransition:315 android.window.IWindowOrganizerController$Stub.onTransact:257 
04-23 18:22:12.972  2652  3993 V Transition:  allReady query: used=true, override=false, defer=0, states=Display{#0 state=ON size=1080x2340 ROTATION_0}:false
04-23 18:22:12.972  4336  4419 I HoneySpace.TopTaskSource: onTaskMovedToFront : taskId = 4267
04-23 18:22:12.973  2652  2737 D ActivityManager: !@AM_BOOT_PROGRESS , ensureBootCompleted booting:false /enableScreen:false /caller:com.android.server.am.ActivityManagerService$UiHandler.handleMessage:2042 android.os.Handler.dispatchMessage:106 
04-23 18:22:12.973  4336  4421 I HoneySpace.TopTaskUseCase: topTasks 4267 ComponentInfo{com.sec.android.app.launcher/com.sec.android.app.launcher.Launcher}
04-23 18:22:12.974  1943  2079 I VSyncReactor: Current= 24, Period= 120, hwcPeriod= 24
04-23 18:22:12.975  4336  4419 I HoneySpace.TopTaskSource: onTaskFocusChanged(): taskId = 4267
04-23 18:22:12.975  4336  4419 I HoneySpace.TopTaskSource: onTaskFocusChanged(): taskId = 4267
04-23 18:22:12.975  4336  4419 I HoneySpace.TopTaskSource: onTaskMovedToFront : taskId = 4267
04-23 18:22:12.975  4336  4419 I HoneySpace.TopTaskSource: onTaskMovedToFront : taskId = 4267
04-23 18:22:12.977  4336 24859 I HoneySpace.RecentTasks: onRecentTasksChanged
04-23 18:22:12.981 17373 17423 I Rubin   : [100] ac.a.c(Unknown Source) : Notify com.samsung.android.rubin.inferenceengine.contextanalytics.engine.loggers.AppUsageLogger's database is updated.
04-23 18:22:12.982  2652  2737 D PkgPredictorService-SecIpmManagerServiceImpl: onForegroundActivitiesChanged pid:4336 uid:10140
04-23 18:22:12.982  2652  2737 D NetworkPolicy: already checked 10140
04-23 18:22:12.982  2652  4490 V PkgPredictorService-SecIpmManagerServiceImpl: discard foreground app:com.sec.android.app.launcher 1|true
04-23 18:22:13.000  1928  2855 I AudioFlinger: removeDlbCodecCallback pid:27468 type:-1
04-23 18:22:13.000  2652  6938 D InputMethodManagerService: removeClient
04-23 18:22:13.000  2652  6938 D InputTransport: Input channel destroyed: 'ClientS', fd=902
04-23 18:22:13.000 18411 18411 D InputTransport: Input channel destroyed: 'ClientS', fd=168
04-23 18:22:13.001  2652  3771 I WindowManager: WIN DEATH: Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity}
04-23 18:22:13.001  2652  3771 D InputTransport: Input channel destroyed: '50c8ccf', fd=1114
04-23 18:22:13.001  2652  3770 I MediaSessionStack: removeSession | record: com.audiobookshelf.app/PlayerNotificationServ (userId=0)
04-23 18:22:13.001  2652  3443 D ConnectivityService: releasing NetworkRequest [ REQUEST id=9359, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10497 RequestorUid: 10497 RequestorPkg: com.audiobookshelf.app UnderlyingNetworks: Null] ] (release request)
04-23 18:22:13.001  2652  3771 W InputManager-JNI: Input channel object '50c8ccf com.audiobookshelf.app/com.audiobookshelf.app.MainActivity (client)' was disposed without first being removed with the input manager!
04-23 18:22:13.001  2652  3771 D InputTransport: Input channel destroyed: '50c8ccf', fd=1127
04-23 18:22:13.001  2652  3443 D ConnectivityService:  Removing from current network [189 WIFI], leaving 153 requests.
04-23 18:22:13.001  2652  3771 V WindowManager: Remove Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity}: mSurfaceController=Surface(name=com.audiobookshelf.app/com.audiobookshelf.app.MainActivity$_27468)/@0x16bb9f9 mAnimatingExit=false mRemoveOnExit=false mHasSurface=true surfaceShowing=true animating=false app-animation=false mDisplayFrozen=false callers=com.android.server.wm.WindowState$DeathRecipient.binderDied:3698 android.os.IBinder$DeathRecipient.binderDied:325 android.os.BinderProxy.sendDeathNotice:781 <bottom of call stack> <bottom of call stack> <bottom of call stack> 
04-23 18:22:13.001  2652  6938 I ImeTracker: com.audiobookshelf.app:566c4c21: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_REMOVE_CLIENT
04-23 18:22:13.002  2652  6938 D InputMethodManagerService: setWindowStateInner, windowToken=android.os.BinderProxy@344392e, state=ImeTargetWindowState{ imeToken android.os.Binder@87d279f imeFocusChanged false hasEditorFocused false requestedImeVisible false imeDisplayId 0 softInputModeState STATE_UNSPECIFIED|ADJUST_RESIZE isStartInputByGainFocus true}
04-23 18:22:13.002  1756  1756 I Zygote  : Process 27468 exited due to signal 9 (Killed)
04-23 18:22:13.002  2652  6938 I ImeTracker: com.audiobookshelf.app:566c4c21: onCancelled at PHASE_SERVER_SHOULD_HIDE
04-23 18:22:13.002  2652  6938 V InputMethodManagerService: hideCurrentInputLocked : canceled, shouldHideSoftInput=false, mInputShown=false, mImeWindowVis=0
04-23 18:22:13.002  2652  3443 D ConnectivityService: releasing NetworkRequest [ REQUEST id=9341, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10497 RequestorUid: 10497 RequestorPkg: com.audiobookshelf.app UnderlyingNetworks: Null] ] (release request)
04-23 18:22:13.002  2652  3443 D ConnectivityService:  Removing from current network [189 WIFI], leaving 152 requests.
04-23 18:22:13.002  2652  6933 I ActivityManager: Process com.audiobookshelf.app (pid 27468) has died: prcp TOP (237,3049)
04-23 18:22:13.003 25084 25084 W DiscoveryManager: BroadcastReceiver is already registered
04-23 18:22:13.004 25084 28750 I DiscoveryManager: Filter criteria(CFE7FEDA,%urn:x-cast:com.google.cast.media) scannerFlags(0)
04-23 18:22:13.005  2652  2780 I libprocessgroup: Successfully killed process cgroup uid 10497 pid 27468 in 0ms
04-23 18:22:13.005 25084 25084 I CastMediaRouteProvider: Published 2 routes
04-23 18:22:13.007  1943  1943 I BpBinder: onLastStrongRef automatically unlinking death recipients: 
04-23 18:22:13.007  6638  6638 I SDHMS:BarTender:Gatherer:AppError: update AppError : uid=10497, pkg=com.audiobookshelf.app, errorType=crash
04-23 18:22:13.007  1943  1943 I HWComposer: [4630947232161729154] ActiveConfigToHWC, ID : 0
04-23 18:22:13.008  1943  1943 I LayerHistory: StatusBar$_3685#106 voted 0, 0.00 fps
04-23 18:22:13.008  1943  1943 I LayerHistory: com.audiobookshelf.app/com.audiobookshelf.app.MainActivity$_27468#23264 Max (can't resolve refresh rate)
04-23 18:22:13.008  1943  1943 I SurfaceFlinger: scored - choose 120.00 Hz
04-23 18:22:13.010  2652  6933 I ActivityManager: Killing 27511:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0a497i73 (adj 0): isolated not needed
04-23 18:22:13.010  2652  6933 I ActivityManager: Changes in 99073 3 to 19, 56 to 0
04-23 18:22:13.010  2652  6933 I ActivityManager: Changes in 10497 2 to 19, 63 to 0
04-23 18:22:13.010  2652  6938 D InputDispatcher: Focus request (0): <null> but waiting because NO_WINDOW
04-23 18:22:13.010  2652  6938 D InputDispatcher: Focus left window (0): 50c8ccf com.audiobookshelf.app/com.audiobookshelf.app.MainActivity
04-23 18:22:13.010  1862  2078 I SDM     : HWCDisplay::SubmitDisplayConfig: [DispConfigs] config 9 => 0, hs_mode 3 => 3
04-23 18:22:13.010  1862  2078 I SDM     : HWDeviceDRM::SetDisplaySwitchMode: [DispConfigs] check hs_mode 3
04-23 18:22:13.010  1862  2078 I SDM     : HWDeviceDRM::SetDisplaySwitchMode: [DispConfigs] Set mode index:0 1080x2340x120xcmdHS, hs_mode(3), found_mode(0)
04-23 18:22:13.010  1862  2078 I SDM     : HWDeviceDRM::UpdateMixerAttributes: Mixer WxH 1080x2340-1 for Peripheral
04-23 18:22:13.010  1862  2078 I SDM     : HWCDisplay::SubmitDisplayConfig: Active configuration changed from config 9 to 0
server logs
[2025-04-23 18:45:15.840] INFO: [LibraryItemController] User "zibbp" requested download for item "Phantom Deadfall" file at "/audiobooks/Christopher Hopper/Phantom Deadfall/Ruins of the Earth Book 3 - Phantom Deadfall.m4b"
[2025-04-23 18:45:15.862] ERROR: [LibraryItemController] Failed to download file "/audiobooks/Christopher Hopper/Phantom Deadfall/Ruins of the Earth Book 3 - Phantom Deadfall.m4b" Error: Request aborted
    at onaborted (/node_modules/express/lib/response.js:1052:15)
    at onfinish (/node_modules/express/lib/response.js:1088:50)
    at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
    at listener (/node_modules/on-finished/index.js:170:15)
    at onFinish (/node_modules/on-finished/index.js:101:5)
    at callback (/node_modules/ee-first/index.js:55:10)
    at Socket.onevent (/node_modules/ee-first/index.js:93:5)
    at Socket.emit (node:events:536:35)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3) {
  code: 'ECONNABORTED'
}

This happens for all audiobooks and not limited to a single one.

Let me know if there is anything else I can do to debug.

Originally created by @Zibbp on GitHub (Apr 24, 2025). ### I have verified that the [bug is not already awaiting release](https://github.com/advplyr/audiobookshelf-app/issues?q=is%3Aissue%20label%3A%22awaiting%20release%22) Yes ### What was the Problem? Clicking the "download" button for an audiobook crashes the app when attempting to download. ### Steps to Reproduce the Issue 1. Navigate to an audiobook 2. Click the download button ### What was Expected? The audiobook should download without crashing. ### Phone Model Samsung Galaxy S22 ### Phone OS Android 14 ### Audiobookshelf App Version Android App - 0.9.79 ### Installation Source Google Play Store ### Additional Notes App is actually 0.9.80-beta, no option for that. Server version: v2.20.0 in docker. The in-application logs do not catch this. I do have ADB debug logs though. <details> <summary>adb logs of crash</summary> ``` 04-23 18:22:12.883 27468 28717 D AbsDownloader: Got library item from server ce086423-0e35-4f27-b832-757a7da4c8d9 04-23 18:22:12.884 27468 28717 D AbsDownloader: downloadCacheDirectory=/data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9 04-23 18:22:12.884 27468 28717 D AbsDownloader: Starting library item download with 1 tracks 04-23 18:22:12.884 27468 28717 D AbsDownloader: Audio File Server Path /api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download | AF RelPath Ruins of the Earth Book 3 - Phantom Deadfall.m4b | LocalFolder Path | DestName Ruins of the Earth Book 3 - Phantom Deadfall.m4b 04-23 18:22:12.884 27468 28717 D AbsDownloader: TEMP Audio file already exists, removing it from /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins of the Earth Book 3 - Phantom Deadfall.m4b 04-23 18:22:12.884 27468 28717 D DownloadItemPart: Audio File Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins%20of%20the%20Earth%20Book%203%20-%20Phantom%20Deadfall.m4b | Final Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins%20of%20the%20Earth%20Book%203%20-%20Phantom%20Deadfall.m4b | Download URI https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED 04-23 18:22:12.884 27468 28717 D AbsDownloader: TEMP Audio file already exists, removing it from /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg 04-23 18:22:12.884 27468 28717 D DownloadItemPart: Audio File Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg | Final Destination Uri: file:///data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg | Download URI https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/cover?token=REDACTED&raw=1 04-23 18:22:12.888 27468 28717 I DownloadItemManager: Add download item Phantom Deadfall 04-23 18:22:12.903 2652 5460 D SemWifiUsabilityStatsMonitor: onWifiUsabilityStats - seqNum 6476, isSameBssidAndFreq true 04-23 18:22:12.903 27468 28717 D DownloadItemManager: checkUpdateDownloadQueue: numPartsToGet=3, nextDownloadItemParts=2 04-23 18:22:12.903 2652 3521 I SemWifiLinkQualityMonitor: Link stat: 805 / 4 / 1.35 (31) / 288 / -63.0 || 100.0 : 288.00 / 0.5 : 0.74 / 0.55 : 0.00 / G (G) || 0.10 ms / 79.89 Mbps / N || 0 / N / 0 Y / 0 Y 04-23 18:22:12.903 27468 28717 D DownloadItemManager: Start internal download to destination path /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/Ruins of the Earth Book 3 - Phantom Deadfall.m4b from https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED 04-23 18:22:12.904 27468 28717 D DownloadItemManager: Start internal download to destination path /data/user/0/com.audiobookshelf.app/files/downloads/ce086423-0e35-4f27-b832-757a7da4c8d9/cover-ce086423-0e35-4f27-b832-757a7da4c8d9.jpg from https://audiobookshelf.domain.net/api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/cover?token=REDACTED&raw=1 04-23 18:22:12.904 27468 27713 D DownloadItemManager: Starting watching downloads 04-23 18:22:12.931 2652 2758 E Watchdog: !@Sync: 4464 heap: 122 / 124 FD: 1206 [2025-04-23 18:22:12.930] --------- beginning of crash 04-23 18:22:12.951 27468 28732 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher 04-23 18:22:12.951 27468 28732 E AndroidRuntime: Process: com.audiobookshelf.app, PID: 27468 04-23 18:22:12.951 27468 28732 E AndroidRuntime: java.lang.ArithmeticException: divide by zero 04-23 18:22:12.951 27468 28732 E AndroidRuntime: at com.audiobookshelf.app.managers.BinaryFileWriter.write(InternalDownloadManager.kt:94) 04-23 18:22:12.951 27468 28732 E AndroidRuntime: at com.audiobookshelf.app.managers.InternalDownloadManager$download$1.onResponse(InternalDownloadManager.kt:44) 04-23 18:22:12.951 27468 28732 E AndroidRuntime: at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) 04-23 18:22:12.951 27468 28732 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 04-23 18:22:12.951 27468 28732 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 04-23 18:22:12.951 27468 28732 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012) 04-23 18:22:12.957 27468 28731 I Process : Sending signal. PID: 27468 SIG: 9 04-23 18:22:12.957 2652 28741 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2 04-23 18:22:12.961 2652 6699 D Debug : low && ship && 3rdparty app crash, do not dump 04-23 18:22:12.961 2652 3238 I HqmInfo::c: checkAppError: list is null 04-23 18:22:12.962 2652 28743 W ActivityManager: crash : com.audiobookshelf.app,10497 04-23 18:22:12.962 6556 6556 W DMASA[D]: [d]Diagnostic is not agreed 04-23 18:22:12.963 2652 6699 W ActivityTaskManager: Force finishing activity com.audiobookshelf.app/.MainActivity 04-23 18:22:12.963 2652 6699 D WindowManager: Transition is created, t=TransitionRecord{38ceccb id=-1 type=CLOSE flags=0x10}, caller=com.android.server.wm.TransitionController.createTransition:339 com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 com.android.server.wm.TransitionController.requestTransitionIfNeeded:730 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6986 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6979 04-23 18:22:12.963 2652 6699 D WindowManager: SyncGroup is created, id=1284, name=Transition, caller=com.android.server.wm.BLASTSyncEngine$SyncGroup.<init>:0 com.android.server.wm.BLASTSyncEngine.prepareSyncSet:523 com.android.server.wm.BLASTSyncEngine.startSyncSet:528 com.android.server.wm.Transition.startCollecting:704 com.android.server.wm.TransitionController.moveToCollecting:360 com.android.server.wm.TransitionController.createTransition:341 com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 04-23 18:22:12.963 2652 6699 W WindowManager: setSyncMethod, id=1284, method=0, caller=com.android.server.wm.Transition.startCollecting:706 com.android.server.wm.TransitionController.moveToCollecting:360 com.android.server.wm.TransitionController.createTransition:341 04-23 18:22:12.963 2652 6699 V WindowManager: Start collecting in Transition: TransitionRecord{38ceccb id=1284 type=CLOSE flags=0x10}, caller=com.android.server.wm.TransitionController.createTransition:341 com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 com.android.server.wm.TransitionController.requestTransitionIfNeeded:730 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6986 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6979 04-23 18:22:12.964 2652 6699 V WindowManager: Requesting StartTransition: TransitionRecord{38ceccb id=1284 type=CLOSE flags=0x10}, caller=com.android.server.wm.TransitionController.requestTransitionIfNeeded:824 com.android.server.wm.TransitionController.requestTransitionIfNeeded:730 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6986 com.android.server.wm.DisplayContent.requestTransitionAndLegacyPrepare:6979 com.android.server.wm.Task.finishTopCrashedActivityLocked:6892 04-23 18:22:12.965 3685 3742 V WindowManagerShell: Transition requested: android.os.BinderProxy@f4a6fe7 TransitionRequestInfo { type = CLOSE, triggerTask = null, remoteTransition = null, displayChange = null } 04-23 18:22:12.965 2652 6699 D ActivityTaskManager: scheduleTopResumedActivityChanged, onTop=false, r=ActivityRecord{546244c u0 com.audiobookshelf.app/.MainActivity t4519 f}}, caller=com.android.server.wm.ActivityTaskSupervisor.updateTopResumedActivityIfNeeded:2873 com.android.server.wm.TaskDisplayArea.positionChildTaskAt:569 com.android.server.wm.TaskDisplayArea.positionChildAt:485 com.android.server.wm.WindowContainer.positionChildAt:993 com.android.server.wm.Task.positionChildAt:3373 com.android.server.wm.Task.moveToFront:6140 04-23 18:22:12.965 2652 6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4519, focused=false 04-23 18:22:12.965 2652 6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4267, focused=true 04-23 18:22:12.966 2652 6699 D SGM:FgCheckThread: sendRunningComponentFocus(), pkgName: com.sec.android.app.launcher, userId: 0 04-23 18:22:12.966 2652 6699 D InputDispatcher: Focused application(0): ActivityRecord{8d7368e u0 com.sec.android.app.launcher/.activities.LauncherActivity t4267} 04-23 18:22:12.966 2652 3251 D SGM:FgCheckThread: onLooperPrepared(), msg: MSG_TASK_FOCUSED, pkgName: com.sec.android.app.launcher, userId: 0 04-23 18:22:12.966 2652 3251 D SGM:FgCheckThread: handleTaskFocused(). 04-23 18:22:12.966 2652 3462 D AS.MultiSoundManager: mForegroundUid = 10140 04-23 18:22:12.967 2652 3251 D SGM:FgCheckThread: sendFocusOutConditionally() - mPrevNotiPkg: com.sec.android.app.samsungapps, userId: 0 04-23 18:22:12.967 2652 6699 V WindowManager: Changing focus from Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity} to null displayId=0 Callers=com.android.server.wm.RootWindowContainer.updateFocusedWindowLocked:581 com.android.server.wm.WindowManagerService.updateFocusedWindowLocked:6910 com.android.server.wm.ActivityTaskManagerService.setLastResumedActivityUncheckLocked:6164 com.android.server.wm.ActivityRecord.moveFocusableActivityToTop:4165 04-23 18:22:12.967 2652 3251 D SGM:FgCheckThread: handleTaskFocused(), pkgName: com.sec.android.app.launcher, userID:0 mResumedPkgMap does not containsKey. 04-23 18:22:12.967 2652 6699 V SystemKeyManager: updateFocusedWindow() is called, 04-23 18:22:12.967 2652 6699 I SystemKeyManager: isSystemKeyEventRequested() : focusedWindow is empty. 04-23 18:22:12.967 2652 6699 I SystemKeyManager: isSystemKeyEventRequested() : focusedWindow is empty. 04-23 18:22:12.967 2652 6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4519, focused=false 04-23 18:22:12.967 2652 6699 D SGM:FgCheckThread: TaskStackListener.onTaskFocusChanged(), taskId=4267, focused=true 04-23 18:22:12.967 2652 6699 D SGM:FgCheckThread: sendRunningComponentFocus(), pkgName: com.sec.android.app.launcher, userId: 0 04-23 18:22:12.968 2652 3251 D SGM:FgCheckThread: onLooperPrepared(), msg: MSG_TASK_FOCUSED, pkgName: com.sec.android.app.launcher, userId: 0 04-23 18:22:12.968 2652 3251 D SGM:FgCheckThread: handleTaskFocused(). 04-23 18:22:12.968 2652 3251 D SGM:FgCheckThread: handleTaskFocused(), pkgName: com.sec.android.app.launcher, userID:0 mResumedPkgMap does not containsKey. 04-23 18:22:12.968 2652 3462 D AS.MultiSoundManager: mForegroundUid = 10140 04-23 18:22:12.968 2652 6699 V WindowManager: Collecting in transition 1284: Task{cb4cc95 #4519 type=standard A=10497:com.audiobookshelf.app}, caller=com.android.server.wm.Transition.collect:753 com.android.server.wm.Transition.collectExistenceChange:936 com.android.server.wm.TransitionController.collectExistenceChange:1025 com.android.server.wm.TransitionController.requestCloseTransitionIfNeeded:963 com.android.server.wm.ActivityRecord.finishIfPossible:4361 04-23 18:22:12.968 2652 6699 D WindowManager: prepareSync <SYNC_STATE_WAITING_FOR_DRAW>, mPrepareSyncSeqId=0, win=Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity} 04-23 18:22:12.968 2652 6699 V WindowManager: Collecting in transition 1284: ActivityRecord{546244c u0 com.audiobookshelf.app/.MainActivity t4519 f}}, caller=com.android.server.wm.Transition.collect:753 com.android.server.wm.TransitionController.collect:975 com.android.server.wm.ActivityRecord.setVisibility:6429 com.android.server.wm.ActivityRecord.setVisibility:6381 com.android.server.wm.ActivityRecord.finishIfPossible:4440 04-23 18:22:12.968 2652 6699 D WindowManager: VisibleRequested updated, r=ActivityRecord{546244c u0 com.audiobookshelf.app/.MainActivity t4519 f}} 04-23 18:22:12.972 2652 3993 V WindowManager: Starting Transition 1284, caller=com.android.server.wm.WindowOrganizerController.startTransition:384 com.android.server.wm.WindowOrganizerController.startTransition:315 android.window.IWindowOrganizerController$Stub.onTransact:257 04-23 18:22:12.972 2652 3993 V Transition: allReady query: used=true, override=false, defer=0, states=Display{#0 state=ON size=1080x2340 ROTATION_0}:false 04-23 18:22:12.972 4336 4419 I HoneySpace.TopTaskSource: onTaskMovedToFront : taskId = 4267 04-23 18:22:12.973 2652 2737 D ActivityManager: !@AM_BOOT_PROGRESS , ensureBootCompleted booting:false /enableScreen:false /caller:com.android.server.am.ActivityManagerService$UiHandler.handleMessage:2042 android.os.Handler.dispatchMessage:106 04-23 18:22:12.973 4336 4421 I HoneySpace.TopTaskUseCase: topTasks 4267 ComponentInfo{com.sec.android.app.launcher/com.sec.android.app.launcher.Launcher} 04-23 18:22:12.974 1943 2079 I VSyncReactor: Current= 24, Period= 120, hwcPeriod= 24 04-23 18:22:12.975 4336 4419 I HoneySpace.TopTaskSource: onTaskFocusChanged(): taskId = 4267 04-23 18:22:12.975 4336 4419 I HoneySpace.TopTaskSource: onTaskFocusChanged(): taskId = 4267 04-23 18:22:12.975 4336 4419 I HoneySpace.TopTaskSource: onTaskMovedToFront : taskId = 4267 04-23 18:22:12.975 4336 4419 I HoneySpace.TopTaskSource: onTaskMovedToFront : taskId = 4267 04-23 18:22:12.977 4336 24859 I HoneySpace.RecentTasks: onRecentTasksChanged 04-23 18:22:12.981 17373 17423 I Rubin : [100] ac.a.c(Unknown Source) : Notify com.samsung.android.rubin.inferenceengine.contextanalytics.engine.loggers.AppUsageLogger's database is updated. 04-23 18:22:12.982 2652 2737 D PkgPredictorService-SecIpmManagerServiceImpl: onForegroundActivitiesChanged pid:4336 uid:10140 04-23 18:22:12.982 2652 2737 D NetworkPolicy: already checked 10140 04-23 18:22:12.982 2652 4490 V PkgPredictorService-SecIpmManagerServiceImpl: discard foreground app:com.sec.android.app.launcher 1|true 04-23 18:22:13.000 1928 2855 I AudioFlinger: removeDlbCodecCallback pid:27468 type:-1 04-23 18:22:13.000 2652 6938 D InputMethodManagerService: removeClient 04-23 18:22:13.000 2652 6938 D InputTransport: Input channel destroyed: 'ClientS', fd=902 04-23 18:22:13.000 18411 18411 D InputTransport: Input channel destroyed: 'ClientS', fd=168 04-23 18:22:13.001 2652 3771 I WindowManager: WIN DEATH: Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity} 04-23 18:22:13.001 2652 3771 D InputTransport: Input channel destroyed: '50c8ccf', fd=1114 04-23 18:22:13.001 2652 3770 I MediaSessionStack: removeSession | record: com.audiobookshelf.app/PlayerNotificationServ (userId=0) 04-23 18:22:13.001 2652 3443 D ConnectivityService: releasing NetworkRequest [ REQUEST id=9359, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10497 RequestorUid: 10497 RequestorPkg: com.audiobookshelf.app UnderlyingNetworks: Null] ] (release request) 04-23 18:22:13.001 2652 3771 W InputManager-JNI: Input channel object '50c8ccf com.audiobookshelf.app/com.audiobookshelf.app.MainActivity (client)' was disposed without first being removed with the input manager! 04-23 18:22:13.001 2652 3771 D InputTransport: Input channel destroyed: '50c8ccf', fd=1127 04-23 18:22:13.001 2652 3443 D ConnectivityService: Removing from current network [189 WIFI], leaving 153 requests. 04-23 18:22:13.001 2652 3771 V WindowManager: Remove Window{50c8ccf u0 com.audiobookshelf.app/com.audiobookshelf.app.MainActivity}: mSurfaceController=Surface(name=com.audiobookshelf.app/com.audiobookshelf.app.MainActivity$_27468)/@0x16bb9f9 mAnimatingExit=false mRemoveOnExit=false mHasSurface=true surfaceShowing=true animating=false app-animation=false mDisplayFrozen=false callers=com.android.server.wm.WindowState$DeathRecipient.binderDied:3698 android.os.IBinder$DeathRecipient.binderDied:325 android.os.BinderProxy.sendDeathNotice:781 <bottom of call stack> <bottom of call stack> <bottom of call stack> 04-23 18:22:13.001 2652 6938 I ImeTracker: com.audiobookshelf.app:566c4c21: onRequestHide at ORIGIN_SERVER_HIDE_INPUT reason HIDE_REMOVE_CLIENT 04-23 18:22:13.002 2652 6938 D InputMethodManagerService: setWindowStateInner, windowToken=android.os.BinderProxy@344392e, state=ImeTargetWindowState{ imeToken android.os.Binder@87d279f imeFocusChanged false hasEditorFocused false requestedImeVisible false imeDisplayId 0 softInputModeState STATE_UNSPECIFIED|ADJUST_RESIZE isStartInputByGainFocus true} 04-23 18:22:13.002 1756 1756 I Zygote : Process 27468 exited due to signal 9 (Killed) 04-23 18:22:13.002 2652 6938 I ImeTracker: com.audiobookshelf.app:566c4c21: onCancelled at PHASE_SERVER_SHOULD_HIDE 04-23 18:22:13.002 2652 6938 V InputMethodManagerService: hideCurrentInputLocked : canceled, shouldHideSoftInput=false, mInputShown=false, mImeWindowVis=0 04-23 18:22:13.002 2652 3443 D ConnectivityService: releasing NetworkRequest [ REQUEST id=9341, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10497 RequestorUid: 10497 RequestorPkg: com.audiobookshelf.app UnderlyingNetworks: Null] ] (release request) 04-23 18:22:13.002 2652 3443 D ConnectivityService: Removing from current network [189 WIFI], leaving 152 requests. 04-23 18:22:13.002 2652 6933 I ActivityManager: Process com.audiobookshelf.app (pid 27468) has died: prcp TOP (237,3049) 04-23 18:22:13.003 25084 25084 W DiscoveryManager: BroadcastReceiver is already registered 04-23 18:22:13.004 25084 28750 I DiscoveryManager: Filter criteria(CFE7FEDA,%urn:x-cast:com.google.cast.media) scannerFlags(0) 04-23 18:22:13.005 2652 2780 I libprocessgroup: Successfully killed process cgroup uid 10497 pid 27468 in 0ms 04-23 18:22:13.005 25084 25084 I CastMediaRouteProvider: Published 2 routes 04-23 18:22:13.007 1943 1943 I BpBinder: onLastStrongRef automatically unlinking death recipients: 04-23 18:22:13.007 6638 6638 I SDHMS:BarTender:Gatherer:AppError: update AppError : uid=10497, pkg=com.audiobookshelf.app, errorType=crash 04-23 18:22:13.007 1943 1943 I HWComposer: [4630947232161729154] ActiveConfigToHWC, ID : 0 04-23 18:22:13.008 1943 1943 I LayerHistory: StatusBar$_3685#106 voted 0, 0.00 fps 04-23 18:22:13.008 1943 1943 I LayerHistory: com.audiobookshelf.app/com.audiobookshelf.app.MainActivity$_27468#23264 Max (can't resolve refresh rate) 04-23 18:22:13.008 1943 1943 I SurfaceFlinger: scored - choose 120.00 Hz 04-23 18:22:13.010 2652 6933 I ActivityManager: Killing 27511:com.google.android.webview:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:0/u0a497i73 (adj 0): isolated not needed 04-23 18:22:13.010 2652 6933 I ActivityManager: Changes in 99073 3 to 19, 56 to 0 04-23 18:22:13.010 2652 6933 I ActivityManager: Changes in 10497 2 to 19, 63 to 0 04-23 18:22:13.010 2652 6938 D InputDispatcher: Focus request (0): <null> but waiting because NO_WINDOW 04-23 18:22:13.010 2652 6938 D InputDispatcher: Focus left window (0): 50c8ccf com.audiobookshelf.app/com.audiobookshelf.app.MainActivity 04-23 18:22:13.010 1862 2078 I SDM : HWCDisplay::SubmitDisplayConfig: [DispConfigs] config 9 => 0, hs_mode 3 => 3 04-23 18:22:13.010 1862 2078 I SDM : HWDeviceDRM::SetDisplaySwitchMode: [DispConfigs] check hs_mode 3 04-23 18:22:13.010 1862 2078 I SDM : HWDeviceDRM::SetDisplaySwitchMode: [DispConfigs] Set mode index:0 1080x2340x120xcmdHS, hs_mode(3), found_mode(0) 04-23 18:22:13.010 1862 2078 I SDM : HWDeviceDRM::UpdateMixerAttributes: Mixer WxH 1080x2340-1 for Peripheral 04-23 18:22:13.010 1862 2078 I SDM : HWCDisplay::SubmitDisplayConfig: Active configuration changed from config 9 to 0 ``` </details> <details> <summary>server logs</summary> ``` [2025-04-23 18:45:15.840] INFO: [LibraryItemController] User "zibbp" requested download for item "Phantom Deadfall" file at "/audiobooks/Christopher Hopper/Phantom Deadfall/Ruins of the Earth Book 3 - Phantom Deadfall.m4b" [2025-04-23 18:45:15.862] ERROR: [LibraryItemController] Failed to download file "/audiobooks/Christopher Hopper/Phantom Deadfall/Ruins of the Earth Book 3 - Phantom Deadfall.m4b" Error: Request aborted at onaborted (/node_modules/express/lib/response.js:1052:15) at onfinish (/node_modules/express/lib/response.js:1088:50) at AsyncResource.runInAsyncScope (node:async_hooks:206:9) at listener (/node_modules/on-finished/index.js:170:15) at onFinish (/node_modules/on-finished/index.js:101:5) at callback (/node_modules/ee-first/index.js:55:10) at Socket.onevent (/node_modules/ee-first/index.js:93:5) at Socket.emit (node:events:536:35) at emitErrorNT (node:internal/streams/destroy:169:8) at emitErrorCloseNT (node:internal/streams/destroy:128:3) { code: 'ECONNABORTED' } ``` </details> This happens for all audiobooks and not limited to a single one. Let me know if there is anything else I can do to debug.
adam added the bug label 2026-04-24 23:52:59 +02:00
adam closed this issue 2026-04-24 23:52:59 +02:00
Author
Owner

@nichwall commented on GitHub (Apr 24, 2025):

Are you downloading to Internal App Storage or shared storage?
Do you have enough space on your device? What kind of book are you downloading (single file, multiple files, how large, etc)

@nichwall commented on GitHub (Apr 24, 2025): Are you downloading to Internal App Storage or shared storage? Do you have enough space on your device? What kind of book are you downloading (single file, multiple files, how large, etc)
Author
Owner

@Zibbp commented on GitHub (Apr 24, 2025):

I'm downloading to internal app storage. Device has plenty of free storage. Before the update on the 20th (v0.9.80-beta) this was working fine. All my audiobooks are single file .m4b . The specific book in the logs is 571MB.

@Zibbp commented on GitHub (Apr 24, 2025): I'm downloading to internal app storage. Device has plenty of free storage. Before the update on the 20th ([v0.9.80-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.80-beta)) this was working fine. All my audiobooks are single file `.m4b` . The specific book in the logs is 571MB.
Author
Owner

@nichwall commented on GitHub (Apr 24, 2025):

Hm, I'm not able to replicate this on 0.9.80. This is probably related to https://github.com/advplyr/audiobookshelf-app/issues/1428. The crash log shows a divide by zero, which is used for calculating the percentage of the file which has been downloaded. Can you look at the book in the web interface and see if the server is reporting any of the files are reporting as 0 bytes?

@nichwall commented on GitHub (Apr 24, 2025): Hm, I'm not able to replicate this on 0.9.80. This is probably related to https://github.com/advplyr/audiobookshelf-app/issues/1428. The crash log shows a divide by zero, which is used for calculating the percentage of the file which has been downloaded. Can you look at the book in the web interface and see if the server is reporting any of the files are reporting as 0 bytes?
Author
Owner

@Zibbp commented on GitHub (Apr 24, 2025):

No 0 byte files -

Image

I can download all 3 of those files through the web ui just fine.

I also tried reinstalling the Android client but that did not help.

@Zibbp commented on GitHub (Apr 24, 2025): No 0 byte files - ![Image](https://github.com/user-attachments/assets/79a0dd9c-d995-4812-a1ea-bfb3ff0cd397) I can download all 3 of those files through the web ui just fine. I also tried reinstalling the Android client but that did not help.
Author
Owner

@joutain commented on GitHub (Apr 24, 2025):

Similar issue for app crash on launching.
.80 version having issue and installed the .79 version back from the GitHub here resolved it. I have the Samsung s24+ with Android 15. Server side is the newest 2.20 on Synology container manager.

@joutain commented on GitHub (Apr 24, 2025): Similar issue for app crash on launching. .80 version having issue and installed the .79 version back from the GitHub here resolved it. I have the Samsung s24+ with Android 15. Server side is the newest 2.20 on Synology container manager.
Author
Owner

@nichwall commented on GitHub (Apr 24, 2025):

Similar issue for app crash on launching.
.80 version having issue and installed the .79 version back from the GitHub here resolved it. I have the Samsung s24+ with Android 15. Server side is the newest 2.20 on Synology container manager.

Is your app crashing or just showing a blank page? If so, you are likely experiencing https://github.com/advplyr/audiobookshelf-app/issues/1550

@nichwall commented on GitHub (Apr 24, 2025): > Similar issue for app crash on launching. > .80 version having issue and installed the .79 version back from the GitHub here resolved it. I have the Samsung s24+ with Android 15. Server side is the newest 2.20 on Synology container manager. Is your app crashing or just showing a blank page? If so, you are likely experiencing https://github.com/advplyr/audiobookshelf-app/issues/1550
Author
Owner

@joutain commented on GitHub (Apr 24, 2025):

My app is crashing.... Can't see the dashboard. Web browser access is fine

@joutain commented on GitHub (Apr 24, 2025): My app is crashing.... Can't see the dashboard. Web browser access is fine
Author
Owner

@Zibbp commented on GitHub (Apr 24, 2025):

Update with some more findings. I added my ABS server directly, no reverse proxy (Traefik), and it downloads fine.
I ran a packet capture and see the client start the download with a /file/X/download route and some data is sent to the client from the server then abruptly ends on the client side.

So I took a look at my reverse proxy config, which is pretty simple. HTTPS redirect, some header stuff, and enabling gzip. I've seen some odd issues with gzip in the past so I figured I'd remove that for the ABS route. Sure enough, disabling gzip on the ABS route allows the download to complete!

So why does enabling gzip on the reverse proxy cause the audiobook file download to crash the app is the question now.

The HTTP request to download the file is sending an accept for gzip.

GET /api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED HTTP/1.1
Host: audiobookshelf.domain.net
User-Agent: okhttp/4.9.2
Accept-Encoding: gzip
@Zibbp commented on GitHub (Apr 24, 2025): Update with some more findings. I added my ABS server directly, no reverse proxy (Traefik), and it downloads fine. I ran a packet capture and see the client start the download with a `/file/X/download` route and some data is sent to the client from the server then abruptly ends on the client side. So I took a look at my reverse proxy config, which is pretty simple. HTTPS redirect, some header stuff, and enabling gzip. I've seen some odd issues with gzip in the past so I figured I'd remove that for the ABS route. Sure enough, disabling gzip on the ABS route allows the download to complete! So why does enabling gzip on the reverse proxy cause the audiobook file download to crash the app is the question now. The HTTP request to download the file is sending an accept for gzip. ``` GET /api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED HTTP/1.1 Host: audiobookshelf.domain.net User-Agent: okhttp/4.9.2 Accept-Encoding: gzip ```
Author
Owner

@nichwall commented on GitHub (Apr 24, 2025):

So why does enabling gzip on the reverse proxy cause the audiobook file download to crash the app is the question now.

The HTTP request to download the file is sending an accept for gzip.

GET /api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED HTTP/1.1
Host: audiobookshelf.domain.net
User-Agent: okhttp/4.9.2
Accept-Encoding: gzip

Oh, that's interesting, thanks for the extra detail. I think the total size of the download file is included in the header, so maybe the server does not provide the total size of the media file when downloading gzip, and that causes the issue on the app? Other endpoints (like normal API for request/response) support gzip, so the app is probably just using the same connection settings for all endpoints.

My app is crashing.... Can't see the dashboard. Web browser access is fine

@joutain if your app is crashing when it opens and not crashing due to downloading a media file, please open a new issue

@nichwall commented on GitHub (Apr 24, 2025): > So why does enabling gzip on the reverse proxy cause the audiobook file download to crash the app is the question now. > > The HTTP request to download the file is sending an accept for gzip. > ``` > GET /api/items/ce086423-0e35-4f27-b832-757a7da4c8d9/file/1280/download?token=REDACTED HTTP/1.1 > Host: audiobookshelf.domain.net > User-Agent: okhttp/4.9.2 > Accept-Encoding: gzip > ``` Oh, that's interesting, thanks for the extra detail. I think the total size of the download file is included in the header, so maybe the server does not provide the total size of the media file when downloading gzip, and that causes the issue on the app? Other endpoints (like normal API for request/response) support gzip, so the app is probably just using the same connection settings for all endpoints. > My app is crashing.... Can't see the dashboard. Web browser access is fine @joutain if your app is crashing when it opens and not crashing due to downloading a media file, please open a new issue
Author
Owner

@nichwall commented on GitHub (Apr 24, 2025):

I have not been able to test this, but from initial research online, I believe this can be fixed by adding .header("Accept-Encoding", "identity") to the okhttp client in the Android internal download Manager.

This would be possible by changing https://github.com/advplyr/audiobookshelf-app/blob/e7ad62760f1398cff0acac42da63907034691abf/android/app/src/main/java/com/audiobookshelf/app/managers/InternalDownloadManager.kt#L21.

Change

OkHttpClient.Builder().connectTimeout(30, TimeUnit.SECONDS).build()

to

OkHttpClient.Builder().connectTimeout(30, TimeUnit.SECONDS).header("Accept-Encoding", "identity").build()

to remove accepting gzip as an accepted encoding from the request.

@nichwall commented on GitHub (Apr 24, 2025): I have not been able to test this, but from initial research online, I believe this can be fixed by adding `.header("Accept-Encoding", "identity")` to the okhttp client in the Android internal download Manager. This would be possible by changing https://github.com/advplyr/audiobookshelf-app/blob/e7ad62760f1398cff0acac42da63907034691abf/android/app/src/main/java/com/audiobookshelf/app/managers/InternalDownloadManager.kt#L21. Change ``` OkHttpClient.Builder().connectTimeout(30, TimeUnit.SECONDS).build() ``` to ``` OkHttpClient.Builder().connectTimeout(30, TimeUnit.SECONDS).header("Accept-Encoding", "identity").build() ``` to remove accepting gzip as an accepted encoding from the request.
Author
Owner

@github-actions[bot] commented on GitHub (Apr 26, 2025):

Fixed in v0.9.81-beta.

@github-actions[bot] commented on GitHub (Apr 26, 2025): Fixed in [v0.9.81-beta](https://github.com/advplyr/audiobookshelf-app/releases/tag/v0.9.81-beta).
Author
Owner

@RobinXe commented on GitHub (May 23, 2025):

I am seeing this same issue still (crashes when trying to download any book) despite running v0.9.81-beta of the app, and server v2.23.0.

I am also running Traefik, and have worked around the problem for now by disabling gzip, but the fix may need revisiting.

@RobinXe commented on GitHub (May 23, 2025): I am seeing this same issue still (crashes when trying to download any book) despite running v0.9.81-beta of the app, and server v2.23.0. I am also running Traefik, and have worked around the problem for now by disabling gzip, but the fix may need revisiting.
Author
Owner

@Maximepzv commented on GitHub (Jun 3, 2025):

I am facing the same issue, it still crash running v0.9.81-beta with server v2.21.0.

@RobinXe How did you disabled gzip ?

Only the mobile app seems to crash.

server logs

2025-06-03 19:14:05.820 INFO [LibraryItemController] User "root" requested download for item "Silo - Tome 3 - Générations" file at "/audio/Hugh Howey/Silo/Tome 3/01 Crédits de début.mp3"

2025-06-03 19:14:05.825 INFO [LibraryItemController] Downloaded file "/audio/Hugh Howey/Silo/Tome 3/01 Crédits de début.mp3"

2025-06-03 19:14:05.831 INFO [LibraryItemController] User "root" requested download for item "Silo - Tome 3 - Générations" file at "/audio/Hugh Howey/Silo/Tome 3/03 1ère partie - Le tunel.mp3"

2025-06-03 19:14:05.835 INFO [LibraryItemController] User "root" requested download for item "Silo - Tome 3 - Générations" file at "/audio/Hugh Howey/Silo/Tome 3/02 Prologue.mp3"

2025-06-03 19:14:05.837 INFO [LibraryItemController] Downloaded file "/audio/Hugh Howey/Silo/Tome 3/03 1ère partie - Le tunel.mp3"

2025-06-03 19:14:05.850 INFO [LibraryItemController] Downloaded file "/audio/Hugh Howey/Silo/Tome 3/02 Prologue.mp3"

2025-06-03 19:14:05.988 INFO [SocketAuthority] Socket _kxv0WGaVwAdSfQkAAEo disconnected from client "root" after 7909ms (Reason: transport close)
@Maximepzv commented on GitHub (Jun 3, 2025): I am facing the same issue, it still crash running v0.9.81-beta with server v2.21.0. @RobinXe How did you disabled gzip ? Only the mobile app seems to crash. <details><summary>server logs</summary> ``` 2025-06-03 19:14:05.820 INFO [LibraryItemController] User "root" requested download for item "Silo - Tome 3 - Générations" file at "/audio/Hugh Howey/Silo/Tome 3/01 Crédits de début.mp3" 2025-06-03 19:14:05.825 INFO [LibraryItemController] Downloaded file "/audio/Hugh Howey/Silo/Tome 3/01 Crédits de début.mp3" 2025-06-03 19:14:05.831 INFO [LibraryItemController] User "root" requested download for item "Silo - Tome 3 - Générations" file at "/audio/Hugh Howey/Silo/Tome 3/03 1ère partie - Le tunel.mp3" 2025-06-03 19:14:05.835 INFO [LibraryItemController] User "root" requested download for item "Silo - Tome 3 - Générations" file at "/audio/Hugh Howey/Silo/Tome 3/02 Prologue.mp3" 2025-06-03 19:14:05.837 INFO [LibraryItemController] Downloaded file "/audio/Hugh Howey/Silo/Tome 3/03 1ère partie - Le tunel.mp3" 2025-06-03 19:14:05.850 INFO [LibraryItemController] Downloaded file "/audio/Hugh Howey/Silo/Tome 3/02 Prologue.mp3" 2025-06-03 19:14:05.988 INFO [SocketAuthority] Socket _kxv0WGaVwAdSfQkAAEo disconnected from client "root" after 7909ms (Reason: transport close) ``` </details>
Author
Owner

@RobinXe commented on GitHub (Jun 3, 2025):

@RobinXe How did you disabled gzip ?

I made a chain rule specifically for ABS and left out the compression middleware altogether.

@RobinXe commented on GitHub (Jun 3, 2025): > > [@RobinXe](https://github.com/RobinXe) How did you disabled gzip ? > I made a chain rule specifically for ABS and left out the compression middleware altogether.
Author
Owner

@nichwall commented on GitHub (Jun 3, 2025):

I am seeing this same issue still (crashes when trying to download any book) despite running v0.9.81-beta of the app, and server v2.23.0.

I am also running Traefik, and have worked around the problem for now by disabling gzip, but the fix may need revisiting.

Have you confirmed the headers the app is sending to download? I did not see anything else that needed to be changed to disable gzip from the app. If the app is requesting without gzip and the proxy is responding with gzip that sounds like a proxy misconfiguration.

@nichwall commented on GitHub (Jun 3, 2025): > I am seeing this same issue still (crashes when trying to download any book) despite running v0.9.81-beta of the app, and server v2.23.0. > > I am also running Traefik, and have worked around the problem for now by disabling gzip, but the fix may need revisiting. Have you confirmed the headers the app is sending to download? I did not see anything else that needed to be changed to disable gzip from the app. If the app is requesting without gzip and the proxy is responding with gzip that sounds like a proxy misconfiguration.
Author
Owner

@RobinXe commented on GitHub (Jun 3, 2025):

I have not I'm sorry, I didn't dig into it, I'll add it to my list of things to get to, but it's a long list! 😜

It could well be a proxy misconfiguration, but it was working with one version of the app, then wasn't after an update. Not sure which update sorry, as I was listening to a downloaded 19h book at about 45mins per weekday, and was about 90mins from the end when I tried to download the next and it failed.

@RobinXe commented on GitHub (Jun 3, 2025): I have not I'm sorry, I didn't dig into it, I'll add it to my list of things to get to, but it's a long list! 😜 It could well be a proxy misconfiguration, but it was working with one version of the app, then wasn't after an update. Not sure which update sorry, as I was listening to a downloaded 19h book at about 45mins per weekday, and was about 90mins from the end when I tried to download the next and it failed.
Author
Owner

@luismalves commented on GitHub (Jun 12, 2025):

Also having this issue with traefik. Was working before. Also had to disable compress in the middleware chain for this endpoint

@luismalves commented on GitHub (Jun 12, 2025): Also having this issue with traefik. Was working before. Also had to disable compress in the middleware chain for this endpoint
Author
Owner

@nichwall commented on GitHub (Jun 12, 2025):

Also having this issue with traefik. Was working before. Also had to disable compress in the middleware chain for this endpoint

Can you confirm the request header from the app?

@nichwall commented on GitHub (Jun 12, 2025): > Also having this issue with traefik. Was working before. Also had to disable compress in the middleware chain for this endpoint Can you confirm the request header from the app?
Author
Owner

@snipcodeit commented on GitHub (Jul 21, 2025):

I just experienced this and immediately started hunting for a fix.

I was able to create a second local folder from within the android interface (Pixel 9 Pro) and upon selecting the m4b to download to it, it worked! Purely speculation from me, I wonder if it's a permission thing?

I haven't examined this codebase, but I hope if anyone else comes across this they can solve it the same way until it's hopefully identified and patched in a future release.

@snipcodeit commented on GitHub (Jul 21, 2025): I just experienced this and immediately started hunting for a fix. I was able to create a second local folder from within the android interface (Pixel 9 Pro) and upon selecting the m4b to download to it, it worked! Purely speculation from me, I wonder if it's a permission thing? I haven't examined this codebase, but I hope if anyone else comes across this they can solve it the same way until it's hopefully identified and patched in a future release.
Author
Owner

@v3DJG6GL commented on GitHub (Jul 30, 2025):

I had the same issue.
After removing Cloudflare Tunnel for my audiobookshelf subdomain, downloading is working as excepted :)

Audiobookshelf mobile app seems to struggle with Cloudflare tunneling...

Since I have a public/static IP address, I don't really need Cloudflare Tunnel, but for reasons of anonymity, I still prefer it...

@v3DJG6GL commented on GitHub (Jul 30, 2025): I had the same issue. After removing [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) for my audiobookshelf subdomain, downloading is working as excepted :) Audiobookshelf mobile app seems to struggle with Cloudflare tunneling... Since I have a public/static IP address, I don't really need Cloudflare Tunnel, but for reasons of anonymity, I still prefer it...
Author
Owner

@aakashbashyal21 commented on GitHub (Oct 3, 2025):

I am also running my app through cloudfare tunnel and has a private IP. I am not able to download the files it get crashed, and also not able to skip forward any audios.

https://github.com/user-attachments/assets/3a252167-3cf6-4b3d-bd09-e5ed7e955fb1

@aakashbashyal21 commented on GitHub (Oct 3, 2025): I am also running my app through cloudfare tunnel and has a private IP. I am not able to download the files it get crashed, and also not able to skip forward any audios. https://github.com/user-attachments/assets/3a252167-3cf6-4b3d-bd09-e5ed7e955fb1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1196