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

Kavita kills itself when executing cover search/manual cover save (Synology DSM7 ds216play) #1413

Closed
mastervol opened this issue Aug 8, 2022 · 13 comments
Labels
support User is needing support on something not working but not confirmed to be a bug

Comments

@mastervol
Copy link

Please put as much information as possible to help me understand your issue. OS, browser, version are very important!

Describe the bug
When cover search is executed Kavita kills itself.
When trying to manually and a cover image, Kavita kills itself when clicking on the save button.

To Reproduce
Steps to reproduce the behavior:

  1. Synology DSM7 (DSM 7.1-42661 Update 3) on ds216play, STM Monaco STiH412 Processor
  2. Start Kavita using ./Kavita start file
    3a. Execute a library search, wait for cover search
    3b. Edit the metadata, klick on cover image in the details page of a book, add it by url, klick on save
  3. The Kavita process is killed.

Expected behavior
The Kavita process is not killed and the cover is stored in the Kavita DB.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context
As workaround it would help if I can disable cover search in the settings.

Trace Log:
When cover search is executed I get the following log:
INNER JOIN ( SELECT "c0"."ChaptersId", "c0"."TagsId", "t1"."Id", "t1"."ExternalTag", "t1"."NormalizedTitle", "t1"."Title" FROM "ChapterTag" AS "c0" INNER JOIN "Tag" AS "t1" ON "c0"."TagsId" = "t1"."Id" ) AS "t0" ON "c"."Id" = "t0"."ChaptersId" ORDER BY "t"."SortName", "t"."Id", "s0"."Id", "v"."Id", "c"."Id" 2022-08-08T19:19:15.9840402+02:00 INFO [Microsoft.EntityFrameworkCore.Database.Command] [Microsoft.EntityFrameworkCore.Database.Command.CommandExecuted] Executed DbCommand (1ms) [Parameters=[@__libraryId_0='3', @__p_2='50', @__p_1='0'], CommandType='Text', CommandTimeout='30'] SELECT "m"."Id", "m"."ChapterId", "m"."FilePath", "m"."Format", "m"."LastFileAnalysis", "m"."LastModified", "m"."Pages", "t"."Id", "s0"."Id", "v"."Id", "c"."Id" FROM ( SELECT "s"."Id", "s"."SortName" FROM "Series" AS "s" WHERE "s"."LibraryId" = @__libraryId_0 ORDER BY "s"."SortName" LIMIT @__p_2 OFFSET @__p_1 ) AS "t" LEFT JOIN "SeriesMetadata" AS "s0" ON "t"."Id" = "s0"."SeriesId" INNER JOIN "Volume" AS "v" ON "t"."Id" = "v"."SeriesId" INNER JOIN "Chapter" AS "c" ON "v"."Id" = "c"."VolumeId" INNER JOIN "MangaFile" AS "m" ON "c"."Id" = "m"."ChapterId" ORDER BY "t"."SortName", "t"."Id", "s0"."Id", "v"."Id", "c"."Id" 2022-08-08T19:19:16.0532074+02:00 DBUG [API.Services.MetadataService] [0] [MetadataService] Fetched 5 series for refresh 2022-08-08T19:19:16.0958994+02:00 DBUG [API.Services.MetadataService] [0] [MetadataService] Processing series Steve Jobs 2022-08-08T19:19:16.1060111+02:00 DBUG [API.Services.MetadataService] [0] [MetadataService] Generating cover image for /volume1/share/downloads/complete2/biography/Steve.epub

When clicking on save button I get the following log:
info: Microsoft.AspNetCore.Hosting.Diagnostics[1] Request starting HTTP/1.1 POST http://192.168.1.109:5005/api/series/metadata application/json 1135 info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0] Executing endpoint 'API.Controllers.SeriesController.UpdateSeriesMetadata (API)' info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3] Route matched with {action = "UpdateSeriesMetadata", controller = "Series"}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.ActionResult] UpdateSeriesMetadata(API.DTOs.UpdateSeriesMetadataDto) on controller API.Controllers.SeriesController (API). info: Microsoft.EntityFrameworkCore.Infrastructure[10403] Entity Framework Core 6.0.6 initialized 'DataContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite:6.0.6' with options: DetailedErrorsEnabled info: Microsoft.AspNetCore.Hosting.Diagnostics[1] Request starting HTTP/1.1 POST http://192.168.1.109:5005/api/upload/series application/json 294763 info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0] Executing endpoint 'API.Controllers.UploadController.UploadSeriesCoverImageFromUrl (API)' info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3] Route matched with {action = "UploadSeriesCoverImageFromUrl", controller = "Upload"}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.ActionResult] UploadSeriesCoverImageFromUrl(API.DTOs.Uploads.UploadFileDto) on controller API.Controllers.UploadController (API). info: Microsoft.EntityFrameworkCore.Infrastructure[10403] Entity Framework Core 6.0.6 initialized 'DataContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite:6.0.6' with options: DetailedErrorsEnabled info: Microsoft.EntityFrameworkCore.Database.Command[20101] Executed DbCommand (44ms) [Parameters=[@__seriesId_0='?' (DbType = Int32)], CommandType='Text', CommandTimeout='30'] SELECT "s"."Id", "s"."AvgHoursToRead", "s"."CoverImage", "s"."CoverImageLocked", "s"."Created", "s"."Format", "s"."LastChapterAdded", "s"."LastModified", "s"."LibraryId", "s"."LocalizedName", "s"."LocalizedNameLocked", "s"."MaxHoursToRead", "s"."MinHoursToRead", "s"."Name", "s"."NameLocked", "s"."NormalizedName", "s"."OriginalName", "s"."Pages", "s"."SortName", "s"."SortNameLocked", "s"."WordCount", "s0"."Id", "s0"."AgeRating", "s0"."AgeRatingLocked", "s0"."CharacterLocked", "s0"."ColoristLocked", "s0"."CoverArtistLocked", "s0"."EditorLocked", "s0"."GenresLocked", "s0"."InkerLocked", "s0"."Language", "s0"."LanguageLocked", "s0"."LettererLocked", "s0"."MaxCount", "s0"."PencillerLocked", "s0"."PublicationStatus", "s0"."PublicationStatusLocked", "s0"."PublisherLocked", "s0"."ReleaseYear", "s0"."RowVersion", "s0"."SeriesId", "s0"."Summary", "s0"."SummaryLocked", "s0"."TagsLocked", "s0"."TotalCount", "s0"."TranslatorLocked", "s0"."WriterLocked" FROM "Series" AS "s" LEFT JOIN "SeriesMetadata" AS "s0" ON "s"."Id" = "s0"."SeriesId" WHERE "s"."Id" = @__seriesId_0 ORDER BY "s"."Id", "s0"."Id" LIMIT 2 ^C [1]- Illegal instruction (core dumped) ./Kavita

@mastervol mastervol added the needs-triage Needs to be triaged by a developer and assigned a release label Aug 8, 2022
@majora2007
Copy link
Member

Per the logs, we can see Illegal instruction (core dumped) ./Kavita which implies an instruction was not present, when we thought it should be. Kavita only supports CPUs that support AVX flags (https://wiki.kavitareader.com/en/faq)

Most Synology users use the docker, hence this isn't a problem. I'm not sure if that is explicitly the issue or an issue with a downstream library, however, I will say, the illegal instruction core dumps I've seen are usually related to this.

@majora2007 majora2007 added support User is needing support on something not working but not confirmed to be a bug and removed needs-triage Needs to be triaged by a developer and assigned a release labels Aug 9, 2022
@mastervol
Copy link
Author

mastervol commented Aug 9, 2022

The CPU is STM Monaco ARM. Here is a description of the CPU: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/data_brief/DM00094054.pdf.
From what I can tell it is from the year 2013.

Not sure if it helps but "illegal instruction" is printed because I hit Strg+C on the command window.
This is not reported in the log of Kavita.

@majora2007
Copy link
Member

That does help a lot, because I was under assumption you pulled from the log. This def looks to be something outside of my control though as it's not reproducible on my end.

You might be able to check with something like HWInfo if your CPU supports AVX or not.
https://quoramarketing.com/how-to-know-or-check-if-cpu-supports-avx-instructions/

@mastervol
Copy link
Author

mastervol commented Aug 10, 2022

I would say my cpu does not support AVX.

`root@play:~# cat /proc/cpuinfo �
processor : 0
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 2996.63
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

processor : 1
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 2989.26
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

Hardware : STi SoC with Flattened Device Tree
Revision : 0000
Serial : 0000000000000000
root@play:~#`

@majora2007
Copy link
Member

Yes then unfortunately, Kavita cannot be used. As mentioned in #1423, this is a low priority issue that a few users (less than 10) have reported. Some requirement of a library we use, just not sure which. I'm open to any investigation though since you have a machine that doesn't have AVX, so you would likely be able to reproduce the issue (I assume it's NetVips).

@mastervol
Copy link
Author

May I ask for a functionality or setting in the options to suppress the automatic cover search?
Everytime books are added to the library, a cover search is executed as well.
It would help if I can disable that.

Everything else seems to be working.

@majora2007
Copy link
Member

No, that's what the feats site is for, but I can tell you automatically that I have no plans to disable cover generation after an item is added. It just doesn't make sense to expose an option like that except for this case which as I mentioned, less than 10 people face.

Going to close this. If I ever get time to try and track the AVX issue, I will message you on this thread.

@kleisauke
Copy link

Features : swp half thumb fastmult vfp edsp neon vfpv3 tls

The prebuilt Linux ARMv7 binaries provided by NetVips requires the Neon instruction set and VFPv4 floating-point extensions. This CPU only supports VFPv3.

Given that the Synology DS216play was released in 2015 (7 years ago, so it's not that old), we might be able to lower the VFP requirement to v3. For now, I can recommend installing libvips via the package manager (if possible) or to compile it yourself.

@mastervol
Copy link
Author

Ok thanks for the input.

I checked https://archlinuxarm.org/packages/armv7h/libvips and https://archlinuxarm.org/packages/armv7h/libvips.
When adding the file libvips.so.42 to the Kavita folder the application at least does not crash.

I also tried the second package from above which adds quite a lot of files to the /usr and following folders but realize that this is not the same.

My next stop is probably to try to compile this on my own since I still get an error when trying to manually add a cover due to the wrong libs and packages.

@majora2007
Copy link
Member

@mastervol Seems another issue was able to solve the issue, might want to take a look here and see if there is something you can do:
#1423 (comment)

@mastervol
Copy link
Author

mastervol commented Aug 14, 2022

I added opkg as package manager. Unfortunately there are only the following packages https://pkg.entware.net/binaries/armv7/.
I tried downloading netvips modules for arm7 manually which are missing other dependencies, which I tried then to download, one by one.

Currently I cannot find anything for libimagequant for arm7.
/volume1/@appstore/Kavita/config/logs# vips vips: error while loading shared libraries: libimagequant.so.0: cannot open shared object file: No such file or directory

It seems I also cannot get the required compilation setup (ninja/meson) for Synology to do it myself.

If there are no other options to try I will stop here, at least it works somehow now with the exception of covers.

Thanks

@majora2007
Copy link
Member

Hi, If you look at the other issue I linked, they were able to achieve a solution. I think it boils down to:

- rm libvips.so.42
- apt-get install libvips --no-install-recommends -y

@mastervol
Copy link
Author

mastervol commented Aug 14, 2022

I checked this already.
Unfortunately there is no apt or similar packet manager for synology. Until someone from the syno community deploys a package for libvips.
https://synocommunity.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support User is needing support on something not working but not confirmed to be a bug
Projects
None yet
Development

No branches or pull requests

3 participants