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.

OkHttpClient - A connection to [issuer] was leaked

See original GitHub issue

Hi,

We’re using com.auth0:auth0:1.0.0 and com.auth0:auth0-spring-security-api:1.0.0-rc2 inside a spring-boot 1.5.1.RELEASE application. When calling the Auth0 API, we occasionally see a log warning that apparently emanates from okhttp3:

2017-02-27T08:05:05.453 WARN  okhttp3.OkHttpClient - A connection to https://[our-issuer-id].auth0.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

Looking it up it seems the possible cause is that the body of the request needs to be explicitly closed when the response code is not 200. See https://github.com/square/okhttp/issues/2311.

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AlphaJuliettOmegacommented, Apr 19, 2021

@lbalmaceda how do I know if there was a regression on this issue or if it’s a new issue?

I don’t know how to reproduce or get more info but I’m seeing this in my logging:

W/okhttp.OkHttpClient: A connection to http://10.0.2.2:8081/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);

And I can’t find much about this anywhere else (I’m using React-native-intercom 18, upgrade to 19 didn’t change it)

1reaction
lbalmacedacommented, Feb 27, 2017

Hi @shiloa, We fixed that in https://github.com/auth0/auth0-java/pull/38. You’ll see it in the next release.

Cheers,

Read more comments on GitHub >

github_iconTop Results From Across the Web

OkHttpClient connection was leaked warning · Issue #6 - GitHub
OkHttpClient : A connection to https://cdn-global.configcat.com/ was leaked. Did you forget to close a response body? To see where this was ...
Read more >
OkHttp: avoid leaked connection warning - java - Stack Overflow
I am using OkHttp 3, and I keep getting leaked connection warnings: WARNING: A connection to https://help.helpling.com/ was leaked.
Read more >
okHttp client reports leaking connection : UP-10647 - YouTrack
okHttp client reports leaking connection ;, set the OkHttpClient logger level to FINE ; : Logger.getLogger ; (OkHttpClient.class.getName ; ).setLevel ...
Read more >
leak in android httpclient HttpURLConnectionImpl ...
I encountered this issue on a Samsung SM-G980F running Android 10 / API 29. ... To fix the strictmode violation, uncomment the indicated...
Read more >
connection to sonarqube was leaked - Google Groups
Hi During an analysis I just got the following exception: A connection to https://sonarqube.company.com/ was leaked. Did you forget to close a response...
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