lantern icon indicating copy to clipboard operation
lantern copied to clipboard

[lantern] Error connecting to and reading from statshub

Open oxtoacart opened this issue 12 years ago • 16 comments

 Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN [StatsManager-Get-0] lantern.JsonUtils.decode (JsonUtils.java:84) - Error decoding JSON
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN java.net.SocketTimeoutException: Read timed out
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at java.net.SocketInputStream.socketRead0(Native Method)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at java.net.SocketInputStream.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at java.net.SocketInputStream.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.security.ssl.InputRecord.readFully(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.security.ssl.InputRecord.readV3Record(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.security.ssl.InputRecord.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.security.ssl.AppInputStream.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at java.io.BufferedInputStream.fill(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at java.io.BufferedInputStream.read1(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at java.io.BufferedInputStream.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.net.www.http.ChunkedInputStream.fastRead(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at java.io.FilterInputStream.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.impl.Utf8StreamParser.loadMore(Utf8StreamParser.java:172)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.impl.Utf8StreamParser._parserNumber2(Utf8StreamParser.java:1064)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.impl.Utf8StreamParser.parseNumberText(Utf8StreamParser.java:1034)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.impl.Utf8StreamParser.nextToken(Utf8StreamParser.java:552)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer._readAndBind(MapDeserializer.java:304)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:249)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:33)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:414)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer._readAndBind(MapDeserializer.java:319)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:249)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:33)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer._readAndBind(MapDeserializer.java:319)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:249)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.std.MapDeserializer.deserialize(MapDeserializer.java:33)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:414)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2732)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1909)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.lantern.JsonUtils.decode(JsonUtils.java:82)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.lantern.monitoring.StatshubAPI.getStats(StatshubAPI.java:146)
Nov 24 02:35:50 107.170.123.187-1 logger: Lantern Client (5a4b47fdb8dd264567bb8a32adac38a0 / CN / Windows 8 / 1.5.9-05f5f31 / 1.7.0_25-b16) - WARN at org.lantern.monitoring.StatsManager$1.run(StatsManager.java:113) 

oxtoacart avatar Nov 24 '14 15:11 oxtoacart

Note - manually curling country stats works just fine.

oxtoacart avatar Nov 24 '14 16:11 oxtoacart

This could be related to #1510. It looks like almost all the errors are at the SSL layer, which could happen if for some reason we are running things over HTTP CONNECT when we should be doing straight HTTP or vice versa. I suspect solving that issue will at least lessen the reports of this. Note the message itself is slightly misleading, as it's really an error connecting to and reading data from statshub at all.

myleshorton avatar Nov 26 '14 18:11 myleshorton

Note the error in the logs is "Error decoding JSON" but that's a bit misleading, as this really happens while connecting to and reading data from stats hub.

myleshorton avatar Nov 26 '14 18:11 myleshorton

@myleshorton If the problem is in fact in LittleProxy, we could make this and similar errors go away by routing these requests exclusively through flashlight. That doesn't eliminate the need to fix the LittleProxy issue, but from my first glance at it nothing stood out as being a clear root cause. What do you think?

oxtoacart avatar Nov 26 '14 20:11 oxtoacart

That approach sounds fine to me @oxtoacart

myleshorton avatar Dec 02 '14 18:12 myleshorton

So, there's a branch that's now using flashlight as the front proxy and bypasses LittleProxy on the front-end completely. I still see this error as well as the XMPP error, so they're not caused by LittleProxy. I'm not 100% sure, but it looks like I only see these errors when domain fronting (not direct proxying), so it's like a problem in that area, such as the aggressive idle timeouts.

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

BTW, the branch is here - https://github.com/getlantern/lantern/tree/2007

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

XMPP (and the Smack implementation) do support keepalives, so I think those are worth looking at.

https://igniterealtime.org/issues/browse/SMACK-412

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

So even when running exclusively with chained servers, I still see the XMPP issue. It appears to be related to the connection being shut down at the TCP level rather than the XMPP level:

http://xmpp.org/extensions/xep-0190.html

Here's an example error:

java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...4-c504-4cfc-b585-c225a989720a",\n  "ut" : 300000\n}</body></message>... @9:19
    at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035)
    at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
    at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)
    at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
    at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:325)
    at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)
    at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70)

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

@myleshorton If I wanted to enable Smack's keepalive support, would I need to get into the littleshoot code to do that? I ask because it looks like we're getting the XMPPConnection from XmppP2PClient, which is a littleshoot class.

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

Clarification - I'm not actually seeing this error when running directly through flashlight, but I am seeing the error in #1510. Oddly enough, I can't replicate it using curl going through the proxy at 8787, so perhaps its something about my use of HttpURLConnection.

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

XEP-199 might be a good starting point for XMPP keepalives - http://xmpp.org/extensions/xep-0199.html

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

Whitespace pings look like a potentially even simpler option to try first - https://tools.ietf.org/html/rfc6120#section-4.4

oxtoacart avatar Dec 05 '14 04:12 oxtoacart

Cool thanks! Interesting on all the findings. The LittleShoot stuff is what controls the XMPP connection, yeah, although honestly I've been tempted to strip that out of there and to just use Smack directly because they started updating Smack again in the last year or so after leaving it dormant forever, and it's fairly likely the older one may not have included the keep alives.

Are you seeing disconnects only after a certain wait period? I actually haven't been able to reproduce that issue in the last day or so, but I wonder if it's because I'm not running through flashlight.

I'm also happy to keep that bug on my plate, as it's a little annoying jumping into the LittleShoot side especially because we ultimately have to deploy the changes in this case to maven central, and I think only I have permission to do that.

On Thu, Dec 4, 2014 at 8:47 PM, oxtoacart [email protected] wrote:

Whitespace pings look like a potentially even simpler option to try first

  • https://tools.ietf.org/html/rfc6120#section-4.4

— Reply to this email directly or view it on GitHub https://github.com/getlantern/lantern/issues/2007#issuecomment-65747206.

President Brave New Software Project, Inc. https://www.getlantern.org pgp A998 2B6E EF1C 373E 723F A813 045D A255 901A FD89

myleshorton avatar Dec 05 '14 05:12 myleshorton

Believe this may be another manifestation of #1947. Adjusting priority accordingly.

scouttle avatar Dec 08 '14 19:12 scouttle

We're not really using statshub anymore, clsoing.

oxtoacart avatar Feb 23 '16 12:02 oxtoacart