Return-Path: X-Original-To: apmail-atlas-dev-archive@minotaur.apache.org Delivered-To: apmail-atlas-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D669718E5F for ; Wed, 10 Feb 2016 08:20:22 +0000 (UTC) Received: (qmail 39814 invoked by uid 500); 10 Feb 2016 08:20:22 -0000 Delivered-To: apmail-atlas-dev-archive@atlas.apache.org Received: (qmail 39768 invoked by uid 500); 10 Feb 2016 08:20:22 -0000 Mailing-List: contact dev-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list dev@atlas.incubator.apache.org Received: (qmail 39757 invoked by uid 99); 10 Feb 2016 08:20:22 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2016 08:20:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 55DF8C0DF0 for ; Wed, 10 Feb 2016 08:20:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.262 X-Spam-Level: X-Spam-Status: No, score=-4.262 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.242] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id V2tNnyn5eBcE for ; Wed, 10 Feb 2016 08:20:20 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 2142C20BFB for ; Wed, 10 Feb 2016 08:20:18 +0000 (UTC) Received: (qmail 39619 invoked by uid 99); 10 Feb 2016 08:20:18 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2016 08:20:18 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2F7CE2C14F4 for ; Wed, 10 Feb 2016 08:20:18 +0000 (UTC) Date: Wed, 10 Feb 2016 08:20:18 +0000 (UTC) From: "Ayub Khan (JIRA)" To: dev@atlas.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (ATLAS-477) Entity update API: Inconsistent error message for data validation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Ayub Khan created ATLAS-477: ------------------------------- Summary: Entity update API: Inconsistent error message for dat= a validation Key: ATLAS-477 URL: https://issues.apache.org/jira/browse/ATLAS-477 Project: Atlas Issue Type: Bug Affects Versions: 0.6-incubating Reporter: Ayub Khan Priority: Minor Entity update API: Inconsistent error message for data validation 1. Error message while updating an biginteger datatype with string value us= ing below API results in "For input string: \"str\"" For example: {noformat} POST http://localhost:21000/api/atlas/entities/qualifiedName?user.name=3Dap= athan&type=3DEntityUpdateTestr4vbq4nl1z&property=3Dname&value=3DupdateEntit= iesp2rlox1iij { "jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Refe= rence", "id":{ "jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Id= ", "id":"-1455091094792332000", "version":0, "typeName":"EntityUpdateTestr4vbq4nl1z" }, "typeName":"EntityUpdateTestr4vbq4nl1z", "values":{ "set":[ "setValue1", "setValue2" ], "collection":[ "collectionValue1", "collectionValue2" ], "name":"updateEntitiesp2rlox1iij", "biginteger":"str" }, "traitNames":[ =20 ], "traits":{ =20 } } {noformat} Response body with stack trace {noformat} { "error": "For input string: \"str\"", "stackTrace": "java.lang.NumberFormatException: For input string: \"str\"= \n\tat java.lang.NumberFormatException.forInputString(NumberFormatException= .java:65)\n\tat java.lang.Integer.parseInt(Integer.java:492)\n\tat java.mat= h.BigInteger.(BigInteger.java:338)\n\tat java.math.BigInteger.(= BigInteger.java:476)\n\tat org.apache.atlas.typesystem.types.DataTypes$BigI= ntegerType.convert(DataTypes.java:368)\n\tat org.apache.atlas.typesystem.ty= pes.DataTypes$BigIntegerType.convert(DataTypes.java:349)\n\tat org.apache.a= tlas.typesystem.persistence.StructInstance.set(StructInstance.java:122)\n\t= at org.apache.atlas.services.DefaultMetadataService.convertToTypedInstance(= DefaultMetadataService.java:480)\n\tat org.apache.atlas.services.DefaultMet= adataService.updateEntityByUniqueAttribute(DefaultMetadataService.java:504)= \n\tat org.apache.atlas.web.resources.EntityResource.updateByUniqueAttribut= e(EntityResource.java:208)\n\tat sun.reflect.NativeMethodAccessorImpl.invok= e0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeM= ethodAccessorImpl.java:57)\n\tat sun.reflect.DelegatingMethodAccessorImpl.i= nvoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.= invoke(Method.java:606)\n\tat com.sun.jersey.spi.container.JavaMethodInvoke= rFactory$1.invoke(JavaMethodInvokerFactory.java:60)\n\tat com.sun.jersey.se= rver.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$Resp= onseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)\n= \tat com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDis= patcher.dispatch(ResourceJavaMethodDispatcher.java:75)\n\tat com.sun.jersey= .server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)\n\tat= com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPat= hRule.java:147)\n\tat com.sun.jersey.server.impl.uri.rules.ResourceClassRul= e.accept(ResourceClassRule.java:108)\n\tat com.sun.jersey.server.impl.uri.r= ules.RightHandPathRule.accept(RightHandPathRule.java:147)\n\tat com.sun.jer= sey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClasse= sRule.java:84)\n\tat com.sun.jersey.server.impl.application.WebApplicationI= mpl._handleRequest(WebApplicationImpl.java:1542)\n\tat com.sun.jersey.serve= r.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.jav= a:1473)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.han= dleRequest(WebApplicationImpl.java:1419)\n\tat com.sun.jersey.server.impl.a= pplication.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)\n= \tat com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent= .java:409)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.serv= ice(ServletContainer.java:558)\n\tat com.sun.jersey.spi.container.servlet.S= ervletContainer.service(ServletContainer.java:733)\n\tat javax.servlet.http= .HttpServlet.service(HttpServlet.java:790)\n\tat com.google.inject.servlet.= ServletDefinition.doServiceImpl(ServletDefinition.java:287)\n\tat com.googl= e.inject.servlet.ServletDefinition.doService(ServletDefinition.java:277)\n\= tat com.google.inject.servlet.ServletDefinition.service(ServletDefinition.j= ava:182)\n\tat com.google.inject.servlet.ManagedServletPipeline.service(Man= agedServletPipeline.java:91)\n\tat com.google.inject.servlet.FilterChainInv= ocation.doFilter(FilterChainInvocation.java:85)\n\tat org.apache.atlas.web.= filters.AuditFilter.doFilter(AuditFilter.java:67)\n\tat com.google.inject.s= ervlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)\n\tat = com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipel= ine.java:119)\n\tat com.google.inject.servlet.GuiceFilter$1.call(GuiceFilte= r.java:133)\n\tat com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.= java:130)\n\tat com.google.inject.servlet.GuiceFilter$Context.call(GuiceFil= ter.java:203)\n\tat com.google.inject.servlet.GuiceFilter.doFilter(GuiceFil= ter.java:130)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.do= Filter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.ServletHan= dler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.server.handl= er.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.sec= urity.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.eclipse.je= tty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat o= rg.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java= :1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandle= r.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(S= essionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandl= er.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.server.handler= .ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.jetty.serve= r.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org.eclipse.j= etty.server.Server.handle(Server.java:499)\n\tat org.eclipse.jetty.server.H= ttpChannel.handle(HttpChannel.java:310)\n\tat org.eclipse.jetty.server.Http= Connection.onFillable(HttpConnection.java:257)\n\tat org.eclipse.jetty.io.A= bstractConnection$2.run(AbstractConnection.java:540)\n\tat org.eclipse.jett= y.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\n\tat org.= eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)= \n\tat java.lang.Thread.run(Thread.java:745)\n" } {noformat} 2. Error message while updating an biginteger datatype with string value us= ing below API results in "Cannot convert value 'str' to datatype biginteger= " {noformat} POST: http://localhost:21000/api/atlas/entities/625a3df1-efed-408b-bc94-ebd= a3759855e?user.name=3Dapathan&property=3Dbiginteger POSTDATA: "str" {noformat} Response body with stack trace {noformat} { "error": "Cannot convert value 'str' to datatype biginteger", "stackTrace": "org.apache.atlas.typesystem.types.ValueConversionException= : Cannot convert value 'str' to datatype biginteger\n\tat org.apache.atlas.= typesystem.types.DataTypes$BigIntegerType.convert(DataTypes.java:370)\n\tat= org.apache.atlas.typesystem.types.DataTypes$BigIntegerType.convert(DataTyp= es.java:349)\n\tat org.apache.atlas.typesystem.persistence.StructInstance.s= et(StructInstance.java:122)\n\tat org.apache.atlas.services.DefaultMetadata= Service.updateEntityAttributeByGuid(DefaultMetadataService.java:415)\n\tat = org.apache.atlas.web.resources.EntityResource.updateEntityAttributeByGuid(E= ntityResource.java:295)\n\tat org.apache.atlas.web.resources.EntityResource= .updateEntityByGuid(EntityResource.java:250)\n\tat sun.reflect.GeneratedMet= hodAccessor31.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAcce= ssorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.refle= ct.Method.invoke(Method.java:606)\n\tat com.sun.jersey.spi.container.JavaMe= thodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\n\tat com.sun= .jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchPro= vider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.j= ava:205)\n\tat com.sun.jersey.server.impl.model.method.dispatch.ResourceJav= aMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)\n\tat com.= sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:= 302)\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(Ri= ghtHandPathRule.java:147)\n\tat com.sun.jersey.server.impl.uri.rules.Resour= ceClassRule.accept(ResourceClassRule.java:108)\n\tat com.sun.jersey.server.= impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n\tat c= om.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootReso= urceClassesRule.java:84)\n\tat com.sun.jersey.server.impl.application.WebAp= plicationImpl._handleRequest(WebApplicationImpl.java:1542)\n\tat com.sun.je= rsey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicati= onImpl.java:1473)\n\tat com.sun.jersey.server.impl.application.WebApplicati= onImpl.handleRequest(WebApplicationImpl.java:1419)\n\tat com.sun.jersey.ser= ver.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.ja= va:1409)\n\tat com.sun.jersey.spi.container.servlet.WebComponent.service(We= bComponent.java:409)\n\tat com.sun.jersey.spi.container.servlet.ServletCont= ainer.service(ServletContainer.java:558)\n\tat com.sun.jersey.spi.container= .servlet.ServletContainer.service(ServletContainer.java:733)\n\tat javax.se= rvlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat com.google.injec= t.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:287)\n\tat= com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.ja= va:277)\n\tat com.google.inject.servlet.ServletDefinition.service(ServletDe= finition.java:182)\n\tat com.google.inject.servlet.ManagedServletPipeline.s= ervice(ManagedServletPipeline.java:91)\n\tat com.google.inject.servlet.Filt= erChainInvocation.doFilter(FilterChainInvocation.java:85)\n\tat org.apache.= atlas.web.filters.AuditFilter.doFilter(AuditFilter.java:67)\n\tat com.googl= e.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:= 82)\n\tat com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedF= ilterPipeline.java:119)\n\tat com.google.inject.servlet.GuiceFilter$1.call(= GuiceFilter.java:133)\n\tat com.google.inject.servlet.GuiceFilter$1.call(Gu= iceFilter.java:130)\n\tat com.google.inject.servlet.GuiceFilter$Context.cal= l(GuiceFilter.java:203)\n\tat com.google.inject.servlet.GuiceFilter.doFilte= r(GuiceFilter.java:130)\n\tat org.eclipse.jetty.servlet.ServletHandler$Cach= edChain.doFilter(ServletHandler.java:1652)\n\tat org.eclipse.jetty.servlet.= ServletHandler.doHandle(ServletHandler.java:585)\n\tat org.eclipse.jetty.se= rver.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse= .jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat org.= eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:22= 3)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHa= ndler.java:1127)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(Ser= vletHandler.java:515)\n\tat org.eclipse.jetty.server.session.SessionHandler= .doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.Co= ntextHandler.doScope(ContextHandler.java:1061)\n\tat org.eclipse.jetty.serv= er.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.eclipse.j= etty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat org= .eclipse.jetty.server.Server.handle(Server.java:499)\n\tat org.eclipse.jett= y.server.HttpChannel.handle(HttpChannel.java:310)\n\tat org.eclipse.jetty.s= erver.HttpConnection.onFillable(HttpConnection.java:257)\n\tat org.eclipse.= jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat org.ec= lipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\= n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool= .java:555)\n\tat java.lang.Thread.run(Thread.java:745)\nCaused by: java.lan= g.NumberFormatException: For input string: \"str\"\n\tat java.lang.NumberFo= rmatException.forInputString(NumberFormatException.java:65)\n\tat java.lang= .Integer.parseInt(Integer.java:492)\n\tat java.math.BigInteger.(BigIn= teger.java:338)\n\tat java.math.BigInteger.(BigInteger.java:476)\n\ta= t org.apache.atlas.typesystem.types.DataTypes$BigIntegerType.convert(DataTy= pes.java:368)\n\t... 54 more\n" } {noformat} Both the API's are trying to update an attribute value with an incompatible= datatype, which results in two different error messages. Ideally the error= message should be consistent across. The above inconsistency is observed with other types like bigdecimal. -- This message was sent by Atlassian JIRA (v6.3.4#6332)