Code Monkey home page Code Monkey logo

jdbc-adapter's People

Contributors

cathysha avatar dependabot[bot] avatar fengxq2014 avatar hsluoyz avatar imp2002 avatar javakky-pxv avatar jcereal avatar lixuanbin avatar mpokryva avatar nodece avatar outofeastgate avatar p3t avatar pokisemaine avatar selflocking avatar seriouszyx avatar shy1st avatar tangyang9464 avatar tldyl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jdbc-adapter's Issues

The automated release is failing 🚨

🚨 The automated release from the 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.


Deployment to maven failed.

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 πŸ“¦πŸš€

Breaking change between version 2.0.1 and version 2.0.2

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:

  1. You could rewrite the query to be:
SELECT ptype, v0, v1, v2, v3, v4, v5 FROM casbin_rule;

and you would shift the conditions on i back to start at 1.

  1. Instead of using column indexes, you could use column names:
line.ptype = rSet.getObject("ptype") == null ? "" : (String) rSet.getObject("ptype");

Broken connection not re-established.

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?

Potential for partial/complete dataloss

Failure in the savePolicy function can lead to a complete loss of all data because savePolicy doesn't use transactions AND:

  1. First drops the table
  2. Recreates the table.
  3. Executes a batch of inserts to save the policy.

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:

  1. Started a transaction
  2. Deleted everything in the table (not drop table, mysql doesn't support DML transactions)
  3. Inserted the new policy.
  4. Committed the transaction.

I actually don't see any usage of transactions in this Adapter, which is worrisome, but maybe I'm missing something?

2.0.2 not loading old data with jcasbin >1.10.2

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.

Takes 2 hrs to load 4L Policy records

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));
}

The automated release is failing 🚨

🚨 The automated release from the 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.


Deployment to maven failed.

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 πŸ“¦πŸš€

Question: Table structure for storing policy in database.

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

Transaction not closed and database locks not released

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

  1. Create enforcer with JDBCAdapter and RedisWatcher
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);
  1. Call any API that add/remove policies, e.g. enforcer.addNamedPolicy()
  2. Check the database status, the connection is in "idle in transaction" status and holding some locks.

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

feature: JDBCAdapter doesn't implement the UpdatableAdapter interface

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)

Question/Bug: savePolicy fails with NPE for ACL model

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

Load policies is slow

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?

v1.1.2 bug

code: "?rewriteBatchedStatements=true".
It should be like this:

if url.contains("?"){
    url = url + "&rewriteBatchedStatements=true";
}else {
    url = url + "?rewriteBatchedStatements=true";
}

Connection is closed

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:

  1. set spring.datasource.hikari.validationTimeout = 300000 for application
  2. add &autoReconnect=true to jdbcUrl
    but it doesn't works at all.

Here 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:

  1. SQLSTATE(08S01), ErrorCode(0) ... The last packet successfully received from the server was 162,348,225 milliseconds ago...
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
  1. Connection is closed
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]

The automated release is failing 🚨

🚨 The automated release from the 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.


Deployment to maven failed.

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 πŸ“¦πŸš€

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.