Apollo 2.0.4 API call not working

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Apollo 2.0.4 API call not working

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?


curl -i -X POST -H 'Content-Type: application/json' -d '{"username": "[hidden email]", "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




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 which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|

Re: Apollo 2.0.4 API call not working

nathandunn

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
[hidden email]


On Aug 25, 2016, at 2:42 PM, Chris Childers <[hidden email]> wrote:

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": "[hidden email]", "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



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 which you subscribed to the list, send a message to [hidden email] | 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 which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|

Re: Apollo 2.0.4 API call not working

Chris Childers
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)


On Thu, Aug 25, 2016 at 5:53 PM, Nathan Dunn <[hidden email]> wrote:

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
[hidden email]


On Aug 25, 2016, at 2:42 PM, Chris Childers <[hidden email]> wrote:

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": "[hidden email]", "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



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 which you subscribed to the list, send a message to [hidden email] | 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 which you subscribed to the list, send a message to [hidden email] | 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 which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.

Reply | Threaded
Open this post in threaded view
|

Re: Apollo 2.0.4 API call not working

nathandunn

Looks like you identified a bug:


Here is the fix for it:



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": "[hidden email]", "password": "secret", "userId": “1156181"}}' https://apollo-dev.server.no/apollo/user/getOrganismPermissionsForUser

Nathan Dunn, PhD
Berkeley Bioinformatics Open-source Projects (BBOP)
Genomics Division, Lawrence Berkeley National Laboratory
[hidden email]


On Aug 29, 2016, at 9:03 AM, Chris Childers <[hidden email]> wrote:

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)


On Thu, Aug 25, 2016 at 5:53 PM, Nathan Dunn <[hidden email]> wrote:

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
[hidden email]


On Aug 25, 2016, at 2:42 PM, Chris Childers <[hidden email]> wrote:

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": "[hidden email]", "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



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 which you subscribed to the list, send a message to [hidden email] | 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 which you subscribed to the list, send a message to [hidden email] | 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 which you subscribed to the list, send a message to [hidden email] | 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 which you subscribed to the list, send a message to [hidden email] | 2. In the subject line of your email type: unsubscribe apollo | 3. Leave the message body blank.