aws-sdk-php: Issue with MultipartUpload in >= 3.34.2. Getting timeout response.

I am using the league/flysystem to run upload to S3 using upload method. In 3.34.2 we are getting these errors from S3:

The operation is basically reading from a url (opening a stream) which is then passed to the S3. This does not seem to happen all the time but at least 1/5 times. We are not passing any custom parameters (defaults are used)

OS: Amazon Linux AMI release 2016.03 Curl: curl 7.49.1 (x86_64-pc-linux-gnu) libcurl/7.49.1 NSS/3.24 Basic ECC zlib/1.2.8 Php: 7.0.9 (running php-fpm)

Note the curl 35 error. Not sure if that would be the issue, or just a derivative

(Note: for clarity https/http prefixes were removed (they are not missing i.e. 😕/s3.* = https//s3.*))

Uncaught Exception Aws\S3\Exception\S3MultipartUploadException: "An exception occurred while uploading parts to a multipart upload. The following parts had errors: - Part 3: Error executing "UploadPart" on "://s3.amazonaws.com/yyy/xxx/data/Approved/CD_3945_20170826185935.pdf?partNumber=3&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB"; AWS HTTP error: cURL error 35: Encountered end of file (see ://curl.haxx.se/libcurl/c/libcurl-errors.html) - Part 2: Error executing "UploadPart" on "://s3.amazonaws.com/yyy/xxx/data/Approved/CD_3945_20170826185935.pdf?partNumber=2&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB"; AWS HTTP error: cURL error 35: Encountered end of file (see ://curl.haxx.se/libcurl/c/libcurl-errors.html) - Part 1: Error executing "UploadPart" on "://s3.amazonaws.com/yyy/xxx/data/Approved/CD_3945_20170826185935.pdf?partNumber=1&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB"; AWS HTTP error: Client error: PUT ://s3.amazonaws.com/yyy/xxx/data/Approved/CD_3945_20170826185935.pdf?partNumber=1&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB resulted in a 400 Bad Request response: RequestTimeoutYour socket connection to the server w (truncated...) RequestTimeout (client): Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. - RequestTimeoutYour socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.F5E729A38A40DC4Btg62PcN1ACjdUQsGBFY1SNUDOdc0CRJ3BowcTgAcg5cavdFm70k/VxsNxC4sNTwdcKm6XAEVRtg= " at /srv/www/vendor/aws/aws-sdk-php/src/Multipart/AbstractUploadManager.php line 127 {"exception":"[object] (Aws\S3\Exception\S3MultipartUploadException(code: 0): An exception occurred while uploading parts to a multipart upload. The following parts had errors:\n- Part 3: Error executing \"UploadPart\" on \"://s3.amazonaws.com/yyy/xxx/data/Approved/CD_3945_20170826185935.pdf?partNumber=3&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB\"; AWS HTTP error: cURL error 35: Encountered end of file (see ://curl.haxx.se/libcurl/c/libcurl-errors.html)\n- Part 2: Error executing \"UploadPart\" on \"://s3.amazonaws.com/yyy/xxx/data/Approved/CD_3945_20170826185935.pdf?partNumber=2&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB\"; AWS HTTP error: cURL error 35: Encountered end of file (see ://curl.haxx.se/libcurl/c/libcurl-errors.html)\n- Part 1: Error executing \"UploadPart\" on \"://s3.amazonaws.com/yyy/xxx/data/Approved/CD_3945_20170826185935.pdf?partNumber=1&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB\"; AWS HTTP error: Client error: PUT ://s3.amazonaws.com/xxx/yyy/data/Approved/CD_3945_20170826185935.pdf?partNumber=1&uploadId=IQt.rBjwmGBoFD8_R_N_6lmYX3NObVG5pXgf9Bsooh7pqyVnDg994UiQI4I24BkuWFrwpbhf11BeapNryY8LJgY8E6uRkSoKy9wF8rUX0TClAddp.usiwYjh_IYFuMUB resulted in a 400 Bad Request response:\n\nRequestTimeoutYour socket connection to the server w (truncated...)\n RequestTimeout (client): Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. - \nRequestTimeoutYour socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.F5E729A38A40DC4Btg62PcN1ACjdUQsGBFY1SNUDOdc0CRJ3BowcTgAcg5cavdFm70k/VxsNxC4sNTwdcKm6XAEVRtg=\n at /srv/www/vendor/aws/aws-sdk-php/src/Multipart/AbstractUploadManager.php:127)"}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@fjmoralesp Your issue is likely then the same as #1326 - please update to 3.31.3 or higher.

Can you please supply the versions of the AWS SDK for PHP, Flysystem, and Flysystem Aws S3 V3 adaptor you’re using? Can you also update with a code sample of how you’re invoking the ->upload() function?