igniterealtime / openfire-restAPI-plugin

Allows Openfire administration over a RESTful API.
http://www.igniterealtime.org/projects/openfire/plugin-archive.jsp?plugin=restAPI
Apache License 2.0
19 stars 53 forks source link

getChatRooms returns 500 #19

Closed mikee805 closed 5 years ago

mikee805 commented 5 years ago

Hi,

I am trying to use the rest api to get a list of the chatrooms on the Openfire sever.

curl -X GET -H 'Authorization: ${auth}' -i 'http://${hostname}:9090/plugins/restapi/v1/chatrooms' which returns: HTTP/1.1 500 Internal Server Error Date: Fri, 08 Mar 2019 08:30:27 GMT X-Frame-Options: same Content-Length: 0 I have debug logging on but this is all I see in the logs: 2019.03.08 08:30:27 INFO [Jetty-QTP-AdminConsole-11024]: org.jivesoftware.openfire.plugin.rest.controller.MUCRoomController - getChatRooms

Are there any further steps I can take to diagnose this issue?

Thanks, Mike

guusdk commented 5 years ago

I can't immediately reproduce this on my local host. I'm using an old Postman instance to fire off the query. It allows me to export a cURL equivalent of the query that I'm doing, which is that:

curl -X GET \
  http://localhost:9090/plugins/restapi/v1/chatrooms \
  -H 'authorization: mQSjlyLJxXta0Hvh' \
  -H 'cache-control: no-cache' \
  -H 'postman-token: 1e5093cc-91a1-f5a4-15d5-7302806899d9'

It is unlikely that the postman-token header has any effect.

This query gives me an XML representation of the one chat-room that I created for the purpose of testing.

I was using version 1.3.8 of the plugin, on the current MASTER of the Openfire repository (4.4.0-Alpha)

My guess is that the state of one of more of your chatrooms causes the problem. It'll be hard to determine what that is, without further information. If you are (or know) a Java developer, you might want to try hooking on a debugger, to investigate further.

mikee805 commented 5 years ago

Ok thanks for the prompt reply. Remote debugging a cloud instance sounds like a challenge :) Are there any changes in 1.3.8 vs 1.3.7 that might help? looking at https://github.com/igniterealtime/openfire-restAPI-plugin/commits/master I do not even see 1.3.7

guusdk commented 5 years ago

I can't think of anything. I fear that debugging is the only way to go.

IMG-20190308-WA0005

mikee805 commented 5 years ago

Looks like it was a bad chatroom I had to delete all my rooms then the problem was fixed fortunately this was a pre-production instance.