jcasbin / jdbc-adapter Goto Github PK
View Code? Open in Web Editor NEWJDBC adapter for Casbin
Home Page: https://github.com/casbin/jcasbin
License: Apache License 2.0
JDBC adapter for Casbin
Home Page: https://github.com/casbin/jcasbin
License: Apache License 2.0
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can fix this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here are some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The deployment to maven failed for an unknown reason.
Please check the logs on the CI server to see what happened.
Good luck with your project β¨
Your semantic-release bot π¦π
When the FilteredAdapter
interface was implemented (#25), another unrelated change was introduced. Unfortunately, this was a breaking change.
In particular, the CasbinRule
format changed, a new field was added:
int id; //Fields reserved for compatibility with other adapters, and the primary key is automatically incremented.
Now, this is fine on its own since the implementation completely ignores it, but the expected casbin_rule
table structure changes accordingly.
Since the query is as follows:
SELECT * FROM casbin_rule;
The id
column is expected to be the first column and is implicitly skipped:
while (rSet.next()) {
CasbinRule line = new CasbinRule();
for (int i = 1; i <= rData.getColumnCount(); i++) {
if (i == 2) {
line.ptype = rSet.getObject(i) == null ? "" : (String) rSet.getObject(i);
} else if (i == 3) {
line.v0 = rSet.getObject(i) == null ? "" : (String) rSet.getObject(i);
} else if (i == 4) {
line.v1 = rSet.getObject(i) == null ? "" : (String) rSet.getObject(i);
} else if (i == 5) {
line.v2 = rSet.getObject(i) == null ? "" : (String) rSet.getObject(i);
} else if (i == 6) {
line.v3 = rSet.getObject(i) == null ? "" : (String) rSet.getObject(i);
} else if (i == 7) {
line.v4 = rSet.getObject(i) == null ? "" : (String) rSet.getObject(i);
} else if (i == 8) {
line.v5 = rSet.getObject(i) == null ? "" : (String) rSet.getObject(i);
}
}
loadPolicyLine(line, model);
}
However, this is breaking existing applications that have been using this Adapter from before version 2.0.2, since the casbin_rule
table doesn't include the id
column.
On the top of my head, I can think of 2 alternatives to resolve this:
SELECT ptype, v0, v1, v2, v3, v4, v5 FROM casbin_rule;
and you would shift the conditions on i
back to start at 1
.
line.ptype = rSet.getObject("ptype") == null ? "" : (String) rSet.getObject("ptype");
The jar package in maven central for 1.1.2 is missing.
https://repo.maven.apache.org/maven2/org/casbin/jdbc-adapter/
If you write the pom dependency as in the readme file, the project doesn't compile.
I've got a jcasbin setup with a JDBC adapter connecting to postgres. Both the jcasbin setup and the postgres are running as containers in separate Kubernetes pods.
If the Postgres pod goes down and is restarted, the next call from the adapter fails with:
java.sql.BatchUpdateException: Batch entry 0 INSERT INTO casbin_rule (ptype,v0,v1,v2,v3,v4,v5) VALUES(*[SNIP]*) was aborted: An I/O error occurred while sending to the backend. Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:145)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:486)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:840)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1538)
at org.casbin.adapter.JDBCBaseAdapter.addPolicy(JDBCBaseAdapter.java:317)
at org.casbin.adapter.JDBCAdapter.addPolicy(JDBCAdapter.java:36)
at org.casbin.jcasbin.main.InternalEnforcer.addPolicy(InternalEnforcer.java:41)
at org.casbin.jcasbin.main.ManagementEnforcer.addNamedPolicy(ManagementEnforcer.java:303)
at org.casbin.jcasbin.main.ManagementEnforcer.addPolicy(ManagementEnforcer.java:267)
at org.casbin.jcasbin.main.ManagementEnforcer.addPolicy(ManagementEnforcer.java:290)
*[SNIP]*
at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
... 19 more
Caused by: java.io.EOFException
at org.postgresql.core.PGStream.receiveChar(PGStream.java:308)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1952)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:481)
... 18 more
Any subsequent calls fail with:
Stacktrace: org.apache.felix.log.LogException: java.lang.Error: org.postgresql.util.PSQLException: This connection has been closed.
at org.casbin.adapter.JDBCBaseAdapter.addPolicy(JDBCBaseAdapter.java:320)
at org.casbin.adapter.JDBCAdapter.addPolicy(JDBCAdapter.java:36)
at org.casbin.jcasbin.main.InternalEnforcer.addPolicy(InternalEnforcer.java:41)
at org.casbin.jcasbin.main.ManagementEnforcer.addNamedPolicy(ManagementEnforcer.java:303)
at org.casbin.jcasbin.main.ManagementEnforcer.addPolicy(ManagementEnforcer.java:267)
at org.casbin.jcasbin.main.ManagementEnforcer.addPolicy(ManagementEnforcer.java:290)
*[SNIP]*
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.felix.log.LogException: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:783)
at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:1680)
at org.postgresql.jdbc.PgConnection.prepareStatement(PgConnection.java:371)
at org.casbin.adapter.JDBCBaseAdapter.addPolicy(JDBCBaseAdapter.java:306)
... 15 more
After restarting the casbin setup, everything works as expected again. Could the error handling be changed so that the adapter attempts to reconnect in case of a closed connection, instead of immediately having an unrecoverable state?
Failure in the savePolicy function can lead to a complete loss of all data because savePolicy doesn't use transactions AND:
If 1 succeed and a failure occurs anytime after it can lead to a partial or complete data loss.
It'd be much safer if it:
I actually don't see any usage of transactions in this Adapter, which is worrisome, but maybe I'm missing something?
Can we get a new release which includes #33 ?
Context:
Before jcasbin 1.10.2, the following code would load all policies currently stored in the DB:
this.jdbcAdapter = new JDBCAdapter(this.dataSourceFactory.createDataSource(props));
final Model model = CoreEnforcer.newModel(this.getResourceFileAsString("rbac_model.conf"));
this.enforcer = new Enforcer(model, this.jdbcAdapter);
With jcasbin 1.10.2 and up, existing policies are no longer loaded. This seems to be because of the isFiltered check introduced in casbin/jcasbin@c61a1ab . #33 sets the default value for isFiltered to false, which I assume will fix the issue.
See details at: https://github.com/casbin/jcasbin/search?q=FilteredAdapter
This is a customer requirement from our Gitter: https://gitter.im/casbin/Lobby
I have been trying the JDBC adapter for jcasbin. While trying to insert approx 4L records for policy it took more than 2 hours
The code that I used was as follows
public static void main(String[] a) throws Exception {
JDBCAdapter a1 = new JDBCAdapter(driver, url, username, password);
Enforcer e = new Enforcer("C:\\temp\\jcasbin_try\\model.conf", a1);
long start = System.currentTimeMillis();
System.out.println("Starting at " + new Date());
for (int object = 101; object <= 20000; object++) {
for (int identity = 1; identity <= 20; identity++) {
e.addPolicy("rdt00"+identity, "PlannerObject_"+object, "read");
}
}
long end = System.currentTimeMillis();
System.out.println("Ending addPolicy at " + new Date() + " total Time : " + (end - start));
e.savePolicy();
System.out.println("Ending savePolicy at " + new Date() + " total Time : " + (System.currentTimeMillis() - end));
}
I implicitly created casbin_rule
table with Id generation type as IDENTITY
. But it created casbin_sequence
which wasn't required and happened because of
case "PostgreSQL": sql = renderActualSql("CREATE SEQUENCE IF NOT EXISTS CASBIN_SEQUENCE START 1;");
in JDBCBaseAdapter.java
.
It should only be executed when the table doesn't exist otherwise the generation of sequence is redundant.
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can fix this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here are some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The deployment to maven failed for an unknown reason.
Please check the logs on the CI server to see what happened.
Good luck with your project β¨
Your semantic-release bot π¦π
Use this as a reference: #34
Hi,
I need to store my policy in database. I will be using postgresql.
So do I need to have a specific table structure or It can be custom?
For example I want to store this policy
p, nsm_role, /national_sales, *
p, rsm_role, /regional_sales, *
p, asm_role, /area_sales, *
g, nsm_role, rsm_role
g, rsm_role, asm_role
g, nsm_user, nsm_role
g, nsm_user, admin_role
g, rsm_user, rsm_role
g, asm_user, asm_role
From seeing the codebase it seems there should be columns like p_type, v1, v2, v3 etc.
But what does this mean, can you explain please?
Can I have multiple tables like user_roles_table
for g mapping and policy_table
for p mapping?
Thanks
Description
When using jdbc-adapter v2.2.0 or v2.2.1 with PostgreSQL, the database connection is easy to stuck in "idle in transaction" status: the transaction is not closed and locks also not released.
Especially when deploying multiple instances using redis-watcher, other instances' operation is likely to fail due to cannot get database lock.
To Reproduce
String modelPath = "path/to/model";
JDBCAdapter adapter = new JDBCAdapter(databaseDriver, databaseUrl, databaseUsername, databasePassword);
SyncedEnforcer enforcer = new SyncedEnforcer(modelPath, adapter);
RedisWatcher watcher = new RedisWatcher(redisHost, redisPort, redisChannel, 5000, redisPassword);
enforcer.setWatcher(watcher);
enforcer.addNamedPolicy()
Root Cause
In v2.2.0 and v2.2.1, auto-commit is set to false in method addPolicies
and removePolicies
, and never set back to ture after the operation is finished.
So, after the policies were modified, the enforcer received update notice from the watcher and calls adapter's loadPolicy
method, which will hang the transaction due to auto-commit = false
.
Fix
I prepared a fix, please review: #50
What I do:
Calling enforcer.updatePolicy(oldPolicyParams, newPolicyParams); to execute and save policy changes.
What to expect:
Persist policy changes to the database.
What we get:
Policy changes were not persisted to the database.
Requirement:
It is hoped that JDBCAdapter will implement the UpdatableAdapter interface.
What is UpdatableAdapter?
Golang's code: (as reference)
Hello,
I am new to JCasbin, so apolologies if this is a rookie mistake.
Executing this code
String s = """
# Request definition
[request_definition]
r = sub, obj, act
# Policy definition
[policy_definition]
p = sub, obj, act
# Policy effect
[policy_effect]
e = some(where (p.eft == allow))
# Matchers
[matchers]
m = r.sub == p.sub && r.obj == p.obj && r.act == p.act
""";
Model model = newModel(s);
InitialContext context = new InitialContext();
DataSource dataSource = (DataSource) context.lookup(DB_ALIAS);
Adapter adapter = new JDBCAdapter(dataSource);
Enforcer e = new Enforcer(model, adapter);
e.addPolicy("foo", "bar", "read");
e.savePolicy();
fails with a NPE
java.lang.NullPointerException: Cannot invoke "java.util.Map.entrySet()" because the return value of "java.util.Map.get(Object)" is null
at org.casbin.adapter.JDBCBaseAdapter.lambda$savePolicy$1(JDBCBaseAdapter.java:299)
at dev.failsafe.Functions.lambda$toCtxSupplier$10(Functions.java:236)
at dev.failsafe.Functions.lambda$get$0(Functions.java:46)
at dev.failsafe.internal.RetryPolicyExecutor.lambda$apply$0(RetryPolicyExecutor.java:74)
at dev.failsafe.SyncExecutionImpl.executeSync(SyncExecutionImpl.java:193)
at dev.failsafe.FailsafeExecutor.call(FailsafeExecutor.java:376)
at dev.failsafe.FailsafeExecutor.run(FailsafeExecutor.java:231)
at org.casbin.adapter.JDBCBaseAdapter.savePolicy(JDBCBaseAdapter.java:265)
The NPE occurs at https://github.com/jcasbin/jdbc-adapter/blob/master/src/main/java/org/casbin/adapter/JDBCBaseAdapter.java#L299
because model.model.get("g")
is null.
Shouldn't the code handle the different authorization model types? (the model above is the default ACL model).
Or am I missing something?
Regards, Eric
oracle not support CREATE TABLE IF NOT EXISTS
,DROP TABLE IF EXISTS
,rewriteBatchedStatements
org.casbin.jcasbin.persist.JDBCBaseAdapter
has loadPolicy
method to fetch data from db.
Then it iterates over the rows and for each of the row it calls loadPolicyLine
-> Helper.loadPolicyLine
.
Inside helper there is:
public static void loadPolicyLine(String line, Model model) {
if (!"".equals(line)) {
if (line.charAt(0) != '#') {
String[] tokens = Util.splitCommaDelimited(line);
String key = tokens[0];
String sec = key.substring(0, 1);
Assertion ast = (Assertion)((Map)model.model.get(sec)).get(key);
ast.policy.add(Arrays.asList(Arrays.copyOfRange(tokens, 1, tokens.length)));
for(int i = 0; i < ast.policy.size(); ++i) {
ast.policyIndex.put(((List)ast.policy.get(i)).toString(), i);
}
}
}
}
one more row loop.
so for the db rows it will iterate like this:
1 1 1 ... n
2 2 2
3 3
...
n
why do you need this internal for loop?
it can be changed to:
public static void loadPolicyLine(String line, Model model) {
if (!"".equals(line)) {
if (line.charAt(0) != '#') {
String[] tokens = Util.splitCommaDelimited(line);
String key = tokens[0];
String sec = key.substring(0, 1);
Assertion ast = (Assertion)((Map)model.model.get(sec)).get(key);
List<String> nPolicy = Arrays.asList(Arrays.copyOfRange(tokens, 1, tokens.length))
ast.policy.add(nPolicy);
ast.policyIndex.put(policy.toString(), ast.policy.size() - 1);
}
}
}
so no loop, faster load. what is the reason of it? Or maybe i missed something?
code: "?rewriteBatchedStatements=true".
It should be like this:
if url.contains("?"){
url = url + "&rewriteBatchedStatements=true";
}else {
url = url + "?rewriteBatchedStatements=true";
}
when using DataSource to initialize the JDBC adapter to use Jcasbin, it's OK at first several hours.
However, when it takes long enough, problem happens. It cannot connect to Database, I try to solve the problem according the log hint., I tried:
spring.datasource.hikari.validationTimeout = 300000
for application&autoReconnect=true
to jdbcUrlHere is the my environment and library version:
<dependency>
<groupId>org.casbin</groupId>
<artifactId>jdbc-adapter</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>org.casbin</groupId>
<artifactId>jcasbin</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.25</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>4.0.3</version>
</dependency>
Here is how I initialize the JDBC adapter:
@Bean
fun enforcer(
properties: CasbinProperties,
dataSource: DataSource
): EnforcerExt {
val jdbcAdapter = JDBCAdapter(dataSource)
val model = Model()
val enforcer = Enforcer(model, jdbcAdapter)
enforcer.enableAutoSave(false)
enforcer.enableEnforce(properties.enable)
return enforcer
}
Here is the Error Log:
2021-08-04 13:38:03.633 - WARN 9 --- [http-nio-8080-exec-5] com.zaxxer.hikari.pool.ProxyConnection : HikariPool-1 - Connection com.mysql.cj.jdbc.ConnectionImpl@5d725547 marked as broken because of SQLSTATE(08S01), ErrorCode(0)
com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 162,348,225 milliseconds ago. The last packet sent successfully to the server was 162,348,225 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:2061) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.zaxxer.hikari.pool.ProxyConnection.setAutoCommit(ProxyConnection.java:414) ~[HikariCP-4.0.3.jar!/:na]
at com.zaxxer.hikari.pool.HikariProxyConnection.setAutoCommit(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar!/:na]
at org.casbin.adapter.JDBCAdapter.savePolicy(JDBCAdapter.java:224) ~[jdbc-adapter-2.0.1.jar!/:na]
at org.casbin.jcasbin.main.CoreEnforcer.savePolicy(CoreEnforcer.java:264) ~[jcasbin-1.6.0.jar!/:na]
at com.fingard.rdc.avatar.auth.service.role.RoleService.updateMember(RoleService.kt:233) ~[classes!/:0.0.1-SNAPSHOT]
at com.fingard.rdc.avatar.auth.service.role.RoleService$$FastClassBySpringCGLIB$$582436b2.invoke(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.8.jar!/:5.3.8]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.3.8.jar!/:5.3.8]
at com.fingard.rdc.avatar.auth.service.role.RoleService$$EnhancerBySpringCGLIB$$d70ffc6.updateMember(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
at com.fingard.rdc.avatar.auth.controller.role.RoleController.updateMember(RoleController.kt:115) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1063) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:228) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) ~[spring-boot-actuator-2.5.2.jar!/:2.5.2]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.48.jar!/:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.48.jar!/:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 162,348,225 milliseconds ago. The last packet sent successfully to the server was 162,348,225 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:546) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:710) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:649) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:951) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.NativeProtocol.sendQueryString(NativeProtocol.java:897) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.NativeSession.execSQL(NativeSession.java:1073) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:2051) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
... 64 common frames omitted
Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
at com.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:67) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:52) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:41) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:54) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:44) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
at com.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:540) ~[mysql-connector-java-8.0.25.jar!/:8.0.25]
... 70 common frames omitted
2021-08-04 13:39:57.565 -ERROR 9 --- [http-nio-8080-exec-6] org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.Error: java.sql.SQLException: Connection is closed] with root cause
java.sql.SQLException: Connection is closed
at com.zaxxer.hikari.pool.ProxyConnection$ClosedConnection.lambda$getClosedConnection$0(ProxyConnection.java:515) ~[HikariCP-4.0.3.jar!/:na]
at com.sun.proxy.$Proxy128.setAutoCommit(Unknown Source) ~[na:na]
at com.zaxxer.hikari.pool.ProxyConnection.setAutoCommit(ProxyConnection.java:414) ~[HikariCP-4.0.3.jar!/:na]
at com.zaxxer.hikari.pool.HikariProxyConnection.setAutoCommit(HikariProxyConnection.java) ~[HikariCP-4.0.3.jar!/:na]
at org.casbin.adapter.JDBCAdapter.savePolicy(JDBCAdapter.java:224) ~[jdbc-adapter-2.0.1.jar!/:na]
at org.casbin.jcasbin.main.CoreEnforcer.savePolicy(CoreEnforcer.java:264) ~[jcasbin-1.6.0.jar!/:na]
at com.fingard.rdc.avatar.auth.service.role.RoleService.updateMember(RoleService.kt:233) ~[classes!/:0.0.1-SNAPSHOT]
at com.fingard.rdc.avatar.auth.service.role.RoleService$$FastClassBySpringCGLIB$$582436b2.invoke(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.8.jar!/:5.3.8]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.3.8.jar!/:5.3.8]
at com.fingard.rdc.avatar.auth.service.role.RoleService$$EnhancerBySpringCGLIB$$d70ffc6.updateMember(<generated>) ~[classes!/:0.0.1-SNAPSHOT]
at com.fingard.rdc.avatar.auth.controller.role.RoleController.updateMember(RoleController.kt:115) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1063) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.8.jar!/:5.3.8]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:228) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) ~[spring-boot-actuator-2.5.2.jar!/:2.5.2]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.8.jar!/:5.3.8]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:190) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:163) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1723) ~[tomcat-embed-core-9.0.48.jar!/:na]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.48.jar!/:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.48.jar!/:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can fix this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here are some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The deployment to maven failed for an unknown reason.
Please check the logs on the CI server to see what happened.
Good luck with your project β¨
Your semantic-release bot π¦π
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.