[GH-ISSUE #255] Task crashed error #186

Closed
opened 2026-02-28 01:23:35 +03:00 by kerem · 5 comments
Owner

Originally created by @mikeymckay on GitHub (May 15, 2015).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/255

Originally assigned to: @eyedol on GitHub.

During task checking I am getting the following:

java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column path $

Here's what my server is responding with:

{"payload":{"task":"send","secret":"coconut","messages":[{"to":"+XXXXXXXX","message":"from couch to you homes","uuid":"aeefa9195f734d32b7e0f9d62d327f6d"}]}}

(XXXXX hides my real number)

Any ideas?

Originally created by @mikeymckay on GitHub (May 15, 2015). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/255 Originally assigned to: @eyedol on GitHub. During task checking I am getting the following: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column path $ Here's what my server is responding with: {"payload":{"task":"send","secret":"coconut","messages":[{"to":"+XXXXXXXX","message":"from couch to you homes","uuid":"aeefa9195f734d32b7e0f9d62d327f6d"}]}} (XXXXX hides my real number) Any ideas?
kerem 2026-02-28 01:23:35 +03:00
Author
Owner

@eyedol commented on GitHub (May 15, 2015):

@mikeymckay The sample JSON string looks correct to me and it validates. For some reason a different JSON string gets to the phone when it makes the HTTP GET request. Are you able to debug to see if SMSsync actually receives the above JSON string. Like turn on logs to see if it logs the response. Let me know.

<!-- gh-comment-id:102374224 --> @eyedol commented on GitHub (May 15, 2015): @mikeymckay The sample JSON string looks correct to me and it validates. For some reason a different JSON string gets to the phone when it makes the HTTP GET request. Are you able to debug to see if SMSsync actually receives the above JSON string. Like turn on logs to see if it logs the response. Let me know.
Author
Owner

@mikeymckay commented on GitHub (May 15, 2015):

@eyedol Thanks for the response. Unfortunately, that IllegalStateException is all that is reported in the logs. It would be useful if the logs showed the http requests and responses, but unless there is a secret option for that somewhere... no dice. Not sure how a different string could get to the phone. I guess I can try testing with some different servers. Here's the relevant part of the ruby sinatra code that serves up the response:

get "/smssync" do
  headers "Content-Type" => "application/json; charset=utf8"
  return {
    "payload" => {
      "task" => "send",
      "secret" => "coconut",
      "messages" => messagesToSend
    }
  }.to_json
end
<!-- gh-comment-id:102519303 --> @mikeymckay commented on GitHub (May 15, 2015): @eyedol Thanks for the response. Unfortunately, that IllegalStateException is all that is reported in the logs. It would be useful if the logs showed the http requests and responses, but unless there is a secret option for that somewhere... no dice. Not sure how a different string could get to the phone. I guess I can try testing with some different servers. Here's the relevant part of the ruby sinatra code that serves up the response: ``` ruby get "/smssync" do headers "Content-Type" => "application/json; charset=utf8" return { "payload" => { "task" => "send", "secret" => "coconut", "messages" => messagesToSend } }.to_json end ```
Author
Owner

@eyedol commented on GitHub (May 16, 2015):

@mikeymckay funky. I just wrote a test to see if sample json string you provided will fail but it did pass. I have added the client response to the logs. You can grab a copy of the debug apk from here. Let me know what the response you get from the server.

<!-- gh-comment-id:102566313 --> @eyedol commented on GitHub (May 16, 2015): @mikeymckay funky. I just wrote a test to see if sample json string you provided will fail but it did pass. I have added the client response to the logs. You can grab a copy of the debug apk from [here](http://qa.ushahididev.com/job/SMSsync/ws/smssync/build/outputs/apk/smssync-noAnalytics-debug-unaligned.apk). Let me know what the response you get from the server.
Author
Owner

@mikeymckay commented on GitHub (May 18, 2015):

I tried the debug apk, but the logs on the app are the same. The adb logcat
isn't really helpful either:

http://pastie.org/10195306

I have a server at http://smssync.zmcp.org which has a message queued for
sending hardcoded right now:

http://smssync.zmcp.org/smssync?task=send

Please try it and see if you have the same result as me?

On Fri, May 15, 2015 at 7:47 PM, Henry Addo notifications@github.com
wrote:

@mikeymckay https://github.com/mikeymckay funky. I just wrote a test to
see if sample json string you provided will fail but it did pass. I have
added the client response to the logs. You can grab a copy of the debug apk
from here
http://qa.ushahididev.com/job/SMSsync/ws/smssync/build/outputs/apk/smssync-noAnalytics-debug-unaligned.apk.
Let me know what the response you get from the server.


Reply to this email directly or view it on GitHub
https://github.com/ushahidi/SMSSync/issues/255#issuecomment-102566313.

<!-- gh-comment-id:103177498 --> @mikeymckay commented on GitHub (May 18, 2015): I tried the debug apk, but the logs on the app are the same. The adb logcat isn't really helpful either: http://pastie.org/10195306 I have a server at http://smssync.zmcp.org which has a message queued for sending hardcoded right now: http://smssync.zmcp.org/smssync?task=send Please try it and see if you have the same result as me? On Fri, May 15, 2015 at 7:47 PM, Henry Addo notifications@github.com wrote: > @mikeymckay https://github.com/mikeymckay funky. I just wrote a test to > see if sample json string you provided will fail but it did pass. I have > added the client response to the logs. You can grab a copy of the debug apk > from here > http://qa.ushahididev.com/job/SMSsync/ws/smssync/build/outputs/apk/smssync-noAnalytics-debug-unaligned.apk. > Let me know what the response you get from the server. > > — > Reply to this email directly or view it on GitHub > https://github.com/ushahidi/SMSSync/issues/255#issuecomment-102566313.
Author
Owner

@eyedol commented on GitHub (May 20, 2015):

@mikeymckay Thanks for the link it was helpful. However, I couldn't reproduce the issue on my device( You should get an SMS from a random number). I'm interested in fixing this if it's a unique issue on your device so I have added more logging to get the HTTP response from your device. If you have access to a different Android device, could try to see if the issue shows up on there? Again you can grab a copy of the build from here.

<!-- gh-comment-id:103799708 --> @eyedol commented on GitHub (May 20, 2015): @mikeymckay Thanks for the link it was helpful. However, I couldn't reproduce the issue on my device( You should get an SMS from a random number). I'm interested in fixing this if it's a unique issue on your device so I have added more logging to get the HTTP response from your device. If you have access to a different Android device, could try to see if the issue shows up on there? Again you can grab a copy of the build from [here](http://qa.ushahididev.com/job/SMSsync/ws/smssync/build/outputs/apk/smssync-noAnalytics-debug-unaligned.apk).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#186
No description provided.