antonio-antuan opened a new issue, #29640:
URL: https://github.com/apache/airflow/issues/29640

   ### Apache Airflow Provider(s)
   
   amazon
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==7.2.0
   
   ### Apache Airflow version
   
   2.4.3
   
   ### Operating System
   
   Arch Linux
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   the same for MWAA (aws-managed airflow)
   
   ### What happened
   
   exception is raised:
   ```
   [2023-02-20, 14:32:02 UTC] {subprocess.py:92} INFO - [2023-02-20, 
14:32:02 UTC] {connectionpool.py:475} WARNING - Failed to 
parse headers 
url=[https://BUCKET.s3.us-west-2.amazonaws.com:443/object-key.json:[NoBoundaryInMultipartDefect()],
 unparsed data: ''
   [2023-02-20, 14:32:02 UTC] {subprocess.py:92} INFO - Traceback (most recent 
call last):
   [2023-02-20, 14:32:02 UTC] {subprocess.py:92} INFO -   File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 
469, in _make_request
   [2023-02-20, 14:32:02 UTC] {subprocess.py:92} INFO -     
assert_header_parsing(httplib_response.msg)
   [2023-02-20, 14:32:02 UTC] {subprocess.py:92} INFO -   File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/util/response.py", line 
91, in assert_header_parsing
   [2023-02-20, 14:32:02 UTC] {subprocess.py:92} INFO -     raise 
HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
   [2023-02-20, 14:32:02 UTC] {subprocess.py:92} INFO - 
urllib3.exceptions.HeaderParsingError: [NoBoundaryInMultipartDefect()], 
unparsed data: ''
   ```
   
   ### What you think should happen instead
   
   shouldn't be such an exception :)
   
   ### How to reproduce
   
   the code that downloads data is simple:
   ```
   
   def download_from_s3(key: str, bucket_name: str, local_path: str) -> str:
       boto3.set_stream_logger('boto3.resources', logging.DEBUG)
       hook = S3Hook(aws_conn_id='s3_conn')
       file_name = hook.download_file(key=key, bucket_name=bucket_name, 
preserve_file_name=True)
       return file_name
   
   ```
   
   ### Anything else
   
   anyway, file is downldaed and looks valid.
   
   some logs:
   ```
   [2023-02-20, 15:18:38 UTC] {connection_wrapper.py:337} 
INFO - AWS Connection (conn_id='s3_conn', conn_type='aws') credentials 
retrieved from login and password.
   2023-02-20, 15:18:38 UTC boto3.resources.factory [DEBUG] Loading s3:s3
   [2023-02-20, 15:18:38 UTC] {factory.py:66} DEBUG - 
Loading s3:s3
   2023-02-20, 15:18:38 UTC boto3.resources.factory [DEBUG] Loading s3:Object
   [2023-02-20, 15:18:38 UTC] {factory.py:66} DEBUG - 
Loading s3:Object
   2023-02-20, 15:18:38 UTC boto3.resources.action [DEBUG] Calling 
s3:head_object with {'Bucket': 'BUCKET', 'Key': 'object_key.json'}
   [2023-02-20, 15:18:38 UTC] {action.py:85} DEBUG - 
Calling s3:head_object with {'Bucket': 'BUCKET', 'Key': 'object_key.json'}
   [2023-02-20, 15:18:40 UTC] {connectionpool.py:475} 
WARNING - Failed to parse headers 
(url=https://BUCKET.s3.us-west-2.amazonaws.com:443/object_key.json): 
[NoBoundaryInMultipartDefect()], unparsed data: ''
   Traceback (most recent call last):
     File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 
469, in _make_request
       assert_header_parsing(httplib_response.msg)
     File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/util/response.py", line 
91, in assert_header_parsing
       raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
   urllib3.exceptions.HeaderParsingError: [NoBoundaryInMultipartDefect()], 
unparsed data: ''
   2023-02-20, 15:18:40 UTC boto3.resources.action [DEBUG] Response: 
{'ResponseMetadata': {'RequestId': 'W3J4VRW3WQVV8AV7', 'HostId': 
'uRLn/mC6mUAPtgAZRcPbdIlkzWNQ8/AKuPn5HuHjJK1CLNAxfES3DXQsnF7HYSia4guuylFLItY=', 
'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amz-id-2': 
'uRLn/mC6mUAPtgAZRcPbdIlkzWNQ8/AKuPn5HuHjJK1CLNAxfES3DXQsnF7HYSia4guuylFLItY=', 
'x-amz-request-id': 'W3J4VRW3WQVV8AV7', 'date': 'Mon, 20 Feb 2023 15:18:40 
GMT', 'last-modified': 'Thu, 09 Feb 2023 10:34:28 GMT', 'etag': 
'"e7d2a315e24716624b1085cfa7f31ad8"', 'x-amz-server-side-encryption': 'AES256', 
'accept-ranges': 'bytes', 'content-type': 'multipart/form-data', 'server': 
'AmazonS3', 'content-length': '7004'}, 'RetryAttempts': 0}, 'AcceptRanges': 
'bytes', 'LastModified': datetime.datetime(2023, 2, 9, 10, 34, 28, 
tzinfo=tzutc()), 'ContentLength': 7004, 'ETag': 
'"e7d2a315e24716624b1085cfa7f31ad8"', 'ContentType': 'multipart/form-data', 
'ServerSideEncryption': 'AES256', 'Metadata': {}}
   [2023-02-20, 15:18:40 UTC] {action.py:90} DEBUG - 
Response: {'ResponseMetadata': {'RequestId': 'W3J4VRW3WQVV8AV7', 'HostId': 
'uRLn/mC6mUAPtgAZRcPbdIlkzWNQ8/AKuPn5HuHjJK1CLNAxfES3DXQsnF7HYSia4guuylFLItY=', 
'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amz-id-2': 
'uRLn/mC6mUAPtgAZRcPbdIlkzWNQ8/AKuPn5HuHjJK1CLNAxfES3DXQsnF7HYSia4guuylFLItY=', 
'x-amz-request-id': 'W3J4VRW3WQVV8AV7', 'date': 'Mon, 20 Feb 2023 15:18:40 
GMT', 'last-modified': 'Thu, 09 Feb 2023 10:34:28 GMT', 'etag': 
'"e7d2a315e24716624b1085cfa7f31ad8"', 'x-amz-server-side-encryption': 'AES256', 
'accept-ranges': 'bytes', 'content-type': 'multipart/form-data', 'server': 
'AmazonS3', 'content-length': '7004'}, 'RetryAttempts': 0}, 'AcceptRanges': 
'bytes', 'LastModified': datetime.datetime(2023, 2, 9, 10, 34, 28, 
tzinfo=tzutc()), 'ContentLength': 7004, 'ETag': 
'"e7d2a315e24716624b1085cfa7f31ad8"', 'ContentType': 'multipart/form-data', 
'ServerSideEncryption': 'AES256', 'Metadata': {}}
   [2023-02-20, 15:18:40 UTC] {connectionpool.py:475} 
WARNING - Failed to parse headers 
(url=https://BUCKET.s3.us-west-2.amazonaws.com:443/object_key.json): 
[NoBoundaryInMultipartDefect()], unparsed data: ''
   Traceback (most recent call last):
     File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 
469, in _make_request
       assert_header_parsing(httplib_response.msg)
     File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/util/response.py", line 
91, in assert_header_parsing
       raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
   urllib3.exceptions.HeaderParsingError: [NoBoundaryInMultipartDefect()], 
unparsed data: ''
   [2023-02-20, 15:18:40 UTC] {connectionpool.py:475} 
WARNING - Failed to parse headers 
(url=https://BUCKET.s3.us-west-2.amazonaws.com:443/object_key.json): 
[NoBoundaryInMultipartDefect()], unparsed data: ''
   Traceback (most recent call last):
     File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 
469, in _make_request
       assert_header_parsing(httplib_response.msg)
     File 
"/home/***/.local/lib/python3.7/site-packages/urllib3/util/response.py", line 
91, in assert_header_parsing
       raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
   urllib3.exceptions.HeaderParsingError: [NoBoundaryInMultipartDefect()], 
unparsed data: ''
   ```
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to