Skip to content
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

Botocore IncompleteReadError #802

Closed
vvarg229 opened this issue Jul 16, 2023 · 2 comments
Closed

Botocore IncompleteReadError #802

vvarg229 opened this issue Jul 16, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vvarg229
Copy link
Collaborator

In tests test_s3_get_range and test_s3_put_object_lock_mode when s3_client is boto3 the step Get object S3 failed with IncompleteReadError:

botocore.exceptions.IncompleteReadError: 465 read, but total bytes expected is 1358.

COMMAND: 'S3 Get objects result'
OUTPUT:
 {'ResponseMetadata': {'RequestId': 'edff23f5-cec5-45a7-a1fb-3788640057de', 'HostId': '', 'HTTPStatusCode': 206, 'HTTPHeaders': {'accept-ranges': 'bytes', 'content-length': '1358', 'content-range': 'bytes 0-1357/4072', 'content-type': 'application/octet-stream', 'etag': '819a82327bac6be3399cace96e46ee3b24aacc528029182ffc52efa4d6012fbb', 'last-modified': 'Sat, 15 Jul 2023 18:10:16 GMT', 'x-amz-request-id': 'edff23f5-cec5-45a7-a1fb-3788640057de', 'x-amz-tagging-count': '0', 'x-amz-version-id': 'EUFNmeHx7GnRTfqWdKqBALWiseFpV8SBx3cyybd79gMt', 'date': 'Sat, 15 Jul 2023 18:10:17 GMT'}, 'RetryAttempts': 0}, 'AcceptRanges': 'bytes', 'LastModified': datetime.datetime(2023, 7, 15, 18, 10, 16, tzinfo=tzutc()), 'ContentLength': 1358, 'ETag': '819a82327bac6be3399cace96e46ee3b24aacc528029182ffc52efa4d6012fbb', 'VersionId': 'EUFNmeHx7GnRTfqWdKqBALWiseFpV8SBx3cyybd79gMt', 'ContentRange': 'bytes 0-1357/4072', 'ContentType': 'application/octet-stream', 'Metadata': {}, 'TagCount': 0, 'Body': <botocore.response.StreamingBody object at 0x7f2997d82890>}
self = <test_s3_object.TestS3GateObject object at 0x7f299a33c400>
bucket = 'b52a1a17-c069-417d-93ed-2e345a162228', complex_object_size = 4072
simple_object_size = 1000

    @allure.title("Test S3: Get range")
    def test_s3_get_range(self, bucket, complex_object_size: int, simple_object_size: int):
        if isinstance(TestS3GateBase.s3_client, AwsCliClient):
            pytest.skip("Skipping due to issue: https://github.com/nspcc-dev/neofs-s3-gw/issues/798")
        file_path = generate_file(complex_object_size)
        file_name = self.object_key_from_file_path(file_path)
        file_hash = get_file_hash(file_path)
        set_bucket_versioning(self.s3_client, bucket, s3_gate_bucket.VersioningStatus.ENABLED)
        with allure.step("Put several versions of object into bucket"):
            version_id_1 = s3_gate_object.put_object_s3(self.s3_client, bucket, file_path)
            file_name_1 = generate_file_with_content(simple_object_size, file_path=file_path)
            version_id_2 = s3_gate_object.put_object_s3(self.s3_client, bucket, file_name_1)
    
        with allure.step("Get first version of object"):
>           object_1_part_1 = s3_gate_object.get_object_s3(
                self.s3_client,
                bucket,
                file_name,
                version_id_1,
                range=[0, int(complex_object_size / 3)],
            )

pytest_tests/testsuites/services/s3_gate/test_s3_object.py:422: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pytest_tests/steps/s3_gate_object.py:335: in get_object_s3
    chunk = response["Body"].read(1024)
venv.local-pytest/lib/python3.10/site-packages/botocore/response.py:86: in read
    self._verify_content_length()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <botocore.response.StreamingBody object at 0x7f2997d82890>

    def _verify_content_length(self):
        # See: https://github.com/kennethreitz/requests/issues/1855
        # Basically, our http library doesn't do this for us, so we have
        # to do this ourself.
        if self._content_length is not None and \
                self._amount_read != int(self._content_length):
>           raise IncompleteReadError(
                actual_bytes=self._amount_read,
                expected_bytes=int(self._content_length))
E           botocore.exceptions.IncompleteReadError: 465 read, but total bytes expected is 1358.

Report:
https://http.t5.fs.neo.org/86C4P6uJC7gb5n3KkwEGpXRfdczubXyRNW5N9KeJRW73/204-1689440482/index.html#suites/5ce6aa05e800f910fce1d43aa230519d/fdbc6e310d107dff/

Logs:
32e944d455c62888.zip

Environment:
neo-go version 0.101.1
neofs-s3-authmate version v0.27.1
neofs-s3-gw version v0.27.1
neofs-adm version fc824ee9
neofs-ir version c824ee9
neofs-lens version fc824ee9
neofs-cli version fc824ee9
aws-cli/2.13.0
Python/3.11.4
Linux/5.15.0-1041-azure exe/x86_64.ubuntu.22 prompt/off

@vvarg229 vvarg229 added the bug Something isn't working label Jul 16, 2023
vvarg229 added a commit to vvarg229/neofs-testcases that referenced this issue Jul 16, 2023
vvarg229 added a commit to vvarg229/neofs-testcases that referenced this issue Jul 16, 2023
vvarg229 added a commit to vvarg229/neofs-testcases that referenced this issue Jul 16, 2023
vvarg229 added a commit to vvarg229/neofs-testcases that referenced this issue Jul 18, 2023
@smallhive
Copy link
Contributor

Tested all object tests in #801 with green result

@smallhive smallhive self-assigned this Jul 21, 2023
@roman-khimov roman-khimov closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants