Issues

ZF-11436: Zend_Service_Amazon_S3: method _makeRequest 400 error codes

Issue Type: Bug Created: 2011-06-03T15:44:20.000+0000 Last Updated: 2011-06-03T21:17:20.000+0000 Status: Open Fix version(s): Reporter: Greg Greenhaw (greggreenhaw) Assignee: Enrico Zimuel (zimuel) Tags: - Zend_Service_Amazon

Related issues: Attachments:

Description

Amazon often returns the following error with a httpd status code of 400. This happens on remote file stream when the remote server lags a bit. It is not consistent but should be accounted for.

Zend_Http_Response Object ( [version:protected] => 1.1 [code:protected] => 400 [message:protected] => Bad Request [headers:protected] => Array ( [X-amz-request-id] => BE215CC78852E021 [X-amz-id-2] => a5+9JaMxaPRcjfASrAQwFjc0TUn0+tylj/PNy3+OxSY13HvT+aM7i+82u349HbdE [Content-type] => application/xml [Transfer-encoding] => chunked [Date] => Thu, 02 Jun 2011 23:30:12 GMT [Connection] => close [Server] => AmazonS3 )

[body:protected] => 15c
`RequestTimeout`Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.BE215CC78852E021

Current code in method _makeRequest:

do { $retry = false;

        $response = $client->request($method);
        $response_code = $response->getStatus();

        // Some 5xx errors are expected, so retry automatically
        if ($response_code >= 500 && $response_code < 600 && $retry_count <= 5) {
            $retry = true;
            $retry_count++;
            sleep($retry_count / 4 * $retry_count);
        }
        else if ($response_code == 307) {
            // Need to redirect, new S3 endpoint given
            // This should never happen as Zend_Http_Client will redirect automatically
        }
        else if ($response_code == 100) {
            // echo 'OK to Continue';
        }
    } while ($retry);

Comments

No comments to display

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts