Discussion:
[apollo] Apollo 2.0.4 API call not working
Chris Childers
2016-08-25 21:42:08 UTC
Permalink
Hi all,

I was trying to make use of the A2 APIs, and while some work, others fail
with errors. Below is an example for the getOrganismPermissionsForUser.
Some of the other APIs are behaving similarly. Have other folks encountered
this behavior with this API?


curl -i -X POST -H 'Content-Type: application/json' -d '{"username":
"admin-***@none.none", "password": "secret", "userId": "1156181"}'
https://apollo-dev.server.no/apollo/user/getOrganismPermissionsForUser
HTTP/1.1 500 Internal Server Error
Server: nginx/1.10.1
Date: Thu, 25 Aug 2016 15:36:54 GMT
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Language: en-US


Thanks,
Chris
Nathan Dunn
2016-08-25 21:53:00 UTC
Permalink
Chris,

You are getting a 500 error. What is the tomcat stack-trace being produced (if there is one) as a result of this command?

Nathan Dunn, PhD
Berkeley Bioinformatics Open-source Projects (BBOP)
Genomics Division, Lawrence Berkeley National Laboratory
Post by Chris Childers
Hi all,
I was trying to make use of the A2 APIs, and while some work, others fail with errors. Below is an example for the getOrganismPermissionsForUser. Some of the other APIs are behaving similarly. Have other folks encountered this behavior with this API?
HTTP/1.1 500 Internal Server Error
Server: nginx/1.10.1
Date: Thu, 25 Aug 2016 15:36:54 GMT
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Language: en-US
Thanks,
Chris
This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
Chris Childers
2016-08-29 16:03:11 UTC
Permalink
Thanks for the followup, here is what was in the logs:



2016-08-29 12:02:15,905 [http-nio-8080-exec-7] ERROR
errors.GrailsExceptionResolver - NullPointerException occurred when
processing request: [POST] /apollo/user/getOrganismPermissionsForUser
Stacktrace follows:
java.lang.NullPointerException
at grails.converters.JSON.parse(JSON.java:302)
at
org.bbop.apollo.UserController.getOrganismPermissionsForUser(UserController.groovy:424)
at
grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at
grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
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
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Post by Nathan Dunn
Chris,
You are getting a 500 error. What is the tomcat stack-trace being
produced (if there is one) as a result of this command?
Nathan Dunn, PhD
Berkeley Bioinformatics Open-source Projects (BBOP)
Genomics Division, Lawrence Berkeley National Laboratory
Hi all,
I was trying to make use of the A2 APIs, and while some work, others fail
with errors. Below is an example for the getOrganismPermissionsForUser.
Some of the other APIs are behaving similarly. Have other folks encountered
this behavior with this API?
curl -i -X POST -H 'Content-Type: application/json' -d '{"username": "
https://apollo-dev.server.no/apollo/user/getOrganismPermissionsForUser
HTTP/1.1 500 Internal Server Error
Server: nginx/1.10.1
Date: Thu, 25 Aug 2016 15:36:54 GMT
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Language: en-US
Thanks,
Chris
This list is for the Apollo Annotation Editing Tool. Info at
http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with
2. In the subject line of your email type: unsubscribe apollo | 3. Leave
the message body blank.
This list is for the Apollo Annotation Editing Tool. Info at
http://genomearchitect.org/
If you wish to unsubscribe from the Apollo List: 1. From the address with
2. In the subject line of your email type: unsubscribe apollo | 3. Leave
the message body blank.
Nathan Dunn
2016-08-29 16:24:20 UTC
Permalink
Looks like you identified a bug:

https://github.com/GMOD/Apollo/issues/1230 <https://github.com/GMOD/Apollo/issues/1230>

Here is the fix for it:

https://github.com/nathandunn/Apollo/commit/5a0e215a5a4d6f9e808072693eb73d80745e4f7d <https://github.com/nathandunn/Apollo/commit/5a0e215a5a4d6f9e808072693eb73d80745e4f7d>


Conversely, you could get around it by enveloping the word “data” (though it would be good to get the PR in . . . it will work either way):

curl -i -X POST -H 'Content-Type: application/json' -d ‘{"data”:{"username": "admin-***@none.none <mailto:admin-***@none.none>", "password": "secret", "userId": “1156181"}}' https://apollo-dev.server.no/apollo/user/getOrganismPermissionsForUser <https://apollo-dev.server.no/apollo/user/getOrganismPermissionsForUser>
Nathan Dunn, PhD
Berkeley Bioinformatics Open-source Projects (BBOP)
Genomics Division, Lawrence Berkeley National Laboratory
2016-08-29 12:02:15,905 [http-nio-8080-exec-7] ERROR errors.GrailsExceptionResolver - NullPointerException occurred when processing request: [POST] /apollo/user/getOrganismPermissionsForUser
java.lang.NullPointerException
at grails.converters.JSON.parse(JSON.java:302)
at org.bbop.apollo.UserController.getOrganismPermissionsForUser(UserController.groovy:424)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
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 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Chris,
You are getting a 500 error. What is the tomcat stack-trace being produced (if there is one) as a result of this command?
Nathan Dunn, PhD
Berkeley Bioinformatics Open-source Projects (BBOP)
Genomics Division, Lawrence Berkeley National Laboratory
Post by Chris Childers
Hi all,
I was trying to make use of the A2 APIs, and while some work, others fail with errors. Below is an example for the getOrganismPermissionsForUser. Some of the other APIs are behaving similarly. Have other folks encountered this behavior with this API?
HTTP/1.1 500 Internal Server Error
Server: nginx/1.10.1
Date: Thu, 25 Aug 2016 15:36:54 GMT
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Content-Language: en-US
Thanks,
Chris
This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/ <http://genomearchitect.org/>
This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/ <http://genomearchitect.org/>
This list is for the Apollo Annotation Editing Tool. Info at http://genomearchitect.org/
Loading...