cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

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: 

com.dropbox.core.NetworkIOException: timeout

com.dropbox.core.NetworkIOException: timeout

TejaVarma
Explorer | Level 4
Here is code 
try
{
//Download file for DropBox 2
DbxDownloader<FileMetadata> downloadData = dbxClientV2.files().download(dBoxPath);
ouputStream = new FileOutputStream(localFile);
downloadData.download(ouputStream);

//Download file for DropBox 1
/* DropboxAPI.DropboxInputStream fd = dropboxAPI.getFileStream(dBoxPath, null);
ouputStream = new FileOutputStream(localFile);
fd.copyStreamToOutput(ouputStream, null);*/
}/* catch (DropboxException err) {
Log.e(LOG_TAG, "DropboxAPI throws this exception : " + err.getMessage());
success = false;
}*/ catch (Exception err) {
Log.e(LOG_TAG, "Exception thrown for file at " + dBoxPath + " err msg :" + err.getMessage());
success = false;
} finally {
if (ouputStream != null) {
ouputStream.close();
}
}
7 Replies 7

Greg-DB
Dropbox Staff
Does this happen on every attempt, or only occasionally? Can you share the full error output?

TejaVarma
Explorer | Level 4

It is happening some time. Right now I am not getting error. Once I face issue, I will post you.

TejaVarma
Explorer | Level 4

Hi,

 

I am facing same issue while I am downloading .zip file of 162MB

 

com.dropbox.core.NetworkIOException: Unable to resolve host "content.dropboxapi.com": No address associated with hostname

 

I am having there files 162MB, 300KB, 250MB , I made for loop to download each item

1. When I am trying to download first file I gotNetworkIOException.

2. For 2nd file it was downloaded.

3. It was downloaded but only 500KB, it did not download 250MB

 

 

Here is code I am working 

try {
//Download file for DropBox 2
DbxDownloader<FileMetadata> downloadData = dbxClientV2.files().download(dBoxPath);
ouputStream = new FileOutputStream(localFile);
downloadData.download(ouputStream);

} catch (Exception err) {
Log.e(LOG_TAG, "Exception thrown for file at " + dBoxPath + " err msg :" + err.getMessage());
success = false;
} finally {
if (ouputStream != null) {
ouputStream.close();
}
}

NetworkIOException might be issue in Internet. But why it was downloaded only 500KB instead of 250MB. Please suggest me 

 

Thanks

 

Greg-DB
Dropbox Staff

The error message for the NetworkIOException you posted does indicate a DNS issue. The content.dropboxapi.com hostname is resolving correctly though, so it does seem to be intermittent DNS issues on your side.

 

Regarding the incomplete download, your code looks fine. I just tried it with a 250 MB file and it's working for me.

 

If the download doesn't complete, you should get some error message. What error/output are you getting in that case? 

TejaVarma
Explorer | Level 4

We are not getting progress of download. It just return when doenload is completed. Is there any change in future, we can get progress of download?

 

Right now I am geting this error 

om.dropbox.core.NetworkIOException: Unable to resolve host "content.dropboxapi.com": No address associated with hostname

 

But I am not using any Dropbox V1. In last converstation I posted code too. 

 

Here I am not getting any idea about DNS issue, can you explain more detailed.

 

Thanks.

Greg-DB
Dropbox Staff
The API v2 Java SDK doesn't offer progress listeners, but I'll be sure to pass this along as a feature request. I can't promise if or when this may be added to the SDK though.

The DNS issue wouldn't be specific to API v1. API v2 also uses the 'content.dropboxapi.com' hostname, so your system needs to be able to query the DNS records for that.

DNS is a way for computers to translate hostnames (like 'content.dropboxapi.com') into IP addresses, so the computer knows where to find the relevant servers. Your computer asks your DNS server(s) to do this translation.

I just checked on my side, and the Dropbox content and API servers do have correct DNS entries. There are many different DNS servers though, so you'll need to check why the particular DNS server(s) you're using occasionally are not returning these entries, causing this error.

Greg-DB
Dropbox Staff

I just wanted to follow up on this to let you know that the Dropbox API v2 Java SDK now offers progress listeners for uploads and downloads. This has been released in v3.0.9:

https://github.com/dropbox/dropbox-sdk-java/releases/tag/v3.0.9

There's an example of using it with with the uploadAndFinish method ( https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/DbxUploader.html#uploadA... ) for an upload here:

https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/upload-file/src/main/java/com/dropb...

It works the same way with file downloads; the download method ( https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/DbxDownloader.html#downl... ) optionally takes a ProgressListener parameter the same way.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    TejaVarma Explorer | Level 4
What do Dropbox user levels mean?