[GH-ISSUE #3418] [BUG]: epub import is borken and kills the container #2204

Closed
opened 2026-02-22 18:28:38 -05:00 by yindo · 1 comment
Owner

Originally created by @Fade78 on GitHub (Mar 7, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3418

Originally assigned to: @shatfield4 on GitHub.

How are you running AnythingLLM?

Docker (local)

What happened?

When putting an epub on document ingestion:

[backend] info: Primary server in HTTP mode listening on port 3001
[backend] info: [BackgroundWorkerService] Feature is not enabled and will not be started.
[backend] info: [MetaGenerator] fetching custom meta tag settings...
[backend] info: [EncryptionManager] Loaded existing key & salt for encrypting arbitrary data.
/app/collector/node_modules/xml2js/lib/parser.js:344
          throw err;
          ^

TypeError: ((branch[i].navLabel && branch[i].navLabel.text) || branch[i].navLabel || "").trim is not a function
    at EPub.walkNavMap (/app/collector/node_modules/epub2/lib/epub.js:539:105)
    at Parser.<anonymous> (/app/collector/node_modules/epub2/lib/epub.js:492:37)
    at Parser.emit (node:events:517:28)
    at SAXParser.onclosetag (/app/collector/node_modules/xml2js/lib/parser.js:276:26)
    at emit (/app/collector/node_modules/sax/lib/sax.js:625:35)
    at emitNode (/app/collector/node_modules/sax/lib/sax.js:630:5)
    at closeTag (/app/collector/node_modules/sax/lib/sax.js:890:7)
    at SAXParser.write (/app/collector/node_modules/sax/lib/sax.js:1437:13)
    at exports.Parser.Parser.parseString (/app/collector/node_modules/xml2js/lib/parser.js:337:31)
    at Parser.parseString (/app/collector/node_modules/xml2js/lib/parser.js:5:59)
    at /app/collector/node_modules/epub2/lib/epub.js:500:23
    at /app/collector/node_modules/epub2/zipfile.js:29:21
    at /app/collector/node_modules/adm-zip/zipEntry.js:92:33
    at InflateRaw.<anonymous> (/app/collector/node_modules/adm-zip/methods/inflater.js:26:29)
    at InflateRaw.emit (node:events:517:28)
    at endReadableNT (node:internal/streams/readable:1400:12)

Node.js v18.20.5

And then the container crashes.

Are there known steps to reproduce?

Try to upload an epub document.

Originally created by @Fade78 on GitHub (Mar 7, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3418 Originally assigned to: @shatfield4 on GitHub. ### How are you running AnythingLLM? Docker (local) ### What happened? When putting an epub on document ingestion: ``` [backend] info: Primary server in HTTP mode listening on port 3001 [backend] info: [BackgroundWorkerService] Feature is not enabled and will not be started. [backend] info: [MetaGenerator] fetching custom meta tag settings... [backend] info: [EncryptionManager] Loaded existing key & salt for encrypting arbitrary data. /app/collector/node_modules/xml2js/lib/parser.js:344 throw err; ^ TypeError: ((branch[i].navLabel && branch[i].navLabel.text) || branch[i].navLabel || "").trim is not a function at EPub.walkNavMap (/app/collector/node_modules/epub2/lib/epub.js:539:105) at Parser.<anonymous> (/app/collector/node_modules/epub2/lib/epub.js:492:37) at Parser.emit (node:events:517:28) at SAXParser.onclosetag (/app/collector/node_modules/xml2js/lib/parser.js:276:26) at emit (/app/collector/node_modules/sax/lib/sax.js:625:35) at emitNode (/app/collector/node_modules/sax/lib/sax.js:630:5) at closeTag (/app/collector/node_modules/sax/lib/sax.js:890:7) at SAXParser.write (/app/collector/node_modules/sax/lib/sax.js:1437:13) at exports.Parser.Parser.parseString (/app/collector/node_modules/xml2js/lib/parser.js:337:31) at Parser.parseString (/app/collector/node_modules/xml2js/lib/parser.js:5:59) at /app/collector/node_modules/epub2/lib/epub.js:500:23 at /app/collector/node_modules/epub2/zipfile.js:29:21 at /app/collector/node_modules/adm-zip/zipEntry.js:92:33 at InflateRaw.<anonymous> (/app/collector/node_modules/adm-zip/methods/inflater.js:26:29) at InflateRaw.emit (node:events:517:28) at endReadableNT (node:internal/streams/readable:1400:12) Node.js v18.20.5 ``` And then the container crashes. ### Are there known steps to reproduce? Try to upload an epub document.
yindo added the possible bugneeds info / can't replicate labels 2026-02-22 18:28:38 -05:00
yindo closed this issue 2026-02-22 18:28:38 -05:00
Author
Owner

@timothycarambat commented on GitHub (Mar 9, 2025):

Do you have an epub we can use to replicate? It does not replicate locally or on my selection of epubs we used to verify this. This error stems from Langchains epub parser as well, so its a dependency issue at this time. Closing until we have a file we can replicate with

@timothycarambat commented on GitHub (Mar 9, 2025): Do you have an `epub` we can use to replicate? It does not replicate locally or on my selection of epubs we used to verify this. This error stems from Langchains epub parser as well, so its a dependency issue at this time. Closing until we have a file we can replicate with
yindo changed title from [BUG]: epub import is borken and kills the container to [GH-ISSUE #3418] [BUG]: epub import is borken and kills the container 2026-06-05 14:45:09 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2204