Suwayomi / Suwayomi-Server

A rewrite of Tachiyomi for the Desktop
Mozilla Public License 2.0
3.93k stars 201 forks source link

[Bug] Migrating mangas always get a "migration failed" prompt on WebUI, but actually succeeded #1003

Closed raidenii closed 1 month ago

raidenii commented 1 month ago

Device information

Steps to reproduce

  1. In tab Browse->Migrate, choose any manga to migrate from one source to another
  2. Click migrate button in the popup

Expected behavior

WebUI should return a message with success

Actual behavior

The WebUI returns a "migration failed" message, but the manga was still actually migrated

Other details

Docker logs when migration happens:

11:23:04.462 [DefaultDispatcher-worker-34] ERROR suwayomi.tachidesk.graphql.AsDataFetcherResult -- asDataFetcherResult: failed due to
java.util.NoSuchElementException: List is empty.
        at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:214)
        at org.jetbrains.exposed.sql.statements.BatchUpdateStatement.getFirstDataSet(BatchUpdateStatement.kt:14)
        at org.jetbrains.exposed.sql.statements.UpdateStatement.prepareSQL(UpdateStatement.kt:18)
        at org.jetbrains.exposed.sql.statements.BatchUpdateStatement.prepareSQL(BatchUpdateStatement.kt:39)
        at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:47)
        at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:140)
        at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:126)
        at org.jetbrains.exposed.sql.statements.Statement.execute(Statement.kt:28)
        at suwayomi.tachidesk.graphql.mutations.ChapterMutation$updateChapters$1.invoke(ChapterMutation.kt:88)
        at suwayomi.tachidesk.graphql.mutations.ChapterMutation$updateChapters$1.invoke(ChapterMutation.kt:60)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction$run(ThreadLocalTransactionManager.kt:214)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.access$inTopLevelTransaction$run(ThreadLocalTransactionManager.kt:1)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:240)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:248)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:239)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:189)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:248)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:159)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:146)
        at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:145)
        at suwayomi.tachidesk.graphql.mutations.ChapterMutation.updateChapters(ChapterMutation.kt:60)
        at suwayomi.tachidesk.graphql.mutations.ChapterMutation.updateChapters(ChapterMutation.kt:116)
        at jdk.internal.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97)
        at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:113)
        at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:200)
        at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:112)
        at com.expediagroup.graphql.generator.execution.FunctionDataFetcher.runBlockingFunction(FunctionDataFetcher.kt:130)
        at com.expediagroup.graphql.generator.execution.FunctionDataFetcher.get(FunctionDataFetcher.kt:64)
        at graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:309)
        at graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:286)
        at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:212)
        at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55)
        at graphql.execution.Execution.executeOperation(Execution.java:161)
        at graphql.execution.Execution.execute(Execution.java:104)
        at graphql.GraphQL.execute(GraphQL.java:557)
        at graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:476)
        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture.thenCompose(Unknown Source)
        at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471)
        at graphql.GraphQL.executeAsync(GraphQL.java:439)
        at com.expediagroup.graphql.server.execution.GraphQLRequestHandler.execute(GraphQLRequestHandler.kt:99)
        at com.expediagroup.graphql.server.execution.GraphQLRequestHandler.executeRequest$suspendImpl(GraphQLRequestHandler.kt:78)
        at com.expediagroup.graphql.server.execution.GraphQLRequestHandler.executeRequest(GraphQLRequestHandler.kt)
        at com.expediagroup.graphql.server.execution.GraphQLServer$execute$2.invokeSuspend(GraphQLServer.kt:61)
        at com.expediagroup.graphql.server.execution.GraphQLServer$execute$2.invoke(GraphQLServer.kt)
        at com.expediagroup.graphql.server.execution.GraphQLServer$execute$2.invoke(GraphQLServer.kt)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
        at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264)
        at com.expediagroup.graphql.server.execution.GraphQLServer.execute$suspendImpl(GraphQLServer.kt:47)
        at com.expediagroup.graphql.server.execution.GraphQLServer.execute(GraphQLServer.kt)
        at suwayomi.tachidesk.graphql.controller.GraphQLController$execute$1.invokeSuspend(GraphQLController.kt:25)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Robonau commented 1 month ago

looks like webui doing something incorrectly or not dealing with an error properly. is probably a webui issue and not a server issue. so should be in the webui repo not the server one

raidenii commented 1 month ago

OK, I'll file it there instead. Thanks.