New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect response code when Downloading S3 object with invalid range #2587
Comments
Thanks for reporting @charleswhchan . This should be fixed in #2598 - can you please give it a try with the |
Hi @whummer, I tried the latest docker image and I am still seeing the error: Looking at the test case and comparing to my sample code (above). I am using Download(). Perhaps the fix needs to be applied some where else as well? Maybe a test using download_file() or download_fileobj() will help expose the problem? |
Hi @charleswhchan , sorry, perhaps my response came a few minutes too early. Please note that it can take some time for our CI system to build and push the |
Thanks @whummer for the quick turnaround. You are right, it is working with the following image:
Please close the ticket. 👍 |
|
This is issue still happening for larger files as of 1/27/23. I am using boto3==1.21.35 [2023-01-10, 17:25:29 EST] "message": "multiprocessing.pool.RemoteTraceback: \n"""\nTraceback (most recent call last):\n File "/usr/lib64/python3.7/multiprocessing/pool.py", line 121, in worker\n result = (True, func(*args, **kwds))\n File "/usr/lib64/python3.7/multiprocessing/pool.py", line 47, in starmapstar\n return list(itertools.starmap(args[0], args[1]))\n File "fpcp_file_manager.py", line 655, in func_download_s3_files\n s3.download_file(awsbucket, key, dest_filename)\n File "/usr/local/lib/python3.7/site-packages/boto3/s3/inject.py", line 195, in download_file\n callback=Callback,\n File "/usr/local/lib/python3.7/site-packages/boto3/s3/transfer.py", line 320, in download_file\n future.result()\n File "/usr/local/lib/python3.7/site-packages/s3transfer/futures.py", line 103, in result\n return self._coordinator.result()\n File "/usr/local/lib/python3.7/site-packages/s3transfer/futures.py", line 266, in result\n raise self._exception\n File "/usr/local/lib/python3.7/site-packages/s3transfer/tasks.py", line 139, in call\n return self._execute_main(kwargs)\n File "/usr/local/lib/python3.7/site-packages/s3transfer/tasks.py", line 162, in _execute_main\n return_value = self._main(kwargs)\n File "/usr/local/lib/python3.7/site-packages/s3transfer/download.py", line 570, in _main\n Bucket=bucket, Key=key, extra_args\n File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 415, in _api_call\n return self._make_api_call(operation_name, kwargs)\n File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 745, in _make_api_call\n raise error_class(parsed_response, operation_name)\nbotocore.exceptions.ClientError: An error occurred (InvalidRange) when calling the GetObject operation: The requested range is not satisfiable\n"""\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File "fpcp_file_manager.py", line 1287, in \n main()\n File "fpcp_file_manager.py", line 1238, in main\n if download_s3_files == True: exec_download_s3_files()\n File "fpcp_file_manager.py", line 1088, in exec_download_s3_files\n pool.starmap(func_download_s3_files, zip(keys, repeat(download_destpath)), chunksize=10)\n File "/usr/lib64/python3.7/multiprocessing/pool.py", line 276, in starmap\n return self._map_async(func, iterable, starmapstar, chunksize).get()\n File "/usr/lib64/python3.7/multiprocessing/pool.py", line 657, in get\n raise self._value\nbotocore.exceptions.ClientError: An error occurred (InvalidRange) when calling the GetObject operation: The requested range is not satisfiable\n", Another issue is while deleting the larger file. However for delete-file it is not throwing any error. It simply skip the file from deleting as below. First and last one were deleted. middle one was not deleted which is causing duplication issue in processing. {'DeleteMarker': True, Can you please reopen this ticket and provide an assistance? Please let me know if you need further information. Thanks. |
Type of request: This is a ...
[x] bug report
[ ] feature request
Detailed description
When download invalid a range of bytes from S3 with an invalid range. localstack returns an incorrect error code
RequestedRangeNotSatisfiable
instead ofInvalidRange
Expected behavior
(from S3) Err: InvalidRange: The requested range is not satisfiable
Actual behavior
(from localstack) RequestedRangeNotSatisfiable
Client code (AWS SDK code snippet, or sequence of "awslocal" commands)
The text was updated successfully, but these errors were encountered: