Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
AS13
7 years agoExplorer | Level 4
Dropbox API Response Body warning
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 ht...
Greg-DB
Dropbox Community Moderator
7 years agoFirst, 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.
AS13
7 years agoExplorer | 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
- AS137 years agoExplorer | 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();- Greg-DB7 years ago
Dropbox Community Moderator
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.
- AS1327 years agoNew 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: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
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!