You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "libra146 (via GitHub)" <gi...@apache.org> on 2024/12/15 14:47:18 UTC
[I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
libra146 opened a new issue, #34068:
URL: https://github.com/apache/shardingsphere/issues/34068
## Question
**For English only**, other languages will not accept.
Before asking a question, make sure you have:
- Googled your question.
- Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will **close it**.
When I introduced the dependency and started the project, it worked fine, but when I stopped the project, there was a table not found error, is my configuration correct?
I searched all the questions but I didn't find the answer
The following is the code that will report an error. Please start it normally and stop it. The problem will occur. I don't know what happened.
Please note that the correct database connection is not configured in the project, but I found that this does not affect the occurrence of this problem.
Why didn't I configure the database connection? Because I configured it normally in another project and configured data encryption. The data encryption scheme works fine. But it still reports that the error table cannot be found when stopping the project. I created the following demo project and found that the same problem would occur, so I reported this problem. Who can help me?
[demo.zip](https://github.com/user-attachments/files/18140796/demo.zip)
```bash
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.18)
2024-12-15 22:37:36.546 INFO 83222 --- [ main] com.java.encrypt.demo.DemoApplication : Starting DemoApplication using Java 1.8.0_382 on LLLibra.local with PID 83222 (/Users/b/Downloads/work/code/demo/target/classes started by b in /Users/b/Downloads/work/code/demo)
2024-12-15 22:37:36.547 INFO 83222 --- [ main] com.java.encrypt.demo.DemoApplication : The following 1 profile is active: "uat"
2024-12-15 22:37:37.038 WARN 83222 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.java.encrypt.demo]' package. Please check your configuration.
2024-12-15 22:37:37.226 INFO 83222 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 65004 (http)
2024-12-15 22:37:37.231 INFO 83222 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2024-12-15 22:37:37.231 INFO 83222 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83]
2024-12-15 22:37:37.290 INFO 83222 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2024-12-15 22:37:37.291 INFO 83222 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 608 ms
2024-12-15 22:37:37.423 INFO 83222 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2024-12-15 22:37:37.531 INFO 83222 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
_ _ |_ _ _|_. ___ _ | _
| | |\/|_)(_| | |_\ |_)||_|_\
/ |
3.5.3.1
2024-12-15 22:37:38.696 INFO 83222 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 65004 (http) with context path ''
2024-12-15 22:37:38.702 INFO 83222 --- [ main] com.java.encrypt.demo.DemoApplication : Started DemoApplication in 2.389 seconds (JVM running for 2.815)
2024-12-15 22:37:44.923 ERROR 83222 --- [ionShutdownHook] o.a.s.m.r.s.jdbc.JDBCRepository : Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed
org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "repository" not found (this database is empty); SQL statement:
DELETE FROM `repository` WHERE `key` LIKE ? [42104-214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8385) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8369) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readTableOrView(Parser.java:8358) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readTableOrView(Parser.java:8328) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readSimpleTableFilter(Parser.java:1160) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parseDelete(Parser.java:1174) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parsePrepared(Parser.java:774) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214]
at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214]
at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214]
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na]
at org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository.delete(JDBCRepository.java:192) ~[shardingsphere-standalone-mode-repository-jdbc-5.5.1.jar:5.5.1]
at org.apache.shardingsphere.mode.persist.service.ComputeNodePersistService.offline(ComputeNodePersistService.java:191) [shardingsphere-mode-core-5.5.1.jar:5.5.1]
at org.apache.shardingsphere.mode.manager.ContextManager.close(ContextManager.java:212) [shardingsphere-mode-core-5.5.1.jar:5.5.1]
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.close(ShardingSphereDataSource.java:107) [shardingsphere-jdbc-5.5.1.jar:5.5.1]
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:242) [spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587) [spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559) [spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163) [spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520) [spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156) [spring-beans-5.3.31.jar:5.3.31]
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1120) [spring-context-5.3.31.jar:5.3.31]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1086) [spring-context-5.3.31.jar:5.3.31]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174) [spring-boot-2.7.18.jar:2.7.18]
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1032) [spring-context-5.3.31.jar:5.3.31]
at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145) [spring-boot-2.7.18.jar:2.7.18]
at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_382]
at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114) [spring-boot-2.7.18.jar:2.7.18]
at java.lang.Thread.run(Thread.java:750) ~[na:1.8.0_382]
2024-12-15 22:37:44.923 INFO 83222 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2024-12-15 22:37:44.925 INFO 83222 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544576585
- I will say that I cannot reproduce your problem at https://github.com/linghengqian/demo/commit/ef6342b0e93346ed0335ec38a92b2cb330f5b0e4.
```shell
sdk install java 23-open
sdk use java 23-open
git clone git@github.com:apache/shardingsphere.git
cd ./shardingsphere/
git reset --hard 2108a520547aa5fe14babe9c4eaea7e920507427
./mvnw clean install -Prelease -T1C -DskipTests -Djacoco.skip=true -Dcheckstyle.skip=true -Drat.skip=true -Dmaven.javadoc.skip=true
cd ../
git clone git@github.com:linghengqian/demo.git
cd ./demo/
./mvnw clean spring-boot:run
```
- I executed `Ctrl+C` 1 minute after startup to ensure that the shardingsphere metadata was fully loaded. If you don't execute SQL additionally, it is obviously unknown when shardingsphere will finish loading the metadata, because the h2database in memory mode is not as performant as you think.
```shell
2024-12-16 12:25:31.937 INFO 75588 --- [ main] com.java.encrypt.demo.DemoApplication : Started DemoApplication in 2.948 seconds (JVM running for 3.217)
^C2024-12-16 12:26:23.561 INFO 75588 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2024-12-16 12:26:23.564 INFO 75588 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
```
- There is clearly a problem with your dependency management. Shardingsphere uses snakeyaml 2.2, which is stated at https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/spring-boot/#special-handling-for-earlier-versions-of-spring-boot-oss-2 .
- The h2database version you are using is a bit scary. By default, the stand-alone mode of shardingsphere uses h2database instead of zookeeper to save metadata. Using an old version of h2database with memory leak problems is obviously too dangerous.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "libra146 (via GitHub)" <gi...@apache.org>.
libra146 commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544757898
I upgraded the version of h2, and it is working normally now, thank you for your help! I will try to find out where the lower version of h2 was introduced.
By the way, when will the 5.5.2 version be released?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "libra146 (via GitHub)" <gi...@apache.org>.
libra146 commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544464688
> * What is the content of https://github.com/libra146/demo/blob/main/src/main/resources/encrypt/encrypt-uat.yml actually? This doesn't seem to be something that belongs to the shardingsphere itself. If you are using docker compose or testcontainers-java to create a real data source, you should provide some information in the README.
This file is the configuration file of ShardingSphere. It is empty now because it does not affect the recurrence of the problem.
Normally, I would use similar code to read this file and load the real data source. Since this is a demo, I have ignored the contents of this file in order to allow everyone to run normally.
`DataSource dataSource = YamlShardingSphereDataSourceFactory.createDataSource(yamlFile);`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "libra146 (via GitHub)" <gi...@apache.org>.
libra146 commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544269021
> * You should convert the zip to git on github so I can view it directly using GitHub codespaces. Downloading the zip is a bit dangerous for developers.
>
> > Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed
>
> * This looks like a duplicate of [When `Mode` uses the memory mode of `H2database`, `JDBCRepository` has a logical problem in processing Delete and Create SQL statements #33281](https://github.com/apache/shardingsphere/issues/33281) , which is in the 5.5.2 milestone. Have you tested the master branch?
Okay, I'll test the code from the master branch and if it happens again I'll upload the code to Github
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "libra146 (via GitHub)" <gi...@apache.org>.
libra146 closed issue #34068: When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214]
URL: https://github.com/apache/shardingsphere/issues/34068
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544769267
> I will try to find out where the lower version of h2 was introduced.
- Your project parent pom is `org.springframework.boot:spring-boot-dependencies:2.7.18` and `h2.version` is of course defined there. Feel free to check out the Maven 3 documentation. The ASF doesn't actually have infrastructure documentation for Maven 4 yet.
> By the way, when will the 5.5.2 version be released?
- According to ASF's agreement, release voting and discussion have nothing to do with github.com. If you expect to release a new version as soon as possible, you should open a new mail thread at https://lists.apache.org/list.html?dev@shardingsphere.apache.org and find 3 PMCs who are willing to release a new version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "libra146 (via GitHub)" <gi...@apache.org>.
libra146 commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544452238
> * You should convert the zip to git on github so I can view it directly using GitHub codespaces. Downloading the zip is a bit dangerous for developers.
>
> > Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed
>
> * This looks like a duplicate of [When `Mode` uses the memory mode of `H2database`, `JDBCRepository` has a logical problem in processing Delete and Create SQL statements #33281](https://github.com/apache/shardingsphere/issues/33281) , which is in the 5.5.2 milestone. Have you tested the master branch?
I uploaded the code to Github, I built the code for the master branch in codespaces, installed it into my local repo, but I still get the error
My pom configuration is
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.java.encrypt</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>demo</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc</artifactId>
<version>5.5.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<classifier>osx-aarch_64</classifier>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.3.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
<version>8.0.28</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
```
The Github address of the code is: https://github.com/libra146/demo
The command I use is: mvnw spring-boot:run
The output is:
```bash
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.java.encrypt:demo >------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot:2.7.18:run (default-cli) > test-compile @ demo >>>
[INFO]
[INFO] --- resources:3.2.0:resources (default-resources) @ demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- compiler:3.10.1:compile (default-compile) @ demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- resources:3.2.0:testResources (default-testResources) @ demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /workspaces/shardingsphere/demo/demo/src/test/resources
[INFO]
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ demo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot:2.7.18:run (default-cli) < test-compile @ demo <<<
[INFO]
[INFO]
[INFO] --- spring-boot:2.7.18:run (default-cli) @ demo ---
[INFO] Attaching agents: []
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.7.18)
2024-12-16 03:05:53.125 INFO 165754 --- [ main] com.java.encrypt.demo.DemoApplication : Starting DemoApplication using Java 11.0.14.1 on codespaces-d7d021 with PID 165754 (/workspaces/shardingsphere/demo/demo/target/classes started by codespace in /workspaces/shardingsphere/demo/demo)
2024-12-16 03:05:53.134 INFO 165754 --- [ main] com.java.encrypt.demo.DemoApplication : The following 1 profile is active: "uat"
2024-12-16 03:05:54.776 WARN 165754 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.java.encrypt.demo]' package. Please check your configuration.
2024-12-16 03:05:55.329 INFO 165754 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 65004 (http)
2024-12-16 03:05:55.342 INFO 165754 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2024-12-16 03:05:55.342 INFO 165754 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.83]
2024-12-16 03:05:55.607 INFO 165754 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2024-12-16 03:05:55.607 INFO 165754 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1907 ms
2024-12-16 03:05:56.013 INFO 165754 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2024-12-16 03:05:56.193 INFO 165754 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
_ _ |_ _ _|_. ___ _ | _
| | |\/|_)(_| | |_\ |_)||_|_\
/ |
3.5.3.1
2024-12-16 03:06:00.095 INFO 165754 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 65004 (http) with context path ''
2024-12-16 03:06:00.112 INFO 165754 --- [ main] com.java.encrypt.demo.DemoApplication : Started DemoApplication in 7.742 seconds (JVM running for 8.633)
^C2024-12-16 03:06:02.463 ERROR 165754 --- [ionShutdownHook] o.a.s.m.r.s.jdbc.JDBCRepository : Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/c8459768-9953-4cc2-a734-1a72f05f1604 failed
org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "repository" not found (this database is empty); SQL statement:
DELETE FROM `repository` WHERE `key` LIKE ? [42104-214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8385) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8369) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readTableOrView(Parser.java:8358) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readTableOrView(Parser.java:8328) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readSimpleTableFilter(Parser.java:1160) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parseDelete(Parser.java:1174) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parsePrepared(Parser.java:774) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214]
at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214]
at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:92) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) ~[h2-2.1.214.jar:2.1.214]
at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:337) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar:na]
at org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository.delete(JDBCRepository.java:202) ~[shardingsphere-standalone-mode-repository-jdbc-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
at org.apache.shardingsphere.mode.persist.service.ComputeNodePersistService.offline(ComputeNodePersistService.java:192) ~[shardingsphere-mode-core-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
at org.apache.shardingsphere.mode.manager.ContextManager.close(ContextManager.java:208) ~[shardingsphere-mode-core-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.close(ShardingSphereDataSource.java:107) ~[shardingsphere-jdbc-5.5.2-SNAPSHOT.jar:5.5.2-SNAPSHOT]
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:242) ~[spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587) ~[spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559) ~[spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163) ~[spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520) ~[spring-beans-5.3.31.jar:5.3.31]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156) ~[spring-beans-5.3.31.jar:5.3.31]
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1120) ~[spring-context-5.3.31.jar:5.3.31]
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1086) ~[spring-context-5.3.31.jar:5.3.31]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:174) ~[spring-boot-2.7.18.jar:2.7.18]
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1032) ~[spring-context-5.3.31.jar:5.3.31]
at org.springframework.boot.SpringApplicationShutdownHook.closeAndWait(SpringApplicationShutdownHook.java:145) ~[spring-boot-2.7.18.jar:2.7.18]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:114) ~[spring-boot-2.7.18.jar:2.7.18]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
2024-12-16 03:06:02.464 INFO 165754 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2024-12-16 03:06:02.476 INFO 165754 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.287 s
[INFO] Finished at: 2024-12-16T03:06:02Z
[INFO] ------------------------------------------------------------------------
```
Looks like it worked, but still errors
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "libra146 (via GitHub)" <gi...@apache.org>.
libra146 commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544783561
Alright, thank you again for solving my problem. I will close this issue as it has been resolved.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "chenqi14 (via GitHub)" <gi...@apache.org>.
chenqi14 commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-3051739238
The root cause of this issue lies in the shutdown mechanism of H2Database, which is controlled by the parameter DB_CLOSE_ON_EXIT. When this parameter is set to true, the database will be automatically closed when the JVM shuts down, and accessing the database through the application at this point will result in such an error.
for H2Database versions < 2.2.222, the default value of DB_CLOSE_ON_EXIT is true; for versions >=2.2.222 , the default value of DB_CLOSE_ON_EXIT is false.
The way to manually set this parameter is as follows: jdbc:h2:mem:config;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;DB_CLOSE_ON_EXIT=false;MODE=MySQL.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2543926482
- You should convert the zip to git on github so I can view it directly using GitHub codespace. Downloading the zip is a bit dangerous for developers.
> Delete JDBC data by key: /nodes/compute_nodes/online/jdbc/626d5773-22b2-4cc4-987d-7a4b09ae383b failed
- This looks like a duplicate of #33281 , which is in the 5.5.2 milestone. Have you tested the master branch?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-2544459897
- What is the content of https://github.com/libra146/demo/blob/main/src/main/resources/encrypt/encrypt-uat.yml actually? This doesn't seem to be something that belongs to the shardingsphere itself. If you are using docker compose or testcontainers-java to create a real data source, you should provide some information in the README.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] When the project stops, it has an error: Table "repository" not found (this database is empty); SQL statement: DELETE FROM `repository` WHERE `key` LIKE ? [42104-214] [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #34068:
URL: https://github.com/apache/shardingsphere/issues/34068#issuecomment-3084090419
- Then again, since https://github.com/apache/shardingsphere/pull/35918 changed `org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository#isDefault()` from `true` to `false`, it seems meaningless to keep this issue open. Because we are discussing an optional module. It is OK for optional modules to do anything.
- Long story short, shardingsphere 5.5.3-SNAPSHOT does not include h2database dependency by default.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org