java.lang.RuntimeException: An error occured while executing doInBackground()

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Set the S3 bucket to the same region as AmazonS3Client, otherwise it just throws this exception. Check if your bucket name is correct as well.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • apache camel - invalid credentials in aws s3
    via Stack Overflow by yin03
    ,
  • S3 client authentication error
    via GitHub by ppiotrow
    ,
    • java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:299) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352) at java.util.concurrent.FutureTask.setException(FutureTask.java:219) at java.util.concurrent.FutureTask.run(FutureTask.java:239) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) at java.lang.Thread.run(Thread.java:856) Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 09C37F19011C99ED), S3 Extended Request ID: NrSazbQ1KzqpB/6+YLHiE/vPt1W72zEXGF6TB5uP9vl92Apktzj8hgsz4lJKVhpDodzVMoxzO6Y= at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:709) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:385) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:196) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4204) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4161) at com.amazonaws.services.s3.AmazonS3Client.listObjects(AmazonS3Client.java:657) at com.amazonaws.services.s3.AmazonS3Client.listObjects(AmazonS3Client.java:628) at com.example.admin.amazons3download.DownloadSelectionActivity$GetFileListTask.doInBackground(DownloadSelectionActivity.java:129) at com.example.admin.amazons3download.DownloadSelectionActivity$GetFileListTask.doInBackground(DownloadSelectionActivity.java:113) at android.os.AsyncTask$2.call(AsyncTask.java:287) at java.util.concurrent.FutureTask.run(FutureTask.java:234)

    Users with the same issue

    aldrinleal
    aldrinleal1 times, last one,
    tyson925
    tyson9251 times, last one,
    tvrmsmith
    tvrmsmith12 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    49 more bugmates