gotson / komga

Media server for comics/mangas/BDs/magazines/eBooks with API, OPDS and Kobo Sync support
https://komga.org
MIT License
4.1k stars 243 forks source link

Working around a java.nio.file.NoSuchFileException issue? #1432

Closed timbroder closed 5 months ago

timbroder commented 8 months ago

Steps to reproduce

Here is what I think happened:

  1. I added Yu You Hakusho to download in Kaizoku
  2. The folder for this was created as Yu★Yu★Hakusho
  3. Content was downloaded; issues, covers, etc
  4. komga expects the cover to be at /data/Yu★Yu★Hakusho/cover.png
  5. When I look at the filesystem, the path is now /data/Yu_Yu_Hakusho/cover.png. I'm not sure which tool did this rename; I'm assuming it was either Komga or Kaizoku
  6. But now, the Komga web interface isn't loading, even after a restart

Expected behavior

The web interface should load with an error on the series, allowing me to delete the series, re-add it, or fix it's path.

Actual behavior

The web interface is not loading. Is there a way I can get it to load? What is the best way for me to remove the "bad" series? Go directly into the database?

Logs

 ____  __.
|    |/ _|____   _____    _________
|      < /  _ \ /     \  / ___\__  \
|    |  (  <_> )  Y Y  \/ /_/  > __ \_
|____|__ \____/|__|_|  /\___  (____  /
        \/           \//_____/     \/

Version: 1.10.3

2024-02-19T07:10:21.001-05:00  INFO 1 --- [           main] org.gotson.komga.ApplicationKt           : Starting ApplicationKt v1.10.3 using Java 21.0.1 with PID 1 (/app/BOOT-INF/classes started by ? in /app)
2024-02-19T07:10:21.009-05:00  INFO 1 --- [           main] org.gotson.komga.ApplicationKt           : No active profile set, falling back to 1 default profile: "default"
2024-02-19T07:10:25.006-05:00  INFO 1 --- [           main] c.github.gotson.nightcompress.Archive    : Loaded libarchive 3.6.0 zlib/1.2.11 liblzma/5.2.5 bz2lib/1.0.8 liblz4/1.9.3 libzstd/1.4.8
2024-02-19T07:10:25.011-05:00  INFO 1 --- [           main] o.g.k.i.m.divina.Rar5Extractor           : Rar5 extractor is enabled
2024-02-19T07:10:25.021-05:00  WARN 1 --- [           main] o.s.c.a.ConfigurationClassPostProcessor  : Cannot enhance @Configuration bean definition 'rar5Configuration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static' and/or marking the containing configuration class as 'proxyBeanMethods=false'.
2024-02-19T07:10:26.335-05:00  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : SqliteUdfPool - Starting...
2024-02-19T07:10:26.694-05:00  INFO 1 --- [           main] com.zaxxer.hikari.pool.HikariPool        : SqliteUdfPool - Added connection org.sqlite.jdbc4.JDBC4Connection@45f241df
2024-02-19T07:10:26.696-05:00  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : SqliteUdfPool - Start completed.
2024-02-19T07:10:26.844-05:00  INFO 1 --- [           main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 9.22.3 by Redgate
2024-02-19T07:10:26.845-05:00  INFO 1 --- [           main] o.f.c.internal.license.VersionPrinter    : See release notes here: https://rd.gt/416ObMi
2024-02-19T07:10:26.845-05:00  INFO 1 --- [           main] o.f.c.internal.license.VersionPrinter    :
2024-02-19T07:10:26.875-05:00  INFO 1 --- [           main] org.flywaydb.core.FlywayExecutor         : Database: jdbc:sqlite:/config/database.sqlite (SQLite 3.45)
2024-02-19T07:10:27.009-05:00  INFO 1 --- [           main] o.f.core.internal.command.DbValidate     : Successfully validated 78 migrations (execution time 00:00.092s)
2024-02-19T07:10:27.018-05:00  INFO 1 --- [           main] o.f.core.internal.command.DbMigrate      : Current version of schema "main": 20231214163213
2024-02-19T07:10:27.022-05:00  INFO 1 --- [           main] o.f.core.internal.command.DbMigrate      : Schema "main" is up to date. No migration necessary.
2024-02-19T07:10:28.599-05:00  INFO 1 --- [           main] o.j.i.D.logVersionSupport                : Version                  : Database version is supported by dialect SQLITE: 3.45.0
2024-02-19T07:10:29.022-05:00  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 25600 (http)
2024-02-19T07:10:29.041-05:00  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-02-19T07:10:29.041-05:00  INFO 1 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.18]
2024-02-19T07:10:29.108-05:00  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-02-19T07:10:29.109-05:00  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 7927 ms
2024-02-19T07:10:30.115-05:00  INFO 1 --- [           main] c.g.g.n.j.i.plugins.JxlImageReaderSpi    : Loaded libjxl v0.8.2
2024-02-19T07:10:30.136-05:00  INFO 1 --- [           main] c.g.g.n.h.i.plugins.HeifImageReaderSpi   : Loaded libheif v1.17.6
2024-02-19T07:10:30.170-05:00  INFO 1 --- [           main] c.g.g.n.w.i.plugins.WebpImageReaderSpi   : Loaded libwebp: decoder v1.2.2, demux v1.2.2
2024-02-19T07:10:30.189-05:00  INFO 1 --- [           main] o.g.k.i.image.ImageConverter             : Supported read formats: [JPG, JPEG 2000, tiff, bigtiff, bmp, PCX, gif, WBMP, PNG, RAW, JPEG, AVIF, PNM, BigTIFF, tif, TIFF, jpeg, wbmp, jbig2, jxl, jpeg-lossless, jpg, JPEG2000, BMP, pcx, GIF, Jpeg XL, png, BIGTIFF, raw, JPEG-LOSSLESS, webp, JBIG2, pnm, TIF, jpeg2000, WebP, HEIC, jpeg 2000, HEIF]
2024-02-19T07:10:30.191-05:00  INFO 1 --- [           main] o.g.k.i.image.ImageConverter             : Supported read mediaTypes: [image/vnd.wap.wbmp, image/jpeg, image/x-portable-graymap, image/bmp, image/gif, image/x-windows-pcx, image/x-pc-paintbrush, image/x-raw, image/webp, image/heif-sequence, image/x-pcx, image/heic-sequence, image/avif, image/x-portable-bitmap, image/heif, image/heic, image/x-jb2, image/png, image/pcx, image/x-windows-bmp, image/jpeg2000, image/x-bmp, image/jp2, image/x-png, image/x-portable-pixmap, image/x-jbig2, image/tiff, image/x-tiff, image/x-portable-anymap, image/jxl]
2024-02-19T07:10:30.192-05:00  INFO 1 --- [           main] o.g.k.i.image.ImageConverter             : Supported write formats: [JPG, JPEG 2000, tiff, bmp, PCX, bigtiff, gif, WBMP, PNG, RAW, JPEG, PNM, BigTIFF, tif, TIFF, jpeg, wbmp, jpg, JPEG2000, BMP, pcx, GIF, png, raw, BIGTIFF, pnm, TIF, jpeg2000, jpeg 2000]
2024-02-19T07:10:30.193-05:00  INFO 1 --- [           main] o.g.k.i.image.ImageConverter             : Supported write mediaTypes: [image/vnd.wap.wbmp, image/png, image/jpeg, image/x-portable-graymap, image/bmp, image/pcx, image/x-windows-bmp, image/gif, image/x-windows-pcx, image/x-pc-paintbrush, image/jpeg2000, image/x-raw, image/x-bmp, image/x-pcx, image/jp2, image/x-png, image/x-portable-bitmap, image/x-portable-pixmap, image/tiff, image/x-tiff, image/x-portable-anymap]
2024-02-19T07:10:30.502-05:00  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : SqliteTaskPool - Starting...
2024-02-19T07:10:30.503-05:00  INFO 1 --- [           main] com.zaxxer.hikari.pool.HikariPool        : SqliteTaskPool - Added connection org.sqlite.jdbc4.JDBC4Connection@5f6ba085
2024-02-19T07:10:30.504-05:00  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : SqliteTaskPool - Start completed.
2024-02-19T07:10:30.590-05:00  INFO 1 --- [           main] org.flywaydb.core.FlywayExecutor         : Database: jdbc:sqlite:/config/tasks.sqlite (SQLite 3.45)
2024-02-19T07:10:30.594-05:00  INFO 1 --- [           main] o.f.core.internal.command.DbValidate     : Successfully validated 1 migration (execution time 00:00.002s)
2024-02-19T07:10:30.595-05:00  INFO 1 --- [           main] o.f.core.internal.command.DbMigrate      : Current version of schema "main": 20231013114850
2024-02-19T07:10:30.596-05:00  INFO 1 --- [           main] o.f.core.internal.command.DbMigrate      : Schema "main" is up to date. No migration necessary.
2024-02-19T07:10:31.082-05:00  INFO 1 --- [           main] o.a.l.s.MemorySegmentIndexInputProvider  : Using MemorySegmentIndexInput with Java 21; to disable start with -Dorg.apache.lucene.store.MMapDirectory.enableMemorySegments=false
2024-02-19T07:10:32.909-05:00  INFO 1 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page: class path resource [public/index.html]
2024-02-19T07:10:33.771-05:00  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 18 endpoint(s) beneath base path '/actuator'
2024-02-19T07:10:33.926-05:00  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure Or [Mvc [pattern='/api/**'], Mvc [pattern='/opds/**'], Mvc [pattern='/sse/**'], Mvc [pattern='/oauth2/authorization/**'], Mvc [pattern='/login/oauth2/code/**'], EndpointRequestMatcher includes=[*], excludes=[], includeLinks=true] with [org.springframework.security.web.session.DisableEncodeUrlFilter@364c4ba9, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@2008dfa7, org.springframework.security.web.context.SecurityContextHolderFilter@56957f08, org.springframework.security.web.header.HeaderWriterFilter@3c3d2a80, org.springframework.web.filter.CorsFilter@492d0748, org.springframework.security.web.authentication.logout.LogoutFilter@26c75b91, org.springframework.security.web.session.ConcurrentSessionFilter@2771e501, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@32b19d03, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2140582, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@7ebc2975, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@3aafa1c1, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@6a4ba6f4, org.springframework.security.web.session.SessionManagementFilter@54d8236c, org.springframework.security.web.access.ExceptionTranslationFilter@18482805, org.springframework.security.web.access.intercept.AuthorizationFilter@30b35687]
2024-02-19T07:10:35.148-05:00  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 25600 (http) with context path ''
2024-02-19T07:10:35.172-05:00  INFO 1 --- [           main] org.gotson.komga.ApplicationKt           : Started ApplicationKt in 15.095 seconds (process running for 15.969)
2024-02-19T07:10:35.241-05:00  INFO 1 --- [         task-6] g.k.i.s.ThumbnailMetadataFixerController : Find and fix thumbnails without metadata
2024-02-19T07:10:35.357-05:00  INFO 1 --- [         task-6] o.g.komga.application.tasks.TaskEmitter  : Sending task: FixThumbnailsWithoutMetadata(priority='0')
2024-02-19T07:10:35.428-05:00  INFO 1 --- [   scheduling-1] .AuthenticationActivityCleanupController : Remove authentication activity older than 2024-01-19T12:10:35.410925016 (UTC)
2024-02-19T07:10:35.648-05:00  INFO 1 --- [         task-1] o.g.k.i.scheduler.SearchIndexController  : Lucene index version: 8
2024-02-19T07:10:36.022-05:00  INFO 1 --- [taskProcessor-1] o.g.komga.application.tasks.TaskHandler  : Executing task: FixThumbnailsWithoutMetadata(priority='0')
2024-02-19T07:10:38.423-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fetched 0 ThumbnailBook to fix, total: 0
2024-02-19T07:10:38.433-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fixed 0 ThumbnailBook in 2.401250274s
2024-02-19T07:10:38.448-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fetched 1 ThumbnailSeries to fix, total: 1
2024-02-19T07:10:38.463-05:00 ERROR 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Could not fix thumbnail: ThumbnailSeries(thumbnail=null, url=file:/data/Yu%E2%98%85Yu%E2%98%85Hakusho/cover.png, selected=true, type=SIDECAR, mediaType=, fileSize=0, dimension=Dimension(width=0, height=0), id=0B66AHHWMYHT2, seriesId=0B6689MC0YM11, createdDate=2023-01-17T21:09:50, lastModifiedDate=2023-01-17T21:09:50)

java.nio.file.NoSuchFileException: /data/Yu★Yu★Hakusho/cover.png
    at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source) ~[na:na]
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[na:na]
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[na:na]
    at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(Unknown Source) ~[na:na]
    at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(Unknown Source) ~[na:na]
    at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(Unknown Source) ~[na:na]
    at java.base/java.nio.file.Files.readAttributes(Unknown Source) ~[na:na]
    at java.base/java.nio.file.Files.size(Unknown Source) ~[na:na]
    at org.apache.tika.io.TikaInputStream.get(TikaInputStream.java:360) ~[tika-core-2.9.1.jar:2.9.1]
    at org.apache.tika.io.TikaInputStream.get(TikaInputStream.java:338) ~[tika-core-2.9.1.jar:2.9.1]
    at org.gotson.komga.infrastructure.mediacontainer.ContentDetector.detectMediaType(ContentDetector.kt:24) ~[classes/:1.10.3]
    at org.gotson.komga.domain.service.ThumbnailLifecycle.getMetadata(ThumbnailLifecycle.kt:160) ~[classes/:1.10.3]
    at org.gotson.komga.domain.service.ThumbnailLifecycle.access$getMetadata(ThumbnailLifecycle.kt:28) ~[classes/:1.10.3]
    at org.gotson.komga.domain.service.ThumbnailLifecycle$fixThumbnailMetadataSeries$2.invoke(ThumbnailLifecycle.kt:74) ~[classes/:1.10.3]
    at org.gotson.komga.domain.service.ThumbnailLifecycle$fixThumbnailMetadataSeries$2.invoke(ThumbnailLifecycle.kt:68) ~[classes/:1.10.3]
    at org.gotson.komga.domain.service.ThumbnailLifecycle.fixThumbnailMetadata(ThumbnailLifecycle.kt:133) ~[classes/:1.10.3]
    at org.gotson.komga.domain.service.ThumbnailLifecycle.fixThumbnailMetadataSeries(ThumbnailLifecycle.kt:68) ~[classes/:1.10.3]
    at org.gotson.komga.domain.service.ThumbnailLifecycle.fixThumbnailsMetadata(ThumbnailLifecycle.kt:44) ~[classes/:1.10.3]
    at org.gotson.komga.application.tasks.TaskHandler.handleTask(TaskHandler.kt:178) ~[classes/:1.10.3]
    at org.gotson.komga.application.tasks.TaskProcessor.takeAndProcess(TaskProcessor.kt:63) ~[classes/:1.10.3]
    at org.gotson.komga.application.tasks.TaskProcessor.processAvailableTask$lambda$1(TaskProcessor.kt:47) ~[classes/:1.10.3]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
    at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

2024-02-19T07:10:38.470-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fixed 0 ThumbnailSeries in 34.928296ms
2024-02-19T07:10:38.477-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fetched 0 ThumbnailSeriesCollection to fix, total: 0
2024-02-19T07:10:38.477-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fixed 0 ThumbnailSeriesCollection in 5.716424ms
2024-02-19T07:10:38.483-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fetched 0 ThumbnailReadList to fix, total: 0
2024-02-19T07:10:38.484-05:00  INFO 1 --- [taskProcessor-1] o.g.k.domain.service.ThumbnailLifecycle  : Fixed 0 ThumbnailReadList in 5.327949ms
2024-02-19T07:10:38.485-05:00  INFO 1 --- [taskProcessor-1] o.g.komga.application.tasks.TaskHandler  : Task FixThumbnailsWithoutMetadata(priority='0') executed in 2.460549561s

Komga version

gotson/komga:latest (I can't load the web interface. If there is a more precise value I can show, please let me know)

Operating system

Ubuntu 22.04 LTS (GNU/Linux 5.15.0-92-generic x86_64)

Installation method

Docker

Other details

No response

Acknowledgements

gotson commented 8 months ago

Just rescan your library

gotson commented 8 months ago

But now, the Komga web interface isn't loading, even after a restart

your problem might be somewhere else, logs seem fine:

2024-02-19T07:10:35.148-05:00  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 25600 (http) with context path ''