Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Bad epub causes crash with Unhandled rejection error #2856

Closed
evilalmus opened this issue Apr 16, 2024 · 8 comments
Closed

[Bug]: Bad epub causes crash with Unhandled rejection error #2856

evilalmus opened this issue Apr 16, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@evilalmus
Copy link

Describe the issue

Brand new install on Docker, I am probably doing something wrong. Install works, and it starts scanning my library, but it very quickly crashes. Below is the error included in the Crash Log:

[Server] Unhandled rejection: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'buffer' is empty and cannot be written. Received , promise: Promise {
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'buffer' is empty and cannot be written. Received
at Object.read (node:fs:673:11)
at FsRead.read (/server/libs/nodeStreamZip/index.js:979:10)
at FileWindowBuffer.read (/server/libs/nodeStreamZip/index.js:1023:86)
at readEntries (/server/libs/nodeStreamZip/index.js:319:12)
at Object.readCentralDirectoryComplete [as complete] (/server/libs/nodeStreamZip/index.js:252:9)
at FsRead.readUntilFoundCallback [as callback] (/server/libs/nodeStreamZip/index.js:192:14)
at FsRead.readCallback (/server/libs/nodeStreamZip/index.js:996:19)
at FSReqCallback.wrapper [as oncomplete] (node:fs:686:5) {
code: 'ERR_INVALID_ARG_VALUE'
}
}

Steps to reproduce the issue

  1. Launch Docker container, and point it at an existing library.

Audiobookshelf version

v2.8.1

How are you running audiobookshelf?

Docker

@evilalmus evilalmus added the bug Something isn't working label Apr 16, 2024
@evilalmus
Copy link
Author

Here are the WARN and ERROR Logs from right before the FATAL:

2024-04-16 12:39:18.685
WARN
Cover image not found in manifest for epub at "/audiobooks/Samantha Shannon/A_Day_of_Fallen_Night_-_Samantha_Shannon.epub"

2024-04-16 12:39:18.847
WARN
Cover image not found in manifest for epub at "/audiobooks/William Boyd/The Romantic - William Boyd.epub"

2024-04-16 12:39:21.037
WARN
Cover image not found in manifest for epub at "/audiobooks/Ernest Hemingway/Ernest Hemingway - Big Two-Hearted River.epub"

2024-04-16 12:39:21.308
ERROR
[xmlToJSON] Error Error: Unexpected close tag Line: 10 Column: 1461 Char: >

2024-04-16 12:39:27.173
ERROR
[parseEpubMetadata] Failed to extract META-INF/container.xml from epub at "/audiobooks/Dinesh D'Souza/Dinesh D'Souza - 2,000 Mules (2022).epub" TypeError [ERR_INVALID_ARG_VALUE]: The argument 'buffer' is empty and cannot be written. Received

2024-04-16 12:39:27.174
FATAL
[Server] Unhandled rejection: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'buffer' is empty and cannot be written. Received , promise: Promise { TypeError [ERR_INVALID_ARG_VALUE]: The argument 'buffer' is empty and cannot be written. Received at Object.read (node:fs:673:11) at FsRead.read (/server/libs/nodeStreamZip/index.js:979:10) at FileWindowBuffer.read (/server/libs/nodeStreamZip/index.js:1023:86) at readEntries (/server/libs/nodeStreamZip/index.js:319:12) at Object.readCentralDirectoryComplete [as complete] (/server/libs/nodeStreamZip/index.js:252:9) at FsRead.readUntilFoundCallback [as callback] (/server/libs/nodeStreamZip/index.js:192:14) at FsRead.readCallback (/server/libs/nodeStreamZip/index.js:996:19) at FSReqCallback.wrapper [as oncomplete] (node:fs:686:5) { code: 'ERR_INVALID_ARG_VALUE' } }

@nichwall
Copy link
Contributor

nichwall commented Apr 16, 2024

Related to #2750

Edit: Whoops, that issue is actually about CBR/CBZ. Someone mentioned getting this same error with epub but can't find where that was...

@evilalmus
Copy link
Author

I was about to say, I don't have any CBR or CBZ files ;)

@evilalmus
Copy link
Author

I did look for an existing issue before I opened this one

@advplyr
Copy link
Owner

advplyr commented Apr 16, 2024

Can you share the 2,000 Mules epub with me in a Discord DM or via email to dev@advplyr.com for testing?

@advplyr advplyr added the waiting Waiting for OP label Apr 16, 2024
@evilalmus
Copy link
Author

Can you share the 2,000 Mules epub with me in a Discord DM or via email to dev@advplyr.com for testing?

Sent via Discord DM

@advplyr
Copy link
Owner

advplyr commented Apr 16, 2024

This was a bad epub file but we should be catching the errors thrown by node stream zip library.

@advplyr advplyr removed the waiting Waiting for OP label Apr 16, 2024
@advplyr advplyr changed the title [Bug]: Crash with Unhandled rejection error [Bug]: Bad epub causes crash with Unhandled rejection error Apr 16, 2024
@advplyr advplyr added the awaiting release Issue is resolved and will be in the next release label Apr 21, 2024
@advplyr
Copy link
Owner

advplyr commented Apr 22, 2024

Fixed in v2.9.0

@advplyr advplyr closed this as completed Apr 22, 2024
@advplyr advplyr removed the awaiting release Issue is resolved and will be in the next release label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants