GroveStreams

Internal Server Error 500433

johnsinha private msg quote post Address this user
I keep getting 500:Internal Server Error with the URI bellow. Has anyone got an idea what is wrong? API key and mac address have been altered for this post


http://grovestreams.com/api/feed?compId=VOC-monitor&temperature=22&humidity=23&api_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Header

Content-Type: application/json
X-Forwarded-For: 0x:0x:0x:0x:0x:0x

Response header

Date: Fri, 27 Jan 2017 15:39:39 GMT
Server: Apache
Accept-Ranges: bytes
Vary: Accept-Charset,Accept-Encoding,Accept-Language,Accept
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS
Access-Control-Allow-Headers: accept, origin, x-requested-with, content-type
Access-Control-Max-Age: 86400
Content-Length: 112
Access-Control-Allow-Credentials: true
Connection: close
Content-Type: application/json;charset=UTF-8

Response body

{
"message": "A JSONObject text must begin with '{' at character 8",
"errCode": "UNKNOWN_EXCEPTION",
"success": false
}
Post 1 • IP   flag post
MikeMills private msg quote post Address this user
Is there an Organization System notification with more details? Click the envelope in your organization toolbar. Posting the stack trace would help.

Click on Admin - API keys and engage API tracing to see exactly what is being passed up. The JSON error is a clue.
Post 2 • IP   flag post
johnsinha private msg quote post Address this user
Here is the API trace. I've altered the mac address

API Exception Details:
Resource Path:
/api/feed
Resource Method: PUT
Client Address:
82.35.241.83
Client Attributes:
{org.restlet.http.version=1.1, org.restlet.http.headers=[[host: grovestreams.com], [content-type: application/json], [x-forwarded-for: 12:AAA:FF:44C], [content-length: 8]], org.restlet.startTime=1485776348024}

Exception:

A JSONObject text must begin with '{' at character 8

Call Stack:
org.json.JSONTokener.syntaxError(JSONTokener.java:413)
org.json.JSONObject.(JSONObject.java:180)
org.json.JSONObject.(JSONObject.java:420)
com.-gs-.-lab-.converters.UFeedConverter.fromJson(UFeedConverter.java:299)
com.-gs-.-lab-client.client.FeedResource.doPutJson(FeedResource.java:355)
sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)



You are allowed one API exception notification per hour per authenticated session. This was the latest exception for this hour.
Post 3 • IP   flag post
MikeMills private msg quote post Address this user
I was hoping the notification would contain the HTTP Body, but it did not.

Here's what I think is happening: You're using the GS "All on the URL" Feed API. This requires that the HTTP body be empty. It appears your HTTP body has something in it since you're getting this error when the GS server tries to parse the body as JSON text: A JSONObject text must begin with '{' at character 8

Given that error, it appears the body is not JSON either.

Try to not pass up anything in the body.
Post 4 • IP   flag post
2572 4 4
Log in or sign up to compose a reply.
destitute