[ https://issues.apache.org/jira/browse/HDDS-6247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HDDS-6247: --------------------------------- Labels: pull-request-available (was: ) > Avoid logging stack trace for user input problems > ------------------------------------------------- > > Key: HDDS-6247 > URL: https://issues.apache.org/jira/browse/HDDS-6247 > Project: Apache Ozone > Issue Type: Improvement > Components: S3 > Reporter: Attila Doroszlai > Assignee: Attila Doroszlai > Priority: Major > Labels: pull-request-available > > In some cases S3 Gateway logs problems caused by user input (e.g. invalid > bucket name, permission denied) too verbosely, including irrelevant stack > trace. HDDS-6206 fixes it for the generic case, this issue is for specific > log statements. > Example: > {code:title=https://github.com/apache/ozone/blob/1804e225cbfd58e69ff5850f38c14968221054df/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketEndpoint.java#L244-L250} > LOG.error("Error in Create Bucket Request for bucket: {}", bucketName, > exception); > if (exception.getResult() == ResultCodes.INVALID_BUCKET_NAME) { > throw S3ErrorTable.newError(S3ErrorTable.INVALID_BUCKET_NAME, > bucketName); > } > throw exception; > {code} > Here the error should only be logged if it is not due to invalid bucket name > (which is an "expected" problem, due to user input). Currently it is too > verbose: > {noformat} > s3g_1 | 2022-02-02 07:05:56,998 [qtp690052870-23] ERROR > endpoint.BucketEndpoint: Error in Create Bucket Request for bucket: > invalid_bucket_ozone-test-9926849806 > s3g_1 | INVALID_BUCKET_NAME > org.apache.hadoop.ozone.om.exceptions.OMException: Bucket or Volume name has > an unsupported character : _ > s3g_1 | at > org.apache.hadoop.ozone.client.rpc.RpcClient.verifyBucketName(RpcClient.java:576) > s3g_1 | at > org.apache.hadoop.ozone.client.rpc.RpcClient.createBucket(RpcClient.java:515) > s3g_1 | at > org.apache.hadoop.ozone.client.rpc.RpcClient.createBucket(RpcClient.java:506) > s3g_1 | at > org.apache.hadoop.ozone.client.OzoneVolume.createBucket(OzoneVolume.java:385) > s3g_1 | at > org.apache.hadoop.ozone.client.ObjectStore.createS3Bucket(ObjectStore.java:118) > s3g_1 | at > org.apache.hadoop.ozone.s3.endpoint.EndpointBase.createS3Bucket(EndpointBase.java:117) > s3g_1 | at > org.apache.hadoop.ozone.s3.endpoint.BucketEndpoint.put(BucketEndpoint.java:239) > s3g_1 | at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > s3g_1 | at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > s3g_1 | at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > s3g_1 | at java.base/java.lang.reflect.Method.invoke(Method.java:566) > s3g_1 | at > org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) > s3g_1 | at > org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) > s3g_1 | at > org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) > s3g_1 | at > org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176) > s3g_1 | at > org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) > s3g_1 | at > org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475) > s3g_1 | at > org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397) > s3g_1 | at > org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) > s3g_1 | at > org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255) > s3g_1 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) > s3g_1 | at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) > s3g_1 | at > org.glassfish.jersey.internal.Errors.process(Errors.java:292) > s3g_1 | at > org.glassfish.jersey.internal.Errors.process(Errors.java:274) > s3g_1 | at > org.glassfish.jersey.internal.Errors.process(Errors.java:244) > s3g_1 | at > org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) > s3g_1 | at > org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234) > s3g_1 | at > org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680) > s3g_1 | at > org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394) > s3g_1 | at > org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346) > s3g_1 | at > org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366) > s3g_1 | at > org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319) > s3g_1 | at > org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626) > s3g_1 | at > org.apache.hadoop.ozone.s3.RootPageDisplayFilter.doFilter(RootPageDisplayFilter.java:53) > s3g_1 | at > org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) > s3g_1 | at > org.apache.hadoop.ozone.s3.EmptyContentTypeFilter.doFilter(EmptyContentTypeFilter.java:76) > s3g_1 | at > org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) > s3g_1 | at > org.apache.hadoop.hdds.server.http.HttpServer2$QuotingInputFilter.doFilter(HttpServer2.java:1678) > s3g_1 | at > org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) > s3g_1 | at > org.apache.hadoop.hdds.server.http.NoCacheFilter.doFilter(NoCacheFilter.java:48) > s3g_1 | at > org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548) > s3g_1 | at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) > s3g_1 | at > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:602) > s3g_1 | at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > s3g_1 | at > org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) > s3g_1 | at > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) > s3g_1 | at > org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) > s3g_1 | at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) > s3g_1 | at > org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) > s3g_1 | at > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) > s3g_1 | at > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) > s3g_1 | at > org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) > s3g_1 | at > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) > s3g_1 | at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) > s3g_1 | at > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146) > s3g_1 | at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > s3g_1 | at org.eclipse.jetty.server.Server.handle(Server.java:516) > s3g_1 | at > org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) > s3g_1 | at > org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) > s3g_1 | at > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) > s3g_1 | at > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) > s3g_1 | at > org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) > s3g_1 | at > org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) > s3g_1 | at > org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) > s3g_1 | at > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) > s3g_1 | at > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) > s3g_1 | at > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) > s3g_1 | at > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) > s3g_1 | at > org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386) > s3g_1 | at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) > s3g_1 | at > org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) > s3g_1 | at java.base/java.lang.Thread.run(Thread.java:834) > {noformat} -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org