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

[Docker Failed] Failed to set optimized SQLite PRAGMA arguments. The database file is locked. Docker 镜像启动失败 #853

Closed
CalunVier opened this issue Dec 29, 2024 · 1 comment

Comments

@CalunVier
Copy link

CalunVier commented Dec 29, 2024

启动不起来,不知道为什么。

系统环境

  • Red Hat Enterprise Linux 9.5 (Plow)
  • podman version 5.2.2
  • SELinux 启用

启动命令:

podman run -d --name PeerBanHelper --stop-timeout 30 -p 29898:9898 -v ${PWD}/:/app/data/:Z -e PUID=0 -e PGID=0 -e TZ=UTC+8 ghostchu/peerbanhelper

日志节选:

[11:34:21] [main/INFO]: Loading configuration...

[11:34:21] [main/INFO]: PeerBanHelper data directory: /app/data

[11:34:21] [main/INFO]: Checking configuration...

[11:34:21] [main/INFO]: Saving configuration changes...

[11:34:21] [main/INFO]: Checking configuration...

[11:34:21] [main/INFO]: Saving configuration changes...

[11:34:21] [main/INFO]: Current system language tag: en-US

[11:34:21] [main/INFO]: Loading up translations, this may take a while...

[11:34:21] [main/INFO]: Spring Context initializing context to start PeerBanHelper up, it may take a while on low-end devices

[11:34:22] [main/WARN]: PeerBanHelper SQLite Connection Pool - keepaliveTime is greater than or equal to maxLifetime, disabling it.

[11:34:22] [main/INFO]: PeerBanHelper SQLite Connection Pool - Starting...

[11:34:22] [main/INFO]: PeerBanHelper SQLite Connection Pool - Added connection org.sqlite.jdbc4.JDBC4Connection@7418d76e

[11:34:22] [main/INFO]: PeerBanHelper SQLite Connection Pool - Start completed.

[11:34:25] [main/WARN]: Failed to set optimized SQLite PRAGMA arguments

org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)

        at org.sqlite.core.DB.newSQLException(DB.java:1179)

        at org.sqlite.core.DB.newSQLException(DB.java:1190)

        at org.sqlite.core.DB.throwex(DB.java:1150)

        at org.sqlite.core.NativeDB._exec_utf8(Native Method)

        at org.sqlite.core.NativeDB._exec(NativeDB.java:99)

        at org.sqlite.jdbc3.JDBC3Statement.lambda$executeLargeUpdate$2(JDBC3Statement.java:139)

        at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:458)

        at org.sqlite.jdbc3.JDBC3Statement.executeLargeUpdate(JDBC3Statement.java:126)

        at org.sqlite.jdbc3.JDBC3Statement.executeUpdate(JDBC3Statement.java:113)

        at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120)

        at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)

        at com.ghostchu.peerbanhelper.database.Database.setupDatabase(Database.java:55)

        at com.ghostchu.peerbanhelper.database.Database.<init>(Database.java:35)

        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source)

        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)

        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)

        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:196)

        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(Abst
wireCapableBeanFactory.java:1327)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1218)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1626)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1371)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1208)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1626)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1371)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1208)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1568)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:785)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:768)

        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:146)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:509)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1435)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.instantiateSingleton(DefaultListableBeanFactory.java:1122)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton(DefaultListableBeanFactory.java:1093)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1030)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:987)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)

        at com.ghostchu.peerbanhelper.Main.main(Main.java:118)

        at com.ghostchu.peerbanhelper.MainJumpLoader.main(MainJumpLoader.java:17)

[11:34:28] [main/WARN]: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'peerBanHelperServer': Unsatisfied dependency expressed through field 'metrics': Error creating bean with name 'persistMetrics' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/metric/impl/persist/PersistMetrics.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean 
e 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

[11:34:28] [main/ERROR]: PeerBanHelper encountered fatal error during startup, unable to continue

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'peerBanHelperServer': Unsatisfied dependency expressed through field 'metrics': Error creating bean with name 'persistMetrics' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/metric/impl/persist/PersistMetrics.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:788)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:768)

        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:146)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:509)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1435)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.instantiateSingleton(DefaultListableBeanFactory.java:1122)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton(DefaultListableBeanFactory.java:1093)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1030)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:987)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)

        at com.ghostchu.peerbanhelper.Main.main(Main.java:118)

        at com.ghostchu.peerbanhelper.MainJumpLoader.main(MainJumpLoader.java:17)

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'persistMetrics' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/metric/impl/persist/PersistMetrics.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804)

        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1371)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1208)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1568)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:785)

        ... 17 common frames omitted

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804)

        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1371)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1208)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.
ependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1626)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

        ... 29 common frames omitted

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1333)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1218)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1626)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

        ... 43 common frames omitted

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:222)

        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1327)

        ... 55 common frames omitted

Caused by: java.sql.SQLException: SQL statement failed: CREATE TABLE IF NOT EXISTS `metadata` (`key` VARCHAR , `value` VARCHAR , PRIMARY KEY (`key`) ) 

        at com.j256.ormlite.table.TableUtils.doStatements(TableUtils.java:395)

        at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:371)

        at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:356)

        at com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:74)

        at com.ghostchu.peerbanhelper.database.DatabaseHelper.createTables(DatabaseHelper.java:30)

        at com.ghostchu.peerbanhelper.database.DatabaseHelper.<init>(DatabaseHelper.java:24)

        at com.ghostchu.peerbanhelper.database.Database.setupDatabase(Database.java:61)

        at com.ghostchu.peerbanhelper.database.Database.<init>(Database.java:35)

        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source)

        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)

        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)

        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:196)

        ... 57 common frames omitted

Caused by: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)

        at org.sqlite.core.DB.newSQLException(DB.java:1179)

        at org.sqlite.core.DB.newSQLException(DB.java:1190)

        at org.sqlite.core.DB.execute(DB.java:985)

        at org.sqlite.jdbc3.JDBC3PreparedStatement.lambda$execute$0(JDBC3PreparedStatement.java:59)

        at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:458)

        at org.sqlite.jdbc3.JDBC3PreparedStatement.execute(JDBC3PreparedStatement.java:53)

        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)

        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)

        at com.j256.ormlite.jdbc.JdbcCompiledStatement.runExecute(JdbcCompiledStatement.java:73)

        at com.j256.ormlite.table.TableUtils.doStatements(TableUtils.java:389)

        ... 68 common frames omitted

Exception in thread "main" java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'peerBanHelperServer': Unsatisfied dependency expressed through field 'metrics': Error creating bean with name 'persistMetrics' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/metric/impl/persist/PersistMetrics.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at com.ghostchu.peerbanhelper.Main.main(Main.java:127)

        at com.ghostchu.peerbanhelper.MainJumpLoader.main(MainJumpLoader.java:17)

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'peerBanHelperServer': Unsatisfied dependency expressed through field 'metrics': Error creating bean with name 'persistMetrics' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/metric/impl/persist/PersistMetrics.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:788)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:768)

        at org.springframework.beans.factory
ion.InjectionMetadata.inject(InjectionMetadata.java:146)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:509)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1435)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.instantiateSingleton(DefaultListableBeanFactory.java:1122)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton(DefaultListableBeanFactory.java:1093)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:1030)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:987)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)

        at com.ghostchu.peerbanhelper.Main.main(Main.java:118)

        ... 1 more

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'persistMetrics' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/metric/impl/persist/PersistMetrics.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804)

        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1371)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1208)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1568)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:785)

        ... 17 more

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'historyDao' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/dao/impl/HistoryDao.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804)

        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1371)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1208)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1626)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

        ... 29 more

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'database' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/Database.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1333)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1218)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:563)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Ab
towireCapableBeanFactory.java:523)

        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:288)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)

        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1626)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1514)

        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:913)

        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)

        ... 43 more

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.ghostchu.peerbanhelper.database.Database]: Constructor threw exception

        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:222)

        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1327)

        ... 55 more

Caused by: java.sql.SQLException: SQL statement failed: CREATE TABLE IF NOT EXISTS `metadata` (`key` VARCHAR , `value` VARCHAR , PRIMARY KEY (`key`) ) 

        at com.j256.ormlite.table.TableUtils.doStatements(TableUtils.java:395)

        at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:371)

        at com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:356)

        at com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:74)

        at com.ghostchu.peerbanhelper.database.DatabaseHelper.createTables(DatabaseHelper.java:30)

        at com.ghostchu.peerbanhelper.database.DatabaseHelper.<init>(DatabaseHelper.java:24)

        at com.ghostchu.peerbanhelper.database.Database.setupDatabase(Database.java:61)

        at com.ghostchu.peerbanhelper.database.Database.<init>(Database.java:35)

        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source)

        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)

        at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)

        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:196)

        ... 57 more

Caused by: org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)

        at org.sqlite.core.DB.newSQLException(DB.java:1179)

        at org.sqlite.core.DB.newSQLException(DB.java:1190)

        at org.sqlite.core.DB.execute(DB.java:985)

        at org.sqlite.jdbc3.JDBC3PreparedStatement.lambda$execute$0(JDBC3PreparedStatement.java:59)

        at org.sqlite.jdbc3.JDBC3Statement.withConnectionTimeout(JDBC3Statement.java:458)

        at org.sqlite.jdbc3.JDBC3PreparedStatement.execute(JDBC3PreparedStatement.java:53)

        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)

        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)

        at com.j256.ormlite.jdbc.JdbcCompiledStatement.runExecute(JdbcCompiledStatement.java:73)

        at com.j256.ormlite.table.TableUtils.doStatements(TableUtils.java:389)

        ... 68 more
@Ghost-chu
Copy link
Collaborator

重复:#725

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants