Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am using DropBox API. I see the following warning occasionally and would like to know if this can be got rid of. How to find out which call is causing this warning to be thrown.
A connection to https://api.dropboxapi.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)
Thanks
First, to clarify, are you using the official Dropbox Java SDK? If so, please let me know what version number you have installed.
Anyway, did you try enabling the finer-grained logging that the message recommended? Please try that and share the output.
Yes, I am using the official Dropbox Java SDK ? Version number is 3.0.9.
Okhttp3 Processor library version is 3.12.*.
I did add the following lines
<logger name="okhttp3">
<level value="debug" />
</logger>
<logger name="okhttp3.OkHttpClient">
<level value="debug" />
</logger>
Also, I implemented the okhttp3.Interceptor interface, but no luck.
I get the requests / responses logged in the file, but still warning shows up once in a while -
say when I simulate 100 (webhook) requests or so at once.
Any other idea to track / debug / resolve ?
Thanks
Also, would like to add that, the only place where theOkhttp3Requestor is used is :
OkHttpClient httpClient = OkHttp3Requestor.defaultOkHttpClientBuilder()
.addInterceptor(new CustomLoggingInterceptor())
.readTimeout(5, TimeUnit.MINUTES)
.build();
OkHttp3Requestor requestor = new OkHttp3Requestor(httpClient);
DbxRequestConfig config = DbxRequestConfig.newBuilder(CONFIG).withHttpRequestor(requestor).build();
Apologies, I'm not sure I follow. The OkHttp output mentioned using "setLevel(Level.FINE)" in particular to help track this down. I don't see where you set that. Were you able to use that?
Otherwise, if you can share the whatever code is running around when you do see these, we can try to reproduce it to track it down on our side.
Hi Greg,
Sorry for the delayed response.
We use Dropbox API to track the files uploaded by user to a shared Dropbox account. The uploaded files are checked before being accepted for further processing. If these files do not comply with data quality checks, they are deleted programmatically ( in a thread ).
Once in a while the following warning is shown :
A connection to https://api.dropboxapi.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)
When the warning level is set to FINEST, the stack trace is :
14:01:22,522 WARNING [okhttp3.OkHttpClient] (OkHttp ConnectionPool) A connection to https://api.dropboxapi.com/ was leaked. Did you forget to close a response body?: java.lang.Throwable: response.body().close() at okhttp3.internal.platform.Platform.getStackTraceForCloseable(Platform.java:148) at okhttp3.RealCall.captureCallStackTrace(RealCall.java:89) at okhttp3.RealCall.execute(RealCall.java:73) at com.dropbox.core.http.OkHttp3Requestor$BufferedUploader.finish(OkHttp3Requestor.java:287) at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:259) at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:121) at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:300) at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:116) at com.dropbox.core.v2.files.DbxUserFilesRequests.deleteV2(DbxUserFilesRequests.java:833) at com.dropbox.core.v2.files.DbxUserFilesRequests.deleteV2(DbxUserFilesRequests.java:862) at xxx.xxx.xxx.xxx.XXXService.process(XXXService.java:199)
Line no. 199 of XXXService is :
DbxClientV2.files().deleteV2(fileMetadata.getPathDisplay());
How to avoid this warning ?
Thanks
Thanks! That stack is helpful. This looks like something that would need to be addressed in the Dropbox SDK itself. We'll look into it.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!