Android SDK resumable upload error after network recovery

Updated at:

Problem description

During a resumable upload with the Android SDK, the following error may occur after the network disconnects and reconnects:

 [ErrorMessage]: Unable to resolve host "xxx.oss-cn-hangzhou.aliyuncs.com": No address associated with hostname

Cause

A network interruption causes an intermediate part upload to fail. After the network recovers, the client uploads subsequent parts successfully, but the failure callback still reports the error from the failed part.

Solution

To resolve this, call resumableUpload again to re-upload the failed part. For more information, see Resumable upload (Android SDK).

Note

If you prefer the upload to terminate immediately upon the first failure, set request.exceptionTerminationMode=ExceptionTerminationMode.EXCEPTION in the request.