[GH-ISSUE #688] epub output parsing errors #345

Closed
opened 2026-02-25 23:34:00 +03:00 by kerem · 3 comments
Owner

Originally created by @blogbourri on GitHub (Jul 31, 2023).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/688

Originally assigned to: @Monirzadeh on GitHub.

Data

  • Shiori version: ghcr.io/go-shiori/shiori:latest
  • Database Engine: mysql
  • Operating system: synology
  • CLI/Web interface/Web Extension: web interface

Describe the bug / actual behavior

Epub files currently output are malformed. This caused the following error on calibre-web, which was resolved when I removed the malformed epubs from my library:

https://github.com/janeczku/calibre-web/issues/2834

Note from the error message:

lxml.etree.XMLSyntaxError: Namespace prefix dc on title is not defined, line 4, column 14

Checking the epubs with epubcheck returns three errors:

ERROR(RSC-005): ./books/Bo/databases/eBookIt/temp_uploads/1690815957.epub/OEBPS/content.opf(-1,-1): Error while parsing file: The prefix "dc" for element "dc:title" is not bound.

ERROR(OPF-001): ./books/Bo/databases/eBookIt/temp_uploads/1690815957.epub/OEBPS/content.opf(-1,-1): There was an error when parsing the EPUB version: Version not found.

ERROR(PKG-007): ./books/Bo/databases/eBookIt/temp_uploads/1690815957.epub/mimetype(-1,-1): Mimetype file should only contain the string "application/epub+zip" and should not be compressed.

Therefore, it seems to be the title element specifically that is causing the issue here, but there shouldn't be the other errors either.

Expected behavior

Epubs should be valid against W3C standards and compatible with standard epub software.

To Reproduce

Steps to reproduce the behavior:

  1. Validate epub from shiori here or with epubcheck: https://www.ebookit.com/tools/bp/Bo/eBookIt/epub-validator
Originally created by @blogbourri on GitHub (Jul 31, 2023). Original GitHub issue: https://github.com/go-shiori/shiori/issues/688 Originally assigned to: @Monirzadeh on GitHub. ## Data - **Shiori version**: ghcr.io/go-shiori/shiori:latest - **Database Engine**: mysql - **Operating system**: synology - **CLI/Web interface/Web Extension**: web interface ## Describe the bug / actual behavior Epub files currently output are malformed. This caused the following error on calibre-web, which was resolved when I removed the malformed epubs from my library: https://github.com/janeczku/calibre-web/issues/2834 Note from the error message: ```lxml.etree.XMLSyntaxError: Namespace prefix dc on title is not defined, line 4, column 14``` Checking the epubs with epubcheck returns three errors: ``` ERROR(RSC-005): ./books/Bo/databases/eBookIt/temp_uploads/1690815957.epub/OEBPS/content.opf(-1,-1): Error while parsing file: The prefix "dc" for element "dc:title" is not bound. ERROR(OPF-001): ./books/Bo/databases/eBookIt/temp_uploads/1690815957.epub/OEBPS/content.opf(-1,-1): There was an error when parsing the EPUB version: Version not found. ERROR(PKG-007): ./books/Bo/databases/eBookIt/temp_uploads/1690815957.epub/mimetype(-1,-1): Mimetype file should only contain the string "application/epub+zip" and should not be compressed. ``` Therefore, it seems to be the title element specifically that is causing the issue here, but there shouldn't be the other errors either. ## Expected behavior Epubs should be valid against W3C standards and compatible with standard epub software. ## To Reproduce Steps to reproduce the behavior: 1. Validate epub from shiori here or with epubcheck: https://www.ebookit.com/tools/bp/Bo/eBookIt/epub-validator
kerem 2026-02-25 23:34:00 +03:00
Author
Owner

@fmartingr commented on GitHub (Aug 1, 2023):

Thanks for raising awareness of this. Ebooks is a very recent feature and we are currently working on it.

Leaving this here as well, which would make easy to make tests for this:

https://www.w3.org/publishing/epubcheck/

<!-- gh-comment-id:1660025988 --> @fmartingr commented on GitHub (Aug 1, 2023): Thanks for raising awareness of this. Ebooks is a very recent feature and we are currently working on it. Leaving this here as well, which would make easy to make tests for this: https://www.w3.org/publishing/epubcheck/
Author
Owner

@Monirzadeh commented on GitHub (Aug 4, 2023):

@blogbourri Thanks for report, we work on this can you please give me a link example?
Or confirm if this file work fine in your device? (image too)
book.zip

<!-- gh-comment-id:1665442819 --> @Monirzadeh commented on GitHub (Aug 4, 2023): @blogbourri Thanks for report, we work on this can you please give me a link example? Or confirm if this file work fine in your device? (image too) [book.zip](https://github.com/go-shiori/shiori/files/12260099/book.zip)
Author
Owner

@blogbourri commented on GitHub (Aug 5, 2023):

@blogbourri Thanks for report, we work on this can you please give me a link example? Or confirm if this file work fine in your device? (image too) book.zip

just tested your epub and yes it does work :)

if you still want an example that breaks it, you can try this one:

https://bookmark.colorbash.art/bookmark/25/content

<!-- gh-comment-id:1666566296 --> @blogbourri commented on GitHub (Aug 5, 2023): > @blogbourri Thanks for report, we work on this can you please give me a link example? Or confirm if this file work fine in your device? (image too) [book.zip](https://github.com/go-shiori/shiori/files/12260099/book.zip) just tested your epub and yes it does work :) if you still want an example that breaks it, you can try this one: https://bookmark.colorbash.art/bookmark/25/content
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#345
No description provided.