[Bug]: Download sometimes gets stuck on single files #1149

Open
opened 2026-04-24 23:51:02 +02:00 by adam · 22 comments
Owner

Originally created by @TrimVis on GitHub (Feb 13, 2025).

What was the Problem?

Sometimes, especially with a unreliable connection to the server (mobile data/bad wifi), single files will get stuck when trying to download a full audiobook.
By stuck I mean that the percentage displayes does not increase and the stuck file is included in the download limit (e.g. if I set it to download at most 4 files at once, it will only download 3 files at once with one stuck file).

Waiting does not resume the download and on a app restart all downloaded files will be forgotten

Steps to Reproduce the Issue

  1. Connect to a remote server with a slow/unreliable internet connection
  2. Download an audibook with many files
  3. Some files will get stuck, while all the remaining ones finish normally. However the full audibook download never terminates.

What was Expected?

I would have expected the app to detect the stuck/stalles file download and correspondingly retry.
Alternatively the ability to retry downloading of single files could help alleviate this problem (I couldn't figure out how to do that without retrying the full audiobook download)

Phone Model

OnePlus 12R

Phone OS

Android 15

Audiobookshelf App Version

Android App - 0.9.79

Installation Source

Google Play Store

Additional Notes

I had this issue appear reliably on mobile data (with a in theory good internet connection) and on wifi (with a not great WiFi signal).
The server is hosted at another place and accessed via a wireguard vpn (I doubt that this is related to the VPN, though).
During all this I always had the app open in foreground, as I was suspecting that battery saver shenanigans were happening (even though I have optimizations disabled/set to ask)

Originally created by @TrimVis on GitHub (Feb 13, 2025). ### What was the Problem? Sometimes, especially with a unreliable connection to the server (mobile data/bad wifi), single files will get stuck when trying to download a full audiobook. By stuck I mean that the percentage displayes does not increase and the stuck file is included in the download limit (e.g. if I set it to download at most 4 files at once, it will only download 3 files at once with one stuck file). Waiting does not resume the download and on a app restart all downloaded files will be forgotten ### Steps to Reproduce the Issue 1. Connect to a remote server with a slow/unreliable internet connection 2. Download an audibook with many files 3. Some files will get stuck, while all the remaining ones finish normally. However the full audibook download never terminates. ### What was Expected? I would have expected the app to detect the stuck/stalles file download and correspondingly retry. Alternatively the ability to retry downloading of single files could help alleviate this problem (I couldn't figure out how to do that without retrying the full audiobook download) ### Phone Model OnePlus 12R ### Phone OS Android 15 ### Audiobookshelf App Version Android App - 0.9.79 ### Installation Source Google Play Store ### Additional Notes I had this issue appear reliably on mobile data (with a in theory good internet connection) and on wifi (with a not great WiFi signal). The server is hosted at another place and accessed via a wireguard vpn (I doubt that this is related to the VPN, though). During all this I always had the app open in foreground, as I was suspecting that battery saver shenanigans were happening (even though I have optimizations disabled/set to ask)
adam added the bugandroid labels 2026-04-24 23:51:02 +02:00
Author
Owner

@HamletDuFromage commented on GitHub (Mar 4, 2025):

Same issue here. Got a download stuck at 20%. Stopping the app discards all the progress, and when I started over I managed to get to 64% but it still got stuck.

@HamletDuFromage commented on GitHub (Mar 4, 2025): Same issue here. Got a download stuck at 20%. Stopping the app discards all the progress, and when I started over I managed to get to 64% but it still got stuck.
Author
Owner

@TrimVis commented on GitHub (Mar 4, 2025):

If there is any way to provide additional logs, I would be happy to do so :)
Just not aware if this is natively supported by the app or not

@TrimVis commented on GitHub (Mar 4, 2025): If there is any way to provide additional logs, I would be happy to do so :) Just not aware if this is natively supported by the app or not
Author
Owner

@nichwall commented on GitHub (Mar 5, 2025):

There is not currently a way to export logs from the app (you can compile from source to get the logcat data). I have been working on refactoring and cleaning up the download logic for Android the past few weekends, so hopefully there will be something for testing soon.

@nichwall commented on GitHub (Mar 5, 2025): There is not currently a way to export logs from the app (you can compile from source to get the logcat data). I have been working on refactoring and cleaning up the download logic for Android the past few weekends, so hopefully there will be something for testing soon.
Author
Owner

@TrimVis commented on GitHub (Mar 5, 2025):

Thanks for the update!
You work is appreciated, looking forward to the (beta/test) release

@TrimVis commented on GitHub (Mar 5, 2025): Thanks for the update! You work is appreciated, looking forward to the (beta/test) release
Author
Owner

@dacmcbibs commented on GitHub (Apr 30, 2025):

I'm having a similar issue, but for me the download gets stuck if the app loses focus , as long as i leave it in the foreground everything downloads correctly. I can easily reproduce, so if a logcat would be helpful let me know

@dacmcbibs commented on GitHub (Apr 30, 2025): I'm having a similar issue, but for me the download gets stuck if the app loses focus , as long as i leave it in the foreground everything downloads correctly. I can easily reproduce, so if a logcat would be helpful let me know
Author
Owner

@nichwall commented on GitHub (May 26, 2025):

I have been working on refactoring the Android download logic over the past few months (progress was a bit slow due to life getting in the way). This refactor was primarily focused on cleaning up the framework, and not specifically aimed at fixing any particular issue. However, it is possible that the changes may have resolved this issue as a side effect.

If you get a chance, please try sideloading the APK located at the end of the pull request and let me know if you run into other issues, whether this issue still occurs, or if this issue appears to be resolved. The APK can be downloaded from the "Build APK" workflow at the end of the page by clicking on "View Details", then clicking on "Summary", then downloading the APK. The PR is https://github.com/advplyr/audiobookshelf-app/pull/1587

I am requesting feedback on all of the open Android download issues, so apologies if you receive multiple notifications.

Workflow run
APK download

@nichwall commented on GitHub (May 26, 2025): I have been working on refactoring the Android download logic over the past few months (progress was a bit slow due to life getting in the way). This refactor was primarily focused on cleaning up the framework, and not specifically aimed at fixing any particular issue. However, it is possible that the changes may have resolved this issue as a side effect. If you get a chance, please try sideloading the APK located at the end of the pull request and let me know if you run into other issues, whether this issue still occurs, or if this issue appears to be resolved. The APK can be downloaded from the "Build APK" workflow at the end of the page by clicking on "View Details", then clicking on "Summary", then downloading the APK. The PR is https://github.com/advplyr/audiobookshelf-app/pull/1587 I am requesting feedback on all of the open Android download issues, so apologies if you receive multiple notifications. ![Workflow run](https://github.com/user-attachments/assets/ac386c0c-5a3c-4b10-98a1-1c5626358348) ![APK download](https://github.com/user-attachments/assets/ded054e4-0cc5-457c-bb59-f1651197fbbc)
Author
Owner

@pvince commented on GitHub (May 26, 2025):

It is possibly better, I was able to download one large audiobook that was consistently failing before, but the second large audiobook I attempted to download locked up at 25%, and on a second try only made it to 22%.

Image

@pvince commented on GitHub (May 26, 2025): It is possibly better, I was able to download one large audiobook that was consistently failing before, but the second large audiobook I attempted to download locked up at 25%, and on a second try only made it to 22%. ![Image](https://github.com/user-attachments/assets/e88b119e-3e33-4b21-9761-8009d1fb4579)
Author
Owner

@dacmcbibs commented on GitHub (May 26, 2025):

I tried the new APK, its seems a bit better but looks like downloads still get stuck if the app loses focus

@dacmcbibs commented on GitHub (May 26, 2025): I tried the new APK, its seems a bit better but looks like downloads still get stuck if the app loses focus
Author
Owner

@nichwall commented on GitHub (May 26, 2025):

It is possibly better, I was able to download one large audiobook that was consistently failing before, but the second large audiobook I attempted to download locked up at 25%, and on a second try only made it to 22%.

Thanks for the update @pvince . Can you confirm:

  • How are you connecting to the server (directly over LAN, over internet on wifi, over internet on cell service)?
  • What version of Android/phone are you using?
  • Does restarting the app and trying to download the "stuck" book continue from where the download failed?
  • Are you downloading the book to Internal App Storage, or to Shared Storage?
  • Is it a single file book or a multi file book?

@dacmcbibs thanks for checking. This PR does not fix downloads stopping if the app loses focus.

@nichwall commented on GitHub (May 26, 2025): > It is possibly better, I was able to download one large audiobook that was consistently failing before, but the second large audiobook I attempted to download locked up at 25%, and on a second try only made it to 22%. Thanks for the update @pvince . Can you confirm: - How are you connecting to the server (directly over LAN, over internet on wifi, over internet on cell service)? - What version of Android/phone are you using? - Does restarting the app and trying to download the "stuck" book continue from where the download failed? - Are you downloading the book to Internal App Storage, or to Shared Storage? - Is it a single file book or a multi file book? @dacmcbibs thanks for checking. This PR does not fix downloads stopping if the app loses focus.
Author
Owner

@pvince commented on GitHub (May 27, 2025):

@nichwall

How are you connecting to the server (directly over LAN, over internet on wifi, over internet on cell service)?

  • wifi, I have 3x Ubiquiti WAP's in the house

What version of Android/phone are you using?

  • Pixel 8 Pro, Android 15

Does restarting the app and trying to download the "stuck" book continue from where the download failed?

  • Nope, it starts over at the beginning.

Are you downloading the book to Internal App Storage, or to Shared Storage?

  • Internal App Storage

Is it a single file book or a multi file book?

  • Single file book, ~1 GB in size

At this point, the last 3 large downloads have succeeded and I haven't had a failure since when I posted last time, so it does seem a lot more reliable.

@pvince commented on GitHub (May 27, 2025): @nichwall How are you connecting to the server (directly over LAN, over internet on wifi, over internet on cell service)? * wifi, I have 3x Ubiquiti WAP's in the house What version of Android/phone are you using? * Pixel 8 Pro, Android 15 Does restarting the app and trying to download the "stuck" book continue from where the download failed? * Nope, it starts over at the beginning. Are you downloading the book to Internal App Storage, or to Shared Storage? * Internal App Storage Is it a single file book or a multi file book? * Single file book, ~1 GB in size At this point, the last 3 large downloads have succeeded and I haven't had a failure since when I posted last time, so it does seem a lot more reliable.
Author
Owner

@ShrirajHegde commented on GitHub (Jun 28, 2025):

Please do something about the download getting stuck when app loses focus. It's really impractical to keep the app in focus for a long time while downloading large files.

It would be nice if the file downloads in background + resumes download if it's stuck.

@ShrirajHegde commented on GitHub (Jun 28, 2025): Please do something about the download getting stuck when app loses focus. It's really impractical to keep the app in focus for a long time while downloading large files. It would be nice if the file downloads in background + resumes download if it's stuck.
Author
Owner

@DownloadableFox commented on GitHub (Jul 16, 2025):

I am encountering the same issues on the latest build on Android 13. I've figured that basically doing anything that isn't waiting in the app completely stops the download. This includes:

  • Phone suspending after not interacting with it for some time
  • Leaving the app in the background
  • Any minor connection interruption (switching WiFi / loosing connection)

The only way to get it started again is to close the app and restart the download, there's no way to resume it as the app basically forgets it was downloading anything after reopening it. There's never a message telling the user the download has failed. I've encountered this issue many times. I haven't looked at the source code at all and have little Android knowledge- however I will still try to fix it if nobody takes a look at it.

I feel like the app should continue the download in the background, using one of those service notifications that a lot of Android apps use already.

@DownloadableFox commented on GitHub (Jul 16, 2025): I am encountering the same issues on the latest build on Android 13. I've figured that basically doing anything that isn't waiting in the app completely stops the download. This includes: - Phone suspending after not interacting with it for some time - Leaving the app in the background - Any minor connection interruption (switching WiFi / loosing connection) The only way to get it started again is to close the app and restart the download, there's no way to resume it as the app basically forgets it was downloading anything after reopening it. There's never a message telling the user the download has failed. I've encountered this issue many times. I haven't looked at the source code at all and have little Android knowledge- however I will still try to fix it if nobody takes a look at it. I feel like the app should continue the download in the background, using one of those service notifications that a lot of Android apps use already.
Author
Owner

@nichwall commented on GitHub (Jul 16, 2025):

I'm planning to work on implementing background downloading after the above PR is merged and gets more general testing. Nobody who has tested the APK has reported any new issues, but this is still a small subset of users.

The above PR allows resuming the incomplete download when the app is restarted, but you do need to manually press the Download button again.

@nichwall commented on GitHub (Jul 16, 2025): I'm planning to work on implementing background downloading after the above PR is merged and gets more general testing. Nobody who has tested the APK has reported any new issues, but this is still a small subset of users. The above PR allows resuming the incomplete download when the app is restarted, but you do need to manually press the Download button again.
Author
Owner

@DownloadableFox commented on GitHub (Jul 16, 2025):

I'm planning to work on implementing background downloading after the above PR is merged and gets more general testing. Nobody who has tested the APK has reported any new issues, but this is still a small subset of users.

The above PR allows resuming the incomplete download when the app is restarted, but you do need to manually press the Download button again.

Thanks for taking a look at it @nichwall. I will try the APK and confirm if I encounter any issues with your PR.

@DownloadableFox commented on GitHub (Jul 16, 2025): > I'm planning to work on implementing background downloading after the above PR is merged and gets more general testing. Nobody who has tested the APK has reported any new issues, but this is still a small subset of users. > > The above PR allows resuming the incomplete download when the app is restarted, but you do need to manually press the Download button again. Thanks for taking a look at it @nichwall. I will try the APK and confirm if I encounter any issues with your PR.
Author
Owner

@mattague commented on GitHub (Dec 9, 2025):

I just wanna say, I am having a very similar issue, ended up in this thread,scrolling reading everything, and got excited and had a little chuckle, because the book I'm trying to download is the fires of heaven haha

It is possibly better, I was able to download one large audiobook that was consistently failing before, but the second large audiobook I attempted to download locked up at 25%, and on a second try only made it to 22%.

Image

@mattague commented on GitHub (Dec 9, 2025): I just wanna say, I am having a very similar issue, ended up in this thread,scrolling reading everything, and got excited and had a little chuckle, because the book I'm trying to download is the fires of heaven haha > It is possibly better, I was able to download one large audiobook that was consistently failing before, but the second large audiobook I attempted to download locked up at 25%, and on a second try only made it to 22%. > > ![Image](https://github.com/user-attachments/assets/e88b119e-3e33-4b21-9761-8009d1fb4579)
Author
Owner

@mattague commented on GitHub (Dec 9, 2025):

I can confirm, as of 0.11.0-beta, I am still experiencing the following:

Downloading of audiobooks progress appears to halt if I leave the audiobook details page, even when clicking the downloads icon in the top right. The progress indicator just stays at whatever percentage it was at. However, if left long enough, the download does seem to complete.

@mattague commented on GitHub (Dec 9, 2025): I can confirm, as of 0.11.0-beta, I am still experiencing the following: Downloading of audiobooks progress appears to halt if I leave the audiobook details page, even when clicking the downloads icon in the top right. The progress indicator just stays at whatever percentage it was at. However, if left long enough, the download does seem to complete.
Author
Owner

@damccull commented on GitHub (Mar 17, 2026):

I'm also experiencing this issue on the latest Google play non beta. The behavior I notice is that any time the connection dies (lost focus, server going offline, network switch, etc.) no matter the original network path, the download fails without notifying or reverting the UI to a pre download state so I can try again. Closing the app and restarting it is the only way to allow a new try, and it loses all progress. This also makes me wonder if I now have partially completed downloads taking up space somewhere on my device with random names I'll never identify.

@damccull commented on GitHub (Mar 17, 2026): I'm also experiencing this issue on the latest Google play non beta. The behavior I notice is that any time the connection dies (lost focus, server going offline, network switch, etc.) no matter the original network path, the download fails without notifying or reverting the UI to a pre download state so I can try again. Closing the app and restarting it is the only way to allow a new try, and it loses all progress. This also makes me wonder if I now have partially completed downloads taking up space somewhere on my device with random names I'll never identify.
Author
Owner

@damccull commented on GitHub (Mar 17, 2026):

I have been working on refactoring the Android download logic over the past few months (progress was a bit slow due to life getting in the way). This refactor was primarily focused on cleaning up the framework, and not specifically aimed at fixing any particular issue. However, it is possible that the changes may have resolved this issue as a side effect.

If you get a chance, please try sideloading the APK located at the end of the pull request and let me know if you run into other issues, whether this issue still occurs, or if this issue appears to be resolved. The APK can be downloaded from the "Build APK" workflow at the end of the page by clicking on "View Details", then clicking on "Summary", then downloading the APK. The PR is #1587

I am requesting feedback on all of the open Android download issues, so apologies if you receive multiple notifications.

Workflow run APK download

Can you recreate or post this apk somewhere? The build expired and I can't try out this apk.

@damccull commented on GitHub (Mar 17, 2026): > I have been working on refactoring the Android download logic over the past few months (progress was a bit slow due to life getting in the way). This refactor was primarily focused on cleaning up the framework, and not specifically aimed at fixing any particular issue. However, it is possible that the changes may have resolved this issue as a side effect. > > If you get a chance, please try sideloading the APK located at the end of the pull request and let me know if you run into other issues, whether this issue still occurs, or if this issue appears to be resolved. The APK can be downloaded from the "Build APK" workflow at the end of the page by clicking on "View Details", then clicking on "Summary", then downloading the APK. The PR is [#1587](https://github.com/advplyr/audiobookshelf-app/pull/1587) > > I am requesting feedback on all of the open Android download issues, so apologies if you receive multiple notifications. > > ![Workflow run](https://github.com/user-attachments/assets/ac386c0c-5a3c-4b10-98a1-1c5626358348) ![APK download](https://github.com/user-attachments/assets/ded054e4-0cc5-457c-bb59-f1651197fbbc) Can you recreate or post this apk somewhere? The build expired and I can't try out this apk.
Author
Owner

@nichwall commented on GitHub (Mar 17, 2026):

Can you recreate or post this apk somewhere? The build expired and I can't try out this apk.

Yeah, I can push a commit later this week to force the APK to build again. I remember there were new bugs on the last commit that still need to be addressed but will need to try and remember what they were...

@nichwall commented on GitHub (Mar 17, 2026): > Can you recreate or post this apk somewhere? The build expired and I can't try out this apk. Yeah, I can push a commit later this week to force the APK to build again. I remember there were new bugs on the last commit that still need to be addressed but will need to try and remember what they were...
Author
Owner

@nichwall commented on GitHub (Mar 17, 2026):

I'm also experiencing this issue on the latest Google play non beta. The behavior I notice is that any time the connection dies (lost focus, server going offline, network switch, etc.) no matter the original network path, the download fails without notifying or reverting the UI to a pre download state so I can try again. Closing the app and restarting it is the only way to allow a new try, and it loses all progress. This also makes me wonder if I now have partially completed downloads taking up space somewhere on my device with random names I'll never identify.

To clarify, the Google Play version is also a beta (there is no full release for either Android or iOS).

When you restart a download, the existing version of the app deletes and partial files, so the only incomplete downloads will be the ones you have not tried to download again.

@nichwall commented on GitHub (Mar 17, 2026): > I'm also experiencing this issue on the latest Google play non beta. The behavior I notice is that any time the connection dies (lost focus, server going offline, network switch, etc.) no matter the original network path, the download fails without notifying or reverting the UI to a pre download state so I can try again. Closing the app and restarting it is the only way to allow a new try, and it loses all progress. This also makes me wonder if I now have partially completed downloads taking up space somewhere on my device with random names I'll never identify. To clarify, the Google Play version is also a beta (there is no full release for either Android or iOS). When you restart a download, the existing version of the app deletes and partial files, so the only incomplete downloads will be the ones you have not tried to download again.
Author
Owner

@damccull commented on GitHub (Mar 17, 2026):

I'm also experiencing this issue on the latest Google play non beta. The behavior I notice is that any time the connection dies (lost focus, server going offline, network switch, etc.) no matter the original network path, the download fails without notifying or reverting the UI to a pre download state so I can try again. Closing the app and restarting it is the only way to allow a new try, and it loses all progress. This also makes me wonder if I now have partially completed downloads taking up space somewhere on my device with random names I'll never identify.

To clarify, the Google Play version is also a beta (there is no full release for either Android or iOS).

When you restart a download, the existing version of the app deletes and partial files, so the only incomplete downloads will be the ones you have not tried to download again.

Great to hear! Thanks for the info on this.

@damccull commented on GitHub (Mar 17, 2026): > > I'm also experiencing this issue on the latest Google play non beta. The behavior I notice is that any time the connection dies (lost focus, server going offline, network switch, etc.) no matter the original network path, the download fails without notifying or reverting the UI to a pre download state so I can try again. Closing the app and restarting it is the only way to allow a new try, and it loses all progress. This also makes me wonder if I now have partially completed downloads taking up space somewhere on my device with random names I'll never identify. > > To clarify, the Google Play version is also a beta (there is no full release for either Android or iOS). > > When you restart a download, the existing version of the app deletes and partial files, so the only incomplete downloads will be the ones you have not tried to download again. Great to hear! Thanks for the info on this.
Author
Owner

@tvanantwerp commented on GitHub (Mar 18, 2026):

I'm also still experiencing this issue. I've got a large audiobook (90+ hours) that I absolutely can't finished downloading. Switching app focus causes it to hang. The screen turning off caused it to hang before I changed battery settings away from optimized. Even when I keep the screen on and the app focused, inevitably it gets to 99% and one random file in the entire 132 file book will get stuck (different file every time) and I have to start the entire download again from scratch.

Running version 0.12.0-beta on Android 16 on a Pixel 6 Pro.

@tvanantwerp commented on GitHub (Mar 18, 2026): I'm also still experiencing this issue. I've got a large audiobook (90+ hours) that I absolutely can't finished downloading. Switching app focus causes it to hang. The screen turning off caused it to hang before I changed battery settings away from optimized. Even when I keep the screen on and the app focused, inevitably it gets to 99% and one random file in the entire 132 file book will get stuck (different file every time) and I have to start _the entire download_ again from scratch. Running version 0.12.0-beta on Android 16 on a Pixel 6 Pro.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1149