question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IndexOutOfBoundsException in RealConnection

See original GitHub issue

Stacktrace

java.lang.IndexOutOfBoundsException: Index: 0
	at java.base/java.util.Collections$EmptyList.get(Collections.java:4481)
	at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:326)
	at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:283)
	at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:168)
	at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
	at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
	at okhttp3.RealCall.execute(RealCall.java:92)

Environment

  • OkHttp 3.12.0
  • Java 11.0.1 LTS
  • Windows 10 64-bit

This bug seems cannot be stably reproduce, so I’m not sure how to write a failing test for this. After I downgraded okhttp to 3.11.0 it works fine.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
MinnDevelopmentcommented, Dec 23, 2018

This seems to be rather potent with version 3.12.0, however that version also contains a fix for an issue of 3.11.0 with proxySelector being null on some JVMs. I’m twisted whether I should be using 3.12.0 with this issue or 3.11.0 with the other. I’d much appreciate a fix for this to void that problem.

0reactions
ToxicMushroomcommented, Dec 16, 2018

I’m also having this issue pls fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Okhttp java 11 exceptions - Stack Overflow
IndexOutOfBoundsException : Index: 0 at java.base/java.util. ... RealConnection.connect(RealConnection.java:168) at ...
Read more >
[Solved] java.lang.IndexOutOfBoundsException
This exception is thrown by String methods to indicate that an index is either negative or greater than the size of the String....
Read more >
Java.lang.indexoutofboundsexception android - 免费编程教程
IndexOutOfBoundsException: Invalid index 2, size is 1 at java.util.ArrayList. ... RealConnection 中的IndexOutOfBoundsException #4427。
Read more >
SSL Error B4J | B4X Programming Forum
IndexOutOfBoundsException : Index: 0 at java.base/java.util.Collections$EmptyList.get(Collections.java:4481) at okhttp3.internal.connection.RealConnection.
Read more >
Server unable to reach - SonarQube - Sonar Community
RealConnection.connect(RealConnection.java:183) ... IndexOutOfBoundsException: Index 2 out of bounds for length 2
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found