curl -X POST "http://localhost/udwc/brikoleur/token" -d '{ "grant_type" : "password", "username" : "abogdanov", "password" : "thepassword" }'
{"access_token":"YWMtpgdKYDbyEeaD2zHg-adLzwAAAVWSPvYGkxL-sP9RrdRTbAGgQJijcOXcApE","expires_in":604800,"user":{"uuid":"2349d142-317a-11e6-9322-080027cf389a","type":"user","name":"Alexander Bogdanov","created":1465831132919,"modified":1465841524921,"username":"abogdanov","email":"[email protected]","activated":true,"picture":"http://www.gravatar.com/avatar/fd1ebc06694e703c1b0c64215890a865","metadata":{"size":608},"repeatPassword":"thepassword"}}
curl --header "Authorization: Bearer YWMtpgdKYDbyEeaD2zHg-adLzwAAAVWSPvYGkxL-sP9RrdRTbAGgQJijcOXcApE" "http://localhost/udwc/brikoleur/users/abogdanov/owns/things/ferrari"
{"error":"uncaught","timestamp":1466432732273,"duration":0,"error_description":"Internal Server Error","exception":"org.apache.usergrid.rest.exceptions.UncaughtException","error_id":"d87217ed-36f2-11e6-b273-080027cf389a"}
BR, Petteri On 20/06/16 16:28, Petteri Sulonen wrote:
(1) Ubuntu 16.04 (64 bit, server), Tomcat 7.0.68, Cassandra 2.2.6, Elasticsearch 1.4.4. (2) Here are the curls, with responses. Note that I've set up rights as described in my original mail. I've also put Usergride behind Apache so it listens at port 80.root@vmu-psulonen2:~# curl -X POST "http://localhost/udwc/brikoleur/token <http://localhost/udwc/brikoleur/token>" -d '{ "grant_type" : "password", "username" : "abogdanov", "password" : "thepassword" }' {"access_token":"YWMtpgdKYDbyEeaD2zHg-adLzwAAAVWSPvYGkxL-sP9RrdRTbAGgQJijcOXcApE","expires_in":604800,"user":{"uuid":"2349d142-317a-11e6-9322-080027cf389a","type":"user","name":"Alexander Bogdanov","created":1465831132919,"modified":1465841524921,"username":"abogdanov","email":"[email protected] <mailto:[email protected]>","activated":true,"picture":"http://www.gravatar.com/avatar/fd1ebc06694e703c1b0c64215890a865 <http://www.gravatar.com/avatar/fd1ebc06694e703c1b0c64215890a865>","metadata":{"size":608},"repeatPassword":"thepassword"}}root@vmu-psulonen2:~# root@vmu-psulonen2:~# curl --header "Authorization: Bearer YWMtpgdKYDbyEeaD2zHg-adLzwAAAVWSPvYGkxL-sP9RrdRTbAGgQJijcOXcApE" "http://localhost/udwc/brikoleur/users/abogdanov/owns/things/ferrari <http://localhost/udwc/brikoleur/users/abogdanov/owns/things/ferrari>" {"error":"uncaught","timestamp":1466432732273,"duration":0,"error_description":"Internal Server Error","exception":"org.apache.usergrid.rest.exceptions.UncaughtException","error_id":"d87217ed-36f2-11e6-b273-080027cf389a"}root@vmu-psulonen2:~#BR, Petteri On 20/06/16 15:36, Dave wrote:Thanks Petteri.I can see that this is caused by a null pointer exception after a query is executed, inside Usergrid -- but it is not clear what is going on. I should have asked for a couple of other pieces of information. This info would be helpful:* What versions of operating system, Tomcat, Cassandra, ElasticSearch, Usergrid are you using?And this would be very very helpful:* Provide a curl command (or series of commands) that can reproduce the errorThanks, DaveOn Fri, Jun 17, 2016 at 1:40 AM Petteri Sulonen <[email protected] <mailto:[email protected]>> wrote:Hi -- Here's a dump of what's in catalina.out for the problem request. /Petteri 04:44:47,649 INFO DB:536 - getColumns returned 9 columns 04:44:47,651 INFO DB:536 - getColumns returned 9 columns04:44:47,653 INFO UsersResource:98 - ServiceResource.addNameParameter04:44:47,655 INFO UsersResource:100 - Current segment is me 04:44:47,669 INFO DB:536 - getColumns returned 9 columns 04:44:47,673 INFO DB:388 - getColumns cf=Entity_Dictionaries key=b8f8f336-30c9-3553-b447-6891f3e1e6bf:permissions 04:44:47,675 INFO DB:404 - getColumns returned 2 columns 04:44:47,678 INFO DB:388 - getColumns cf=Entity_Dictionaries key=2349d142-317a-11e6-9322-080027cf389a:permissions 04:44:47,679 INFO DB:404 - getColumns returned 0 columns 04:44:47,680 INFO DB:388 - getColumns cf=Entity_Dictionaries key=2349d142-317a-11e6-9322-080027cf389a:rolenames 04:44:47,682 INFO DB:404 - getColumns returned 0 columns 04:44:47,691 INFO DB:388 - getColumns cf=Entity_Composite_Dictionaries key=834fdec4-2e11-11e6-b255-080027cf389a:orgconfig 04:44:47,692 INFO DB:404 - getColumns returned 0 columns04:44:47,711 ERROR ThrowableMapper:35 - An uncaught exception occurredduring HTTP invocation java.lang.NullPointerException at org.apache.usergrid.services.AbstractConnectionsService.getItemByName(AbstractConnectionsService.java:243) at org.apache.usergrid.services.AbstractService.invokeItemWithName(AbstractService.java:771) at org.apache.usergrid.services.AbstractService.invoke(AbstractService.java:728) at org.apache.usergrid.services.AbstractService.invoke(AbstractService.java:645) at org.apache.usergrid.services.ServiceRequest.execute(ServiceRequest.java:245) at org.apache.usergrid.services.ServiceRequest.invokeMultiple(ServiceRequest.java:281) at org.apache.usergrid.services.ServiceRequest.execute(ServiceRequest.java:248) at org.apache.usergrid.services.ServiceRequest.execute(ServiceRequest.java:212) at org.apache.usergrid.rest.applications.ServiceResource.executeServiceRequest(ServiceResource.java:315) at org.apache.usergrid.rest.applications.ServiceResource.executeGet(ServiceResource.java:361) at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:927) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.usergrid.rest.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net <http://org.apache.tomcat.util.net>.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 04:44:47,714 ERROR AbstractExceptionMapper:72 - org.apache.usergrid.rest.exceptions.UncaughtException 5XX Uncaught Exception (500) org.apache.usergrid.rest.exceptions.UncaughtException: java.lang.NullPointerException at org.apache.usergrid.rest.exceptions.AbstractExceptionMapper.toResponse(AbstractExceptionMapper.java:59) at org.apache.usergrid.rest.exceptions.ThrowableMapper.toResponse(ThrowableMapper.java:37) at com.sun.jersey.spi.container.ContainerResponse.mapException(ContainerResponse.java:480) at com.sun.jersey.spi.container.ContainerResponse.mapMappableContainerException(ContainerResponse.java:417) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1477) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:927) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875) at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.usergrid.rest.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net <http://org.apache.tomcat.util.net>.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at org.apache.usergrid.services.AbstractConnectionsService.getItemByName(AbstractConnectionsService.java:243) at org.apache.usergrid.services.AbstractService.invokeItemWithName(AbstractService.java:771) at org.apache.usergrid.services.AbstractService.invoke(AbstractService.java:728) at org.apache.usergrid.services.AbstractService.invoke(AbstractService.java:645) at org.apache.usergrid.services.ServiceRequest.execute(ServiceRequest.java:245) at org.apache.usergrid.services.ServiceRequest.invokeMultiple(ServiceRequest.java:281) at org.apache.usergrid.services.ServiceRequest.execute(ServiceRequest.java:248) at org.apache.usergrid.services.ServiceRequest.execute(ServiceRequest.java:212) at org.apache.usergrid.rest.applications.ServiceResource.executeServiceRequest(ServiceResource.java:315) at org.apache.usergrid.rest.applications.ServiceResource.executeGet(ServiceResource.java:361) at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) ... 38 more 04:44:47,717 ERROR AbstractExceptionMapper:106 - Server Error (500): {"error":"uncaught","timestamp":1465872287717,"duration":0,"error_description":"Internal Server Error","exception":"org.apache.usergrid.rest.exceptions.UncaughtException","error_id":"f5752c99-31d9-11e6-b858-080027cf389a"} On 16/06/16 22:43, Dave wrote: > Hi Petteri, > > That's definitely a bug; Usergrid should never return HTTP 500 > internal server error unless Cassandra or ElasticSearch is > inaccessible. Is there a stack trace that goes along with that error? > > Dave > > > On Tue, Jun 14, 2016 at 10:38 AM Petteri Sulonen > <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>> > wrote: > > Hi, everybody -- > > I'm evaluating Usergrid for our cloud services, and am starting to > come > to grips with it. I have a question about error handling. > > I've noticed that the errors Usergrid returns seem somewhat> inconsistent. For example, when attempting to GET an entity that> doesn't > exist directly from the collection (omitting org and app from path for > clarity): > > GET /things/ferrari > > will return an error "entity_not_found", but attempting to GET the > same > entity through a connection where I "own" the entity: > > GET /users/me/owns/things/ferrari > > will return an "uncaught" error, with error_description "Internal > Server > Error." > > Is this intentional? I was expecting to get an "entity_not_found" > error > in both cases, as I think this would be a pretty common situation to > have in a system where entities are created and deleted dynamically. > > (If /things/ferrari actually exists and I own it, both queries > return it > as expected, so that's cool.) > > If I've understood the design intent behind Usergrid correctly, these > connections are extremely important because I can map permissions to > them. Therefore it's not always possible to access objects directly > under the collection, as the user may only have permission to access > objects through a connection (e.g. "owns"). I like this scheme a lot, > it's simple, intuitive, yet powerful. > > If I've misunderstood something, I would greatly appreciate being set > straight. > > Thanks in advance, > > Petteri > >
smime.p7s
Description: S/MIME Cryptographic Signature
