0

I use Ion to get Json from server

Ion.with(getActivity()).load(url).setLogging(getClass().getSimpleName(),Log.VERBOSE).asJsonObject().setCallback(this);

If i use wifi i can get JSON correctly. I can't get JSON, if i switch to GPRS (HSDPA). The error message is unable to parse Json. WIFI and HSDPA use different internet service provider.

The logcat shows there is internal server error. But, what make me confuse is, the request never reach my server. Meaning the proxy in telecommunication provider block the request and give HTTP 500 error

02-24 22:36:33.171: (0 ms) http://www.detik.com: preparing request
02-24 22:36:33.211: (0 ms) http://www.detik.com: Executing request.
02-24 22:36:33.651: (449 ms) http://www.detik.com: Connecting socket
02-24 22:36:33.651: (449 ms) http://www.detik.com: Using proxy: 202.152.240.50:8080
02-24 22:36:33.701: (500 ms) http://www.detik.com: socket connected
02-24 22:36:33.711: (507 ms) http://www.detik.com: 
02-24 22:36:33.711: GET / HTTP/1.1
02-24 22:36:33.711: Host: www.detik.com
02-24 22:36:33.711: User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.3; C5302 Build/12.1.A.1.207)
02-24 22:36:33.711: Accept-Encoding: gzip, deflate
02-24 22:36:33.711: Connection: keep-alive
02-24 22:36:33.711: Accept: */*
02-24 22:36:33.711: 
02-24 22:36:33.711: (508 ms) http://www.detik.com: request completed
02-24 22:36:33.812: (600 ms) http://www.detik.com: Received headers:
02-24 22:36:33.812: HTTP/1.1 500 Internal Server Error
02-24 22:36:33.812: Cache-Control: no-cache
02-24 22:36:33.812: Pragma: no-cache
02-24 22:36:33.812: Content-Type: text/html; charset=utf-8
02-24 22:36:33.812: X-Cnection: close
02-24 22:36:33.812: Content-Length: 685
02-24 22:36:33.812: 
02-24 22:36:33.812: (606 ms) http://www.detik.com: Response is not cacheable
02-24 22:36:33.812: (607 ms) http://www.detik.com: Final (post cache resp02-24 22:36:33.822: D/(15396): <HTML><HEAD>
02-24 22:36:33.822: D/(15396): <TITLE>Appliance Error</TITLE>
02-24 22:36:33.822: D/(15396): </HEAD>
02-24 22:36:33.822: D/(15396): <BODY>
02-24 22:36:33.822: D/(15396): <FONT face="Helvetica">
02-24 22:36:33.822: D/(15396): <big><strong></strong></big><BR>
02-24 22:36:33.822: D/(15396): </FONT>
02-24 22:36:33.822: D/(15396): <blockquote>
02-24 22:36:33.822: D/(15396): <TABLE border=0 cellPadding=1 width="80%">
02-24 22:36:33.822: D/(15396): <TR><TD>
02-24 22:36:33.822: D/(15396): <FONT face="Helvetica">
02-24 22:36:33.822: D/(15396): <big>Appliance Error (internal_error)</big>
02-24 22:36:33.822: D/(15396): <BR>
02-24 22:36:33.822: D/(15396): <BR>
02-24 22:36:33.822: D/(15396): </FONT>
02-24 22:36:33.822: D/(15396): </TD></TR>
02-24 22:36:33.822: D/(15396): <TR><TD>
02-24 22:36:33.822: D/(15396): <FONT face="Helvetica">
02-24 22:36:33.822: D/(15396): An unrecoverable error was encountered: ""
02-24 22:36:33.822: D/(15396): </FONT>
02-24 22:36:33.822: D/(15396): </TD></TR>
02-24 22:36:33.822: D/(15396): <TR><TD>
02-24 22:36:33.822: D/(15396): <FONT face="Helvetica">
02-24 22:36:33.822: D/(15396): This problem is unexpected. Please use the contact information below to obtain assistance.
02-24 22:36:33.822: D/(15396): </FONT>
02-24 22:36:33.822: D/(15396): </TD></TR>
02-24 22:36:33.822: D/(15396): <TR><TD>
02-24 22:36:33.822: D/(15396): <FONT face="Helvetica" SIZE=2>
02-24 22:36:33.822: D/(15396): <BR>
02-24 22:36:33.822: D/(15396): For assistance, contact your network support team.
02-24 22:36:33.822: D/(15396): </FONT>
02-24 22:36:33.822: D/(15396): </TD></TR>
02-24 22:36:33.822: D/(15396): </TABLE>
02-24 22:36:33.822: D/(15396): </blockquote>
02-24 22:36:33.822: D/(15396): </FONT>
02-24 22:36:33.822: D/(15396): </BODY></HTML>
Plugie
  • 1,289
  • 17
  • 25
  • What version of ion and who is the carrier for your phone? Ion transparently uses network proxies. There was a bug in proxy handling that was fixed a couple months ago: https://github.com/koush/AndroidAsync/commit/cd3f26489d57a2d413971c0c2906842f90a5e1d2 If this is still occurring on the latest version of ion, let me know. – koush Feb 24 '15 at 23:01
  • I use "compile 'com.koushikdutta.ion:ion:2.+'" in my gradle file. The carrier is XL Axiata in Indonesia. I use plain HTTP without SSL instead of HTTPS. I can help you if we need to try and debug the issue – Plugie Feb 25 '15 at 03:33
  • Can you include more of the log? There should be a lot more info leading up to the error. – koush Feb 25 '15 at 08:35
  • I edit the question to add more log – Plugie Feb 25 '15 at 11:04
  • Your carrier has a proxy which seems to be choking for some reason. I can add a setting to disable the autoproxy in the ion http client I guess. But this actually just seems to be a legitimate network issue. – koush Feb 26 '15 at 06:13

0 Answers0