cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropbox API Response Body warning

Highlighted

Dropbox API Response Body warning

Explorer | Level 4

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

 

6 Replies 6
Highlighted

Re: Dropbox API Response Body warning

Dropboxer

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.

Highlighted

Re: Dropbox API Response Body warning

Explorer | Level 4

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


Highlighted

Re: Dropbox API Response Body warning

Explorer | Level 4

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();

Highlighted

Re: Dropbox API Response Body warning

Dropboxer

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. 

Highlighted

Re: Dropbox API Response Body warning

New member | Level 2

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:14
	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

 

 

Highlighted

Re: Dropbox API Response Body warning

Dropboxer

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.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?