Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] Update a metalake with null comment failed #4845

Closed
yuqi1129 opened this issue Sep 3, 2024 · 0 comments · Fixed by #4846
Closed

[Bug report] Update a metalake with null comment failed #4845

yuqi1129 opened this issue Sep 3, 2024 · 0 comments · Fixed by #4846
Assignees
Labels
0.6.1 Release v0.6.1 0.7.0 Release v0.7.0 bug Something isn't working

Comments

@yuqi1129
Copy link
Contributor

yuqi1129 commented Sep 3, 2024

Version

main branch

Describe what's wrong

curl -X POST -H "Content-Type: application/json" -d '{"name":"test1","properties":{}}' http://localhost:8090/api/metalakes

curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
-H "Content-Type: application/json" -d '{
  "updates": [
    {
      "@type": "updateComment",
      "newComment": "comment"
    }
  ]
}' http://localhost:8090/api/metalakes/test1

{"code":1002,"type":"RuntimeException","message":"Failed to operate object [test1] operation [ALTER], reason [Failed to update the entity: test1]","stack":["java.lang.RuntimeException: java.io.IOException: Failed to update the entity: test1","\tat org.apache.gravitino.metalake.MetalakeManager.alterMetalake(MetalakeManager.java:203)","\tat org.apache.gravitino.metalake.MetalakeManager.alterMetalake(MetalakeManager.java:45)","\tat org.apache.gravitino.hook.MetalakeHookDispatcher.alterMetalake(MetalakeHookDispatcher.java:86)","\tat org.apache.gravitino.metalake.MetalakeNormalizeDispatcher.alterMetalake(MetalakeNormalizeDispatcher.java:86)","\tat org.apache.gravitino.listener.MetalakeEventDispatcher.alterMetalake(MetalakeEventDispatcher.java:119)","\tat org.apache.gravitino.server.web.rest.MetalakeOperations.lambda$alterMetalake$7(MetalakeOperations.java:172)","\tat org.apache.gravitino.lock.TreeLockUtils.doWithTreeLock(TreeLockUtils.java:49)","\tat org.apache.gravitino.lock.TreeLockUtils.doWithRootTreeLock(TreeLockUtils.java:67)","\tat org.apache.gravitino.server.web.rest.MetalakeOperations.lambda$alterMetalake$8(MetalakeOperations.java:171)","\tat java.base/java.security.AccessController.doPrivileged(AccessController.java:712)","\tat java.base/javax.security.auth.Subject.doAs(Subject.java:439)","\tat org.apache.gravitino.utils.PrincipalUtils.doAs(PrincipalUtils.java:39)","\tat org.apache.gravitino.server.web.Utils.doAs(Utils.java:149)","\tat org.apache.gravitino.server.web.rest.MetalakeOperations.alterMetalake(MetalakeOperations.java:161)","\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)","\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)","\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)","\tat java.base/java.lang.reflect.Method.invoke(Method.java:568)","\tat org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)","\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)","\tat org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaReso

Error message and/or stacktrace

2024-09-03 20:52:28.580 ERROR [Gravitino-webserver-38] [org.apache.gravitino.server.web.rest.ExceptionHandlers$BaseExceptionHandler.handle(ExceptionHandlers.java:615)] - Failed to operate object [test1] operation [ALTER], reason [Failed to update the entity: test1]
java.lang.RuntimeException: java.io.IOException: Failed to update the entity: test1
at org.apache.gravitino.metalake.MetalakeManager.alterMetalake(MetalakeManager.java:203) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.metalake.MetalakeManager.alterMetalake(MetalakeManager.java:45) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.hook.MetalakeHookDispatcher.alterMetalake(MetalakeHookDispatcher.java:86) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.metalake.MetalakeNormalizeDispatcher.alterMetalake(MetalakeNormalizeDispatcher.java:86) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.listener.MetalakeEventDispatcher.alterMetalake(MetalakeEventDispatcher.java:119) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.server.web.rest.MetalakeOperations.lambda$alterMetalake$7(MetalakeOperations.java:172) ~[gravitino-server-0.6.0-incubating.jar:?]
at org.apache.gravitino.lock.TreeLockUtils.doWithTreeLock(TreeLockUtils.java:49) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.lock.TreeLockUtils.doWithRootTreeLock(TreeLockUtils.java:67) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.server.web.rest.MetalakeOperations.lambda$alterMetalake$8(MetalakeOperations.java:171) ~[gravitino-server-0.6.0-incubating.jar:?]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) ~[?:?]
at java.base/javax.security.auth.Subject.doAs(Subject.java:439) ~[?:?]
at org.apache.gravitino.utils.PrincipalUtils.doAs(PrincipalUtils.java:39) ~[gravitino-core-0.6.0-incubating.jar:?]
at org.apache.gravitino.server.web.Utils.doAs(Utils.java:149) ~[gravitino-server-0.6.0-incubating.jar:?]
at org.apache.gravitino.server.web.rest.MetalakeOperations.alterMetalake(MetalakeOperations.java:161) ~[gravitino-server-0.6.0-incubating.jar:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) ~[jersey-common-2.41.jar:?]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) ~[jersey-common-2.41.jar:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[jersey-common-2.41.jar:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:274) ~[jersey-common-2.41.jar:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:244) ~[jersey-common-2.41.jar:?]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) ~[jersey-common-2.41.jar:?]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:235) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684) ~[jersey-server-2.41.jar:?]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394) ~[jersey-container-servlet-core-2.41.jar:?]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346) ~[jersey-container-servlet-core-2.41.jar:?]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358) ~[jersey-container-servlet-core-2.41.jar:?]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311) ~[jersey-container-servlet-core-2.41.jar:?]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205) ~[jersey-container-servlet-core-2.41.jar:?]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[jetty-servlet-9.4.51.v20230217.jar:9.4.51.v20230217]
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656) ~[jetty-servlet-9.4.51.v20230217.jar:9.4.51.v20230217]
at org.apache.gravitino.server.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:86) ~[gravitino-server-common-0.6.0-incubating.jar:?]
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.51.v20230217.jar:9.4.51.v20230217]
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) ~[jetty-servlet-9.4.51.v20230217.jar:9.4.51.v20230217]
at org.apache.gravitino.server.web.VersioningFilter.doFilter(VersioningFilter.java:111) ~[gravitino-server-0.6.0-incubating.jar:?]
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) ~[jetty-servlet-9.4.51.v20230217.jar:9.4.51.v20230217]

How to reproduce

Please see above.

Additional context

No response

@yuqi1129 yuqi1129 added the bug Something isn't working label Sep 3, 2024
@yuqi1129 yuqi1129 self-assigned this Sep 3, 2024
github-actions bot pushed a commit that referenced this issue Sep 4, 2024
…llable comment. (#4846)

### What changes were proposed in this pull request?

Change the update SQL in the mapper to handle nullable comment. 

### Why are the changes needed?

It's a bug to fix.

Fix: #4845 

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

Added UTs and ITs
@jerryshao jerryshao added 0.6.1 Release v0.6.1 0.7.0 Release v0.7.0 labels Sep 4, 2024
jerryshao pushed a commit that referenced this issue Sep 4, 2024
…llable comment. (#4855)

### What changes were proposed in this pull request?

Change the update SQL in the mapper to handle nullable comment. 

### Why are the changes needed?

It's a bug to fix.

Fix: #4845 

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

Added UTs and ITs

Co-authored-by: Qi Yu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.6.1 Release v0.6.1 0.7.0 Release v0.7.0 bug Something isn't working
Projects
None yet
2 participants