0
Answered

Some cbrs dont show up right

mannamanna 1 month ago updated 1 month ago 4

Hello! I have a really strange problem: Some of my cbr-files show up with a generic book-icon, clicking on them they show "Book contains 1 page". I cannot read it, but download.

So i unpacked and packed the files again with rar, using m4 and later with m5 (rar version 4, 5), but same error. Logs show "WARN, not a rar file..."

So i renamed my freshly created rar-file (which was renamed before to .cbr) to .cbz:

Ubooquity is able to read the file without error. Book cover is shown right!

Now i tested by unzipping my .cbz: results in an error from unzip: "Not a zip-file" - which is obviously right.

I can unrar the file without problem. I have tested with "correct" cbrs by doing an unrar, rar again without any options set, they work right and show up as expected. So i think there is no error in the rar files itself. The folder containing the jpg's dont contain special files like Appledouble, thumb or anything else. Only jpg's.

Oh, my ubooquity server runs in a freebsd jail, with -Xmx2g.

If you need further infos i can give.

PS: Im running ubooquity actually with openjdk14, same error with openjdk8.

Update: renaming cbr to cbz results in an error after restarting ubooquity. Behaviour here is right.

But still some cbrs dont show up like mentioned before.

Logs here:


20200529 16:32:28 [Scanner thread] INFO com.ubooquity.b.d - Reading metadata of comic file: /comics/Lucky Luke/Zack Album - Lucky Luke 01-14/Zack Album 03 - Lucky Luke - und der Großfürst.cbr
20200529 16:32:28 [Scanner thread] WARN com.ubooquity.f.a - Could not open file: /comics/Lucky Luke/Zack Album - Lucky Luke 01-14/Zack Album 03 - Lucky Luke - und der Großfürst.cbr
com.github.junrar.exception.RarException: notRarArchive
   at com.ubooquity.fileformat.cbr.a.a(SourceFile:39) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.f.a.b(SourceFile:73) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.f.a.a(SourceFile:22) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.b.d.a(SourceFile:71) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.data.feeder.a.b(SourceFile:531) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.data.feeder.a.b(SourceFile:468) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.data.feeder.a.b(SourceFile:112) ~[Ubooquity.jar:2.1.2]
   at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]
20200529 16:32:28 [Scanner thread] WARN com.ubooquity.f.a - Failed to read file, checking potential extension mistake (cbz/cbr) for: /comics/Lucky Luke/Zack Album - Lucky Luke 01-14/Zack Album 03 - Lucky Luke - und der Großfürst.cbr
20200529 16:32:28 [Scanner thread] INFO com.ubooquity.f.a - File type is ZIP (cbz)

real rar file: compressed by me with rar a XIII - 16 - Operation Montecristo.cbr ./XIII - 16 - Operation Montecristo/

20200529 16:32:30 [Scanner thread] INFO com.ubooquity.b.d - Reading metadata of comic file: /comics/XIII 1-24 +1/XIII - 16 - Operation Montecristo.cbr
20200529 16:32:30 [Scanner thread] WARN com.ubooquity.f.a - Could not open file: /comics/XIII 1-24 +1/XIII - 16 - Operation Montecristo.cbr
com.github.junrar.exception.RarException: notRarArchive
   at com.ubooquity.fileformat.cbr.a.a(SourceFile:39) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.f.a.b(SourceFile:73) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.f.a.a(SourceFile:22) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.b.d.a(SourceFile:71) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.data.feeder.a.b(SourceFile:531) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.data.feeder.a.b(SourceFile:468) ~[Ubooquity.jar:2.1.2]
   at com.ubooquity.data.feeder.a.b(SourceFile:112) ~[Ubooquity.jar:2.1.2]
   at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]
20200529 16:32:30 [Scanner thread] WARN com.ubooquity.f.a - Failed to read file, checking potential extension mistake (cbz/cbr) for: /comics/XIII 1-24 +1/XIII - 16 - Operation Montecristo.cbr
20200529 16:32:30 [Scanner thread] INFO com.ubooquity.f.a - File type is RAR (cbr)
20200529 16:32:30 [Scanner thread] INFO com.ubooquity.f.a - No extension mistake detected.
20200529 16:32:30 [Scanner thread] WARN com.ubooquity.f.a - Could not open file: /comics/XIII 1-24 +1/XIII - 16 - Operation Montecristo.cbr

Answered

When Ubooquity fails to open an archive (e.g. zip or rar), it checks its type using its file signature (also called "magic bytes") instead of its file extension.

Hence the lines you fins in your logs:

20200529 16:32:28 [Scanner thread] WARN com.ubooquity.f.a - Failed to
read file, checking potential extension mistake (cbz/cbr) for:
/comics/Lucky Luke/Zack Album - Lucky Luke 01-14/Zack Album 03 - Lucky
Luke - und der Großfürst.cbr
20200529 16:32:28 [Scanner thread] INFO com.ubooquity.f.a - File type is ZIP (cbz)

When a file has the wrong extension (in this case, cbr instead of cbz), Ubooquity will retry reading it using its real type.

A cbz file will always be correctly read, whatever its extension may be.

Rar files reading is less reliable: Ubooquity relies on a libreary (Junrar) that sometimes has issues with some rar files (and can't read RAR 5 files in any case). If the library fails to read a rar file there is nothing more I can do.

My advice if you are able and willing to recompress your files: drop the RAR format completely, it has almost no advantage over ZIP and a lot more issues due to its proprietary nature.

ok, thanks. I think i will do that...

Compression version 4 fails too... :(