mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Bug]: Android - Unable to download audiobook. Stuck at "0% Preparing" #217
Closed
opened 2026-04-24 23:01:17 +02:00 by adam
·
8 comments
No Branch/Tag Specified
master
book_tags_genres_dedupe
episode_download_fallback
Issue-4540-SortBy-StartedDate-and-FinishedDate
episode_meta_tagging
fix_authorize_race_condition
redirect_transcode_requests
progress_updated_sort
fix_ereader_socket_event
fix_change_empty_root_password
fix_podcast_session_track_index
fix_set_token
session_modal_user
localize_durations
fix_oidc_create_user
jwt_auth_refactor
fix_scanner_deleting_single_file_books
fix_mediaprogress_updatedat_2
experimental_next_client
podcast_episode_duration
episode-timestamps-clickable
book_author_secondary_sort_title
podcast_useragents
pathexists_user_access
fix_pathexists_join
book_author_secondary_sort
clean_duplicate_mediaprogress
sanitize_html_description
trix_prevent_attachments
check_path_api_fix
fix_mediaprogress_updatedat
increase_express_json_limit
fix_dockerfile_nunicode
search_episodes
audiobook_tools_update
episode_secondary_sorts
hls_stream_url_update
new_session_track_endpoint
audiobook_tools_enhancements
watcher_rescans_update
player_track_tooltip
fix_exclude_prefixes_crash
socket_item_events
fix_podcast_episode_scanner_promise
new_stats_controller
count_cache_for_userpermissions
parsing-opf-v3
validate_migration_files
fix-quick-match-all-crash
fix-chapter-end-sleep-timer
stringify_sequelize_query
remove-col-ambiguity
fix_next_prev_edit_description
details_trim_whitespace
fix_content_url_basepath
fix_logger_fatal
progress_bar_visibility
batch-edit-populate-map-details
feed_generator_updates
bookmark-modal-updates
migrate-library-item-in-scanner
migrate-new-library-items
migrate-podcasts-new-library-item-2
migrate-podcasts-new-library-item
fix-remove-episode-from-playlist
playback-session-use-new-library-item
refactor-library-item
fix-heatmap-caption
feed-episodes-upsert
share-media-player-media-session-api
remove-old-playlist
remove_old_collection_object
plugin-implementation-demo
feed_migration
refactor-feeds-from-item
fix_remove_authors_no_books
v2.17.3-fk-constraints-migration
migrations-first-upgrade
sqlite_2
feature/nuxt-target-server
waveform
sqlite
playlists
video
v2.35.1
v2.35.0
v2.34.0
v2.33.2
v2.33.1
v2.33.0
v2.32.1
v2.32.0
v2.31.0
v2.30.0
v2.29.0
v2.28.0
v2.27.0
v2.26.3
v2.26.2
v2.26.1
v2.26.0
v2.25.1
v2.25.0
v2.24.0
v2.23.0
v2.22.0
v2.21.0
v2.20.0
v2.19.5
v2.19.4
v2.19.3
v2.19.2
v2.19.1
v2.19.0
v2.18.1
v2.18.0
v2.17.7
v2.17.6
v2.17.5
v2.17.4
v2.17.3
v2.17.2
v2.17.1
v2.17.0
v2.16.2
v2.16.1
v2.16.0
v2.15.1
v2.15.0
v2.14.0
v2.13.4
v2.13.3
v2.13.2
v2.13.1
v2.13.0
v2.12.3
v2.12.2
v2.12.1
v2.12.0
v2.11.0
v2.10.1
v2.10.0
v2.9.0
v2.8.1
v2.8.0
v2.7.2
v2.7.1
v2.7.0
v2.6.0
v2.5.0
v2.4.4
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.5
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.23
v2.2.22
v2.2.21
v2.2.20
v2.2.19
v2.2.18
v2.2.17
v2.2.16
v2.2.15
v2.2.14
v2.2.13
v2.2.12
v2.2.11
v2.2.10
v2.2.9
v2.2.8
v2.2.7
v2.2.6
v2.2.5
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.24
v2.0.23
v2.0.22
v2.0.21
v2.0.20
v2.0.19
v2.0.18
v2.0.17
v2.0.16
v2.0.15
v2.0.14
v2.0.13
v2.0.12
v2.0.11
v2.0.10
v2.0.9
v2.0.8
v2.0.7
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v1.7.2
v1.7.1
v1.7.0
v1.6.0
v1.5.5
v1.5.0
v1.4.11
v1.4.9
v1.4.7
v1.4.6
v1.4.4
v1.4.2
v1.4.0
v1.4.1
v1.3.4
v1.3.3
v1.3.1
v1.2.8
v1.2.6
v1.2.5
v1.2.4
v1.2.1
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.0.0
0.9.61-beta.0
0.9.61-beta
Labels
Clear labels
authentication
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
pull-request
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
Mirrored from GitHub Pull Request
No Label
bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
adam (Adam Melkus)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/audiobookshelf#217
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @grammatron on GitHub (Mar 3, 2022).
Describe the issue
Running the latest version of 1.7.1 in Docker on a Synology NAS. Web portal access to audiobookshelf works with no problems; can log in with root and other users, browse and download books.
Pixel 2\Android 11 running latest audiobookshelf app can also connect/log in with root and other audiobookshelf users (locally, not outside of network) and can browse the full library and stream books to Android with no issues but all download attempts for any book to Android fail to start and hang at 0% "Preparing". I've left the download in place for over an hour without it working or timing out.
To stop the download I have to close the Android app, log back into Android>audiobookshelf >downloads and can then remove the download after it registers as failed.
I checked logging and confirmed the files are queued up in metadata/downloads
Logs:
{"timestamp":"2022-03-03T00:48:33.468Z","message":"Recieved ping","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:48:45.733Z","message":"[SOCKET] Socket Connected qEE2Mvsf3ivAWx75AAAL","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:49:42.673Z","message":"Start Download for ab_jxgtag54tdmx8ol6u3 - DownloadId: dl_dums9ouleu5e4atvnc - /metadata/downloads/dl_dums9ouleu5e4atvnc","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:49:42.845Z","message":"[DownloadWorker] FFMPEG concat started with command: ffmpeg -safe 0 -f concat -i /metadata/downloads/dl_dums9ouleu5e4atvnc/files.txt -y -loglevel error -max_muxing_queue_size 1000 -c:a copy /metadata/downloads/dl_dums9ouleu5e4atvnc/Singles Table.mp3","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:49:57.406Z","message":"[DownloadWorker] worker ended","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:49:58.780Z","message":"[DownloadManager] Download Ready dl_dums9ouleu5e4atvnc","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:50:25.618Z","message":"[Server] Socket qEE2Mvsf3ivAWx75AAAL disconnected from client "root" after 99884ms","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:50:37.225Z","message":"[SOCKET] Socket Connected JSqiZYf1yPqKgqFUAAAN","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:51:50.997Z","message":"[Server] Socket JSqiZYf1yPqKgqFUAAAN disconnected from client "root" after 73772ms","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:51:54.291Z","message":"Recieved ping","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:51:54.301Z","message":"Recieved ping","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:51:54.413Z","message":"[SOCKET] Socket Connected M4WAoOhC2bwnBTbKAAAP","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:52:39.422Z","message":"Start Download for ab_gx7v993jzzzewvw0fj - DownloadId: dl_9cuphp0avkkmn98u7d - /metadata/downloads/dl_9cuphp0avkkmn98u7d","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:52:39.590Z","message":"[DownloadWorker] FFMPEG concat started with command: ffmpeg -safe 0 -f concat -i /metadata/downloads/dl_9cuphp0avkkmn98u7d/files.txt -y -loglevel error -max_muxing_queue_size 1000 -c:a copy /metadata/downloads/dl_9cuphp0avkkmn98u7d/3 - Before She Dies.mp3","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:52:52.923Z","message":"[DownloadWorker] worker ended","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:52:54.225Z","message":"[DownloadManager] Download Ready dl_9cuphp0avkkmn98u7d","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:56:03.572Z","message":"[Server] Socket M4WAoOhC2bwnBTbKAAAP disconnected from client "root" after 249159ms","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:56:12.070Z","message":"Recieved ping","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:56:12.083Z","message":"Recieved ping","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T00:56:12.186Z","message":"[SOCKET] Socket Connected mO43TxWp2o8E3IRUAAAR","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:00:00.525Z","message":"[BackupManager] Running Backup","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:00:00.734Z","message":"[BackupManager] 110656 total bytes","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:00:00.734Z","message":"[BackupManager] Backup successful 2022-03-03T0100","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:00:00.742Z","message":"[BackupManager] Backup "2022-03-02T0100" Removed","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:15.795Z","message":"[StreamManager] Open Stream Request mO43TxWp2o8E3IRUAAAR ab_scuvi0p9onyxs4mrby","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:15.807Z","message":"[STREAM] START STREAM - Num Segments: 5795","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:15.808Z","message":"Stream Opened for client root for audiobook Twisted with streamId str_wv1wd3mf0qt6f93w9n","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:15.843Z","message":"[INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/str_wv1wd3mf0qt6f93w9n/files.txt -y -loglevel error -map 0:a -c:a copy -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 0 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/str_wv1wd3mf0qt6f93w9n/output-%d.ts /metadata/streams/str_wv1wd3mf0qt6f93w9n/final-output.m3u8","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:15.844Z","message":"","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:17.849Z","message":"[STREAM] str_wv1wd3mf0qt6f93w9n notifying client that stream is ready","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:17.852Z","message":"[STREAM-CHECK] Check Files 779 of 5795 13.44% Furthest Segment: 778","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:19.855Z","message":"[STREAM-CHECK] Check Files 1558 of 5795 26.89% Furthest Segment: 1557","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:21.859Z","message":"[STREAM-CHECK] Check Files 2322 of 5795 40.07% Furthest Segment: 2321","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:23.858Z","message":"[STREAM-CHECK] Check Files 3063 of 5795 52.86% Furthest Segment: 3062","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:25.867Z","message":"[STREAM-CHECK] Check Files 3791 of 5795 65.42% Furthest Segment: 3790","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:27.865Z","message":"[STREAM-CHECK] Check Files 4511 of 5795 77.84% Furthest Segment: 4510","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:28.321Z","message":"Start Download for ab_scuvi0p9onyxs4mrby - DownloadId: dl_8ciacdv9eyasa5widw - /metadata/downloads/dl_8ciacdv9eyasa5widw","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:28.502Z","message":"[DownloadWorker] FFMPEG concat started with command: ffmpeg -safe 0 -f concat -i /metadata/downloads/dl_8ciacdv9eyasa5widw/files.txt -y -loglevel error -max_muxing_queue_size 1000 -c:a copy /metadata/downloads/dl_8ciacdv9eyasa5widw/2 - Twisted.mp3","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:29.867Z","message":"[STREAM-CHECK] Check Files 5180 of 5795 89.39% Furthest Segment: 5179","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:31.743Z","message":"[FFMPEG] Transcoding ended","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:41.035Z","message":"[DownloadWorker] worker ended","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:01:42.183Z","message":"[DownloadManager] Download Ready dl_8ciacdv9eyasa5widw","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:02:13.856Z","message":"Close Stream Request mO43TxWp2o8E3IRUAAAR","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:02:13.857Z","message":"Closing Stream str_wv1wd3mf0qt6f93w9n","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:02:14.281Z","message":"Deleted session data /metadata/streams/str_wv1wd3mf0qt6f93w9n","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:07:03.339Z","message":"[Server] Socket mO43TxWp2o8E3IRUAAAR disconnected from client "root" after 651154ms","levelName":"INFO","level":2}
{"timestamp":"2022-03-03T01:09:47.759Z","message":"[SOCKET] Socket Connected e3c8LJIp1h8bnshGAAAT","levelName":"INFO","level":2}
Steps to reproduce the issue
Android
Steps taken to try and resolve the issue that failed:
Stopped and restarted audiobookshelf container
Uninstalled and reinstalled audiobookshelf on Android
Installed audiobookshelf on another Android device, logged in as root and other users. Downloads still fail
Created new folder on Android and selected as download location
Rebooted Android
Created new container from scratch; recreated accounts and rescanned media
Audiobookshelf version
1.7.1
How are you running audiobookshelf?
Docker
@advplyr commented on GitHub (Mar 3, 2022):
One issue with the download right now is that you need to leave the book page up after pressing downloading until it is finished preparing. If you're already doing that and it is stuck, you can check to see that the download was actually prepared by going into the /metadata/downloads/ folder and seeing if the concatenated audio file is there.
The mobile download is going to be re-done to remove the concat step, and instead download each audio file.
If you have any audiobooks that are already a single file, it could also help to test downloading that one on mobile because then it won't need to do the prepare step.
@grammatron commented on GitHub (Mar 3, 2022):
Thanks advplyr. I did not read/see about the issue of having to wait in the book once the download was started and preparing. I tested waiting in the book after starting the download and after a short time it did begin the download and completed.
That was something I did not test while troubleshooting; The download would be started and then the book was exited from to move to another book or to go to the download section.
I tested both single file books and multi part/chapter books, all of which downloaded successfully while waiting in each book for the download to prepare and then start.
Thank you for the quick reply and all the efforts you're putting into this app!!
@grammatron commented on GitHub (Mar 6, 2022):
advplyr
I found another issue on the Pixel 2 XL. Through the app after I download books when I try to play the book, the phone screen, not OS, goes into a loop where the screen flashes from home screen to black as if the display was turning off then on. The only option I found to stop it is to force a shutdown. Both phones are running stock Android 11.
I have a couple of spare Samsung tablets that I will install and test against to see if the issue happens there as well but for now it's happening on both Pixel phones.
@advplyr commented on GitHub (Mar 6, 2022):
Ugh I thought this issue was isolated to the OneNote and Sony Xperia devices.
The problem is the cover art being put into the notification you see on the lock screen and task list. For the other 2 devices I mentioned I added a special exception that doesn't use covers in the notification as a temporary workaround.
If you can try removing the cover art from an audiobook on your server, then downloading it fresh and playing. If that works without the cover then we can confirm it is the same issue.
@grammatron commented on GitHub (Mar 6, 2022):
I tested against one book, removed the cover art as you noted and confirmed that the book downloaded and could play without the screen loop issue happening.
@advplyr commented on GitHub (Mar 7, 2022):
What folder are you storing audiobooks in?
Can you check to make sure that folder is set in the downloads page.
I've tested on many devices to try to replicate this issue so I can debug it, but even with the same model and android version covers work fine. I have tested on Pixel 2, 3, 4 and 6 from Android 8 and up.
I have confirmed with logs sent to me from someone else having this issue that it has to do with file read permissions. If you also don't mind changing the download location to another folder on your device, the more data the better.
@grammatron commented on GitHub (Mar 8, 2022):
Books are downloaded to a custom folder on each phone; one to folder Books the other to folder Audiobooks, both under main storage.
I confirmed the folders that the books are downloading to are set in the downloads page for each phone; books and cover art are found in each folder after a download.
I also checked the app permissions to make sure files and media permissions are allowed.
I changed download folders on each phone to multiple stock folders as well as created several new folders, each complete the downloads but fail to play without causing the loop.
@advplyr commented on GitHub (Apr 24, 2022):
The downloader for android was remade in v0.9.41-beta and up working with server v2 and up.
Download issues for android app can be put in the audiobookshelf-app github repo.