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

Server shutdown on bad metadata #880

Closed
wtanksleyjr opened this issue Aug 1, 2022 · 4 comments
Closed

Server shutdown on bad metadata #880

wtanksleyjr opened this issue Aug 1, 2022 · 4 comments

Comments

@wtanksleyjr
Copy link

...as a side note, it would be nice to have more information about what file is causing problems - I've seen a lot of errors, and I've never seen info about what filenames are causing them.

audiobookshelf_1  | [2022-08-01 19:41:26]  WARN: [abmetadataGenerator] Invalid chapter
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [Book] Overdrive Media Markers and preference found! Using these for chapter definitions
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [parseOverdriveMediaMarkers] Parsing of Overdrive Media Markers started
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [Book] Overdrive Media Markers and preference found! Using these for chapter definitions
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [parseOverdriveMediaMarkers] Parsing of Overdrive Media Markers started
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [Book] Overdrive Media Markers and preference found! Using these for chapter definitions
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [parseOverdriveMediaMarkers] Parsing of Overdrive Media Markers started
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [Book] Overdrive Media Markers and preference found! Using these for chapter definitions
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [parseOverdriveMediaMarkers] Parsing of Overdrive Media Markers started
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [Book] Overdrive Media Markers and preference found! Using these for chapter definitions
audiobookshelf_1  | [2022-08-01 19:42:52]  INFO: [parseOverdriveMediaMarkers] Parsing of Overdrive Media Markers started
audiobookshelf_1  | /server/libs/njodb/index.js:103
audiobookshelf_1  |         throw error;
audiobookshelf_1  |         ^
audiobookshelf_1  |
audiobookshelf_1  | TypeError: Cannot read properties of undefined (reading 'Markers')
audiobookshelf_1  |     at /server/utils/parsers/parseOverdriveMediaMarkers.js:57:56
audiobookshelf_1  |     at Parser.<anonymous> (/node_modules/xml2js/lib/parser.js:308:18)
audiobookshelf_1  |     at Parser.emit (node:events:527:28)
audiobookshelf_1  |     at SAXParser.onerror (/node_modules/xml2js/lib/parser.js:123:26)
audiobookshelf_1  |     at emit (/node_modules/sax/lib/sax.js:624:35)
audiobookshelf_1  |     at error (/node_modules/sax/lib/sax.js:653:5)
audiobookshelf_1  |     at strictFail (/node_modules/sax/lib/sax.js:677:7)
audiobookshelf_1  |     at SAXParser.write (/node_modules/sax/lib/sax.js:1491:13)
audiobookshelf_1  |     at Parser.exports.Parser.Parser.parseString (/node_modules/xml2js/lib/parser.js:323:31)
audiobookshelf_1  |     at Parser.parseString (/node_modules/xml2js/lib/parser.js:5:59)
audiobookshelf_1  | Emitted 'error' event on Parser instance at:
audiobookshelf_1  |     at Parser.exports.Parser.Parser.parseString (/node_modules/xml2js/lib/parser.js:327:16)
audiobookshelf_1  |     at Parser.parseString (/node_modules/xml2js/lib/parser.js:5:59)
audiobookshelf_1  |     at exports.parseString (/node_modules/xml2js/lib/parser.js:369:19)
audiobookshelf_1  |     at /server/utils/parsers/parseOverdriveMediaMarkers.js:37:5
audiobookshelf_1  |     at Array.forEach (<anonymous>)
audiobookshelf_1  |     at cleanOverdriveMediaMarkers (/server/utils/parsers/parseOverdriveMediaMarkers.js:35:25)
audiobookshelf_1  |     at module.exports.parseOverdriveMediaMarkersAsChapters (/server/utils/parsers/parseOverdriveMediaMarkers.js:144:38)
audiobookshelf_1  |     at Book.setChapters (/server/objects/mediaTypes/Book.js:407:30)
audiobookshelf_1  |     at Book.rebuildTracks (/server/objects/mediaTypes/Book.js:368:10)
audiobookshelf_1  |     at MediaFileScanner.scanMediaFiles (/server/scanner/MediaFileScanner.js:276:29)
cops-bookserver_audiobookshelf_1 exited with code 7
@wtanksleyjr
Copy link
Author

This is in 2.1.1, book metadata stored in folders, all folders have an OPF file (because I want to control the input).

When I upgraded to the new version, I decided to wipe out my old config and reload everything, so this is a complete from-scratch rescan.

@advplyr
Copy link
Owner

advplyr commented Aug 1, 2022

I added a check for invalid overdrive chapter data so it doesn't crash the server for the next release.

If you turn on debug logs you may be able to see which book that was.
I try to put the media title or folder path in all error messages, this one was not caught so it wouldn't have it but if you spotted other error messages that don't have the title in it please let me know.

@wtanksleyjr
Copy link
Author

I did see one more without enough information to identify the file (I actually tried, but in the end I gave up):

audiobookshelf_1  | [2022-08-01 18:26:57] ERROR: [xmlToJSON] Error Error: No whitespace between attributes
audiobookshelf_1  | Line: 7
audiobookshelf_1  | Column: 51
audiobookshelf_1  | Char: H
audiobookshelf_1  |     at error (/node_modules/sax/lib/sax.js:651:10)
audiobookshelf_1  |     at strictFail (/node_modules/sax/lib/sax.js:677:7)
audiobookshelf_1  |     at SAXParser.write (/node_modules/sax/lib/sax.js:1395:13)
audiobookshelf_1  |     at Parser.exports.Parser.Parser.parseString (/node_modules/xml2js/lib/parser.js:323:31)
audiobookshelf_1  |     at Parser.parseString (/node_modules/xml2js/lib/parser.js:5:59)
audiobookshelf_1  |     at exports.parseString (/node_modules/xml2js/lib/parser.js:369:19)
audiobookshelf_1  |     at /server/utils/index.js:48:5
audiobookshelf_1  |     at new Promise (<anonymous>)
audiobookshelf_1  |     at xmlToJSON (/server/utils/index.js:47:10)
audiobookshelf_1  |     at module.exports.parseOpfMetadataXML (/server/utils/parsers/parseOpfMetadata.js:104:20)

@advplyr
Copy link
Owner

advplyr commented Aug 6, 2022

Fixed in v2.1.2

@advplyr advplyr closed this as completed Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants