Krillsson / sys-API

Home server monitoring API and backend for Monitee
https://monitee.app
Apache License 2.0
107 stars 3 forks source link

DB locking issue #115

Closed Krillsson closed 1 year ago

Krillsson commented 1 year ago
ERROR  [08:03:37.630] [pool-3-thread-4] g.k.e.e.DefaultGraphQLErrorHandler -  Error executing query Exception while fetching data (/history[3]/processorMetrics) : could not extract ResultSet
org.hibernate.exception.LockAcquisitionException: could not extract ResultSet
    at org.hibernate.dialect.SQLiteSQLExceptionConversionDelegate.convert(SQLiteSQLExceptionConversionDelegate.java:44)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)
    at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.getResultSet(AbstractLoadPlanBasedLoader.java:390)
    at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:163)
    at org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:104)
    at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.load(AbstractLoadPlanBasedEntityLoader.java:285)
    at org.hibernate.persister.entity.AbstractEntityPersister.doLoad(AbstractEntityPersister.java:4550)
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:4540)
    at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:571)
    at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:539)
    at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:208)
    at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:327)
    at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:108)
    at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:74)
    at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:118)
    at org.hibernate.internal.SessionImpl.fireLoadNoChecks(SessionImpl.java:1231)
    at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1220)
    at org.hibernate.internal.SessionImpl.access$2100(SessionImpl.java:202)
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.doLoad(SessionImpl.java:2848)
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.lambda$load$1(SessionImpl.java:2825)
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.perform(SessionImpl.java:2781)
    at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2825)
    at org.hibernate.internal.SessionImpl.get(SessionImpl.java:1019)
    at io.dropwizard.hibernate.AbstractDAO.get(AbstractDAO.java:198)
    at com.krillsson.sysapi.core.history.db.CpuLoadDAO.findById(CpuLoad.kt:26)
    at com.krillsson.sysapi.core.history.HistoryRepository.getCpuLoadById(HistoryRepository.kt:97)
    at com.krillsson.sysapi.core.history.HistoryRepository$ByteBuddy$bDpLtecx.getCpuLoadById$accessor$Kva1BoHy(Unknown Source)
    at com.krillsson.sysapi.core.history.HistoryRepository$ByteBuddy$bDpLtecx$auxiliary$JOt6rDXu.call(Unknown Source)
    at io.dropwizard.hibernate.UnitOfWorkAwareProxyFactory$MethodInterceptor.invoke(UnitOfWorkAwareProxyFactory.java:167)
    at com.krillsson.sysapi.core.history.HistoryRepository$ByteBuddy$bDpLtecx.getCpuLoadById(Unknown Source)
    at com.krillsson.sysapi.graphql.QueryResolver$HistoryResolver.getProcessorMetrics(QueryResolver.kt:249)
    at jdk.internal.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at graphql.kickstart.tools.resolver.MethodFieldResolverDataFetcher.get(MethodFieldResolver.kt:280)
    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.ExecutionStrategy.completeValueForObject(ExecutionStrategy.java:680)
    at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:472)
    at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:564)
    at graphql.execution.ExecutionStrategy.completeValueForList(ExecutionStrategy.java:518)
    at graphql.execution.ExecutionStrategy.completeValue(ExecutionStrategy.java:457)
    at graphql.execution.ExecutionStrategy.completeField(ExecutionStrategy.java:422)
    at graphql.execution.ExecutionStrategy.lambda$resolveFieldWithInfo$1(ExecutionStrategy.java:214)
    at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)
    at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
    at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2094)
    at graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213)
    at graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:55)
    at graphql.execution.Execution.executeOperation(Execution.java:156)
    at graphql.execution.Execution.execute(Execution.java:102)
    at graphql.GraphQL.execute(GraphQL.java:557)
    at graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:476)
    at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
    at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
    at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:471)
    at graphql.GraphQL.executeAsync(GraphQL.java:439)
    at graphql.kickstart.execution.GraphQLInvoker.executeAsync(GraphQLInvoker.java:37)
    at graphql.kickstart.execution.GraphQLInvoker.execute(GraphQLInvoker.java:28)
    at graphql.kickstart.servlet.HttpRequestInvokerImpl.invoke(HttpRequestInvokerImpl.java:200)
    at graphql.kickstart.servlet.HttpRequestInvokerImpl.lambda$invokeAndHandleAsync$2(HttpRequestInvokerImpl.java:84)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
    at org.sqlite.core.DB.newSQLException(DB.java:1135)
    at org.sqlite.core.DB.newSQLException(DB.java:1146)
    at org.sqlite.core.DB.execute(DB.java:941)
    at org.sqlite.jdbc3.JDBC3PreparedStatement.lambda$executeQuery$1(JDBC3PreparedStatement.java:85)
    at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:429)
    at org.sqlite.jdbc3.JDBC3PreparedStatement.executeQuery(JDBC3PreparedStatement.java:80)
    at jdk.internal.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:118)
    at com.sun.proxy.$Proxy90.executeQuery(Unknown Source)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)
    ... 64 common frames omitted