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

AuthorizationHeaderMalformed - the Credential is mal-formed #780

Closed
Cranke opened this issue Sep 28, 2015 · 14 comments
Closed

AuthorizationHeaderMalformed - the Credential is mal-formed #780

Cranke opened this issue Sep 28, 2015 · 14 comments

Comments

@Cranke
Copy link

Cranke commented Sep 28, 2015

When trying to connect to s3 or executing the sample.php, i get the same error.

AWS HTTP error: Client error: 400 AuthorizationHeaderMalformed (client): The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".

The Error is related to setting the signing type. i get the same error with java sdk, if i dont use clientConfiguration.setSignerOverride("AWSS3V4SignerType");

But specifying signature in my client does not help.

$client = S3Client::factory(array( 'region' => 'eu-central-1', 'version' => 'latest', 'signature' => 'v4', 'http' => [ 'verify' => false ] ));

SO question:
http://stackoverflow.com/questions/32821946/how-to-connect-to-amazon-aws-s3-with-aws-sdk-php

@jeskew
Copy link
Contributor

jeskew commented Sep 28, 2015

Can you attach a debug plugin to the s3 client and post the output?

@jeskew jeskew added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. v2 labels Sep 28, 2015
@jeskew
Copy link
Contributor

jeskew commented Oct 8, 2015

Any update on this?

@Cranke
Copy link
Author

Cranke commented Oct 9, 2015

Its working now, can't reproduce, what i did.
Will update here if I remember.

@jeskew
Copy link
Contributor

jeskew commented Oct 11, 2015

Ok. I'm closing this issue for now but feel free to reopen it if you're able to reproduce the error.

@jeskew jeskew closed this as completed Oct 11, 2015
@amitchhajer
Copy link

Having same issue. It is giving me error only when using from an aws server. Works well when uploading from my local machine.

@jeskew
Copy link
Contributor

jeskew commented Oct 25, 2015

@amitchhajer Can you attach a debug plugin to the s3 client and post the output?

@amitchhajer
Copy link

hey, tried setting up the log plugin but getting below error

  1. installed https://packagist.org/packages/guzzle/plugin-log and added
    use Guzzle\Plugin\Log\LogPlugin;
  2. $s3Client = S3Client::factory(array( 'credentials' => array( 'key' => $this->s3Key, 'secret' => $this->s3Secret ), 'region' => 'ap-southeast-1', 'scheme' => 'https', 'version' => 'latest' ));
    $s3Client->addSubscriber(LogPlugin::getDebugPlugin());

gives:
"Catchable Fatal Error: Argument 2 passed to Aws\\AwsClient::getCommand() must be of the type array, object given, called in /home/vagrant/www/shifoo/vendor/aws/aws-sdk-php/src/AwsClient.php on line 167 and defined in /home/vagrant/www/shifoo/vendor/aws/aws-sdk-php/src/AwsClient.php line 211"

@jeskew
Copy link
Contributor

jeskew commented Oct 26, 2015

Sorry, I thought you were using v2. For v3, you can turn on debugging by adding 'debug' => true to your call to S3Client::factory. No need for a debug plugin.

@amitchhajer
Copy link

here it is:

``

-> Entering step init, name 's3.ssec'

command was set to array(3) {
["instance"]=>
string(32) "0000000064a40cfc000000004c9763f1"
["name"]=>
string(9) "PutObject"
["params"]=>
array(5) {
["Bucket"]=>
string(25) "prod-user-uploaded-images"
["Key"]=>
string(61) "MENU-ITEM-IMAGES/7ebdc1fd4ef261154d5dddbc958dcb48534b6d27.png"
["Body"]=>
resource(11) of type (stream)
["ACL"]=>
string(11) "public-read"
["@http"]=>
array(1) {
["debug"]=>
resource(12) of type (stream)
}
}
}

request was set to array(0) {
}

-> Entering step init, name 's3.source_file'

no changes

-> Entering step init, name 's3.save_as'

no changes

-> Entering step init, name 's3.location'

no changes

-> Entering step validate, name 'validation'

no changes

-> Entering step build, name 'builder'

request.instance was set to 0000000064a40c39000000004c9763f1
request.method was set to PUT
request.headers was set to array(3) {
["X-Amz-Security-Token"]=>
string(7) "[TOKEN]"
["Host"]=>
array(1) {
[0]=>
string(31) "s3-ap-southeast-1.amazonaws.com"
}
["x-amz-acl"]=>
array(1) {
[0]=>
string(11) "public-read"
}
}

request.body was set to �PNG

IHDR�Rh���Cx��tEXtSoftwareAdobe ImageReadyq�e<��IDATx��]�q�;��Y�/]/�O{4�������Ed�"#�����H]�*��"�uܓf��Z��v������g�;�����,���ht���
!H����
=H�/:��$O�ϐ���;��B� R�It��
�3��$��$����(���(���("��("�$
"�$�>���.á��a���������Y����/��#��������/ճ��uն��2���!��e���O�s�s,@�q�K �y���Rq���7 �ܝ�G�U;�5ߝW��TO^�׉���w/��������4�{��{r�>����g5�|]��w�0�:qbU?��Ǣ�NL�}��G~;��<��Ho��BB�������I��s�yp,BcEZ��4���& ���Tϵp�B����z�M8�=�w��<��w�N�fL��D����<��a�Gf:u�-���KGvJD�E�C���s�+&ԍ��� �]�?��莢}�}����h������"�Y���l�����g�c��T6�hpH ��A{g���ܾWGJE��Z����^���b�8�MF�X}�]�w�;�����3��c�Hԇ�����;�g׳�I����L� R[%��P=�L�NdTcZE��D�� ��/'��q��դ%�3I�Dى-�rb�I��g] RG����;Y(�У�t������(�����Di���Yد��� ҇�T���OF�M�Roh����5�H���k��)�f���L����2R���������(�C��<F&����?۵n!m2����SV�Fk?�>N����R������ƃ"����m[cL�DY��Z2�����sc����-�����Y������� &����1�T����Ecq�Аs�(H��F���N������\����($��F�0�WMc��Ԝ����� ������$�2�?S����Rz�me������}�Qɟ;�ʯ����4��S��M�xYF.��v}:E��H�'�L��ka�"�Ւ ����Sn�"n�������M�>g�r-B�����'���7���J����7:�|��B_���@o�^B��NҼb�r��~�!>�E��e�Dq��|q8���ov(yX������F���k� �F2I$�3$������� ���v�7�
9����-L�\�����$O���;�Z5$ؙ���d�-�u��/JN�.����"���
2KC�^ǐ �t�'��0���F��(���g�A���<}dqR���{Y�l�5��ϥ�R�3��)�)�pmָ����2׵��:����o���W���w2D�#��&��_��pOħ�H��������R�� &R���G89"6! ө���,�D.]�%d}����L�ɢ�r�!�M�?����������^�|�)�������%�o؀ז}�(��f��do|�p,�����ИM#���4?G��;L�tW�o����,���#��D��0������xl���EW.]�M�;�yJoJ�R�}T��Uh�'f��;��+���T$�>ؑ�L�y���(�[��?������z�u������4�L��ҙKO̎��H�_5��o�����2�>�EZ�3Էq@�7�.��{tj�K.�����V���nd?�D<�����pT�;�,�O��������u(�u@��G�����/���ʈ�)���)S�����"I�_�T�7���0������)?�S�����S�C��;[/?��-7CZ����u����E���h4�����#��� �H)�hT����\�r7 �.��)��JI��)���}M�h��@���6�b�DS��=�tf0�� ���$�� /gq0�����m:��0�U�#O���B�A��o߱�<���BwưF4����)�1,gQȷ$謩绸1D�i�1)?x6ԃ^9�]۶�)�Y3r�if�ۖ�ѩ�'�/����ئQLd:�1s��'G����g�}�?�a����1�j�El�'�ԙ'����Hh������Rޘ�d�Bc��6��E�/�B���
��1�z?f��D�Q9/������;�� �NM��?��td���S��"�2}�z��]��qg#>���)/���#�����@�.�6��qd8��ࡍ���u�e�#�X��MM3��V�5�w\��U��^זH7��>��T�/�����H�5=S���T�e^5ȶ�]�D���s�y%��77��is�_r�82&���z��}�e�;e+໽&J�9i!������-���6\D�&�
]�Զ�j��@�,o����̔�!U��������;�1�?�M
@o��)�����<�B����
��}�?�SD�vd��p_$JQ��U�t��)��ŀ�N�RL;sA����ưq�A�w�ͭ0+hm|a�#]�bܣF���?l_��H閿��g�y���|Djx�$�����S'�0�T<���A�Y�fm��Y�_"j�k�+Mr�ߕ�v����v�S?
c@�?����ym�����M�����k����D�/թe9��K��Wu���3MoT�l�\ GgLȉ���R����F�R����9����:9��e���JU/�[�"�DH�d�SRp��²��P.�)��wY�b�����8�(������1��=���c�I�������\6���#]G���>���B���ch4�H�.8�i���Ҏ��G,b��8��Օk��B�tR����T�!܈��c���y����n���7�[OW^#�c̯$u������� o4�D�����-"��#����)����t��ط�� �I�7"��2���� �-�hO#�m��NO&N��ņ���o��Ջ�on6%�G���-���E2�C����<���%�����'jc:�%�� �����S$�D|���0��Ih^QJ~j��;���Q���S�Z��w� ��ʦx"�>� _��-�>��5��s��[ש�>���^&�v��Lyl���A�R#���_�6e���L�����)Ni���x�YKj�q���N��ש��7!���Gw�Kn5�~�U���$ZD����e�&���0�6�t�5�ag|��� _��|��U�ݰ�C�G�-����,�}�i��w��az,_ZF�����m�|�⫅����dD-i�L��E��a?�"��������D�n��f�X��3�R�iyl_�>��;��;�v.���գ�����s��Lw�V_��<�G�(��f]R)Dl��2KxmT�E3�$'����^�G�ǐ��lwV��)��t���jm�_zO_�O�+4�.㥋˺z�$�׺���~��e���n�����=���r������9��:�x&�+k�eOM;z���u�X������6��1t��"����z�f��:�����;�b�Q���mu��p��I�Z���.��8�����������d��=����HJ �zlG�39�)x&��0�<@A�E��i����#�o���5�A�#б�v�-�E�B|>�%�6��jL��D �dVA�^Q�L��3�B���s�����;�c��\9�\ı^�����_I�������pW�(���:���0/��ĔW �Fy&�o.Itp_u_YYL�R�!��E�\W��D�L�V����F�<��"�:�<=/"n�9�e�E;�- y�k��ӟT�_%��ԽL�|b2 �y���r��5��b��N�Z} �6�b�LD�MAd�Q��%������(��;x �t0�����n."�M�q���j����<�6�co�b�F�tGQ��i>������'J�&Źۼ�q.ҫ�5���ʭd?��j�7i��z�Q:�<����/���rΞ��'>��"j ��6�4�g�Ҭ�����d��БQ�㹭�w�� t����Ly�|'OJ��J�����}�����-7 \�|iB ���=��T!�P��ư�%;��hv�E^�s��e_|���Z_�����K>����<�u�������������dy"ϩ����Q���������2�׵�O�v�\�Z������kۋ�H)*����c���z��4���r�h��΂\J�q��f�w����]^�!�'c��z4l�sJ�_�\Nb��p�\����s�c����%����{��<F"�M0[��t����� ���������6�˲�����#���u���X?���WG��]���� ���h��
;���˷.��O"p�#���{n(w��A��5��0l!�z�I~fs�����r_~�څ���U����%rgr��]o+�+�ǚ_������|W�c�)m�y��������:"��
��D
"����H��)��D
"�@� R�)�����H�@� RD
"����H��)��D
"�@��p��;
��/1,�I����@-��O�IEND�B`�
request.scheme was set to https
request.path was set to /prod-user-uploaded-images/MENU-ITEM-IMAGES/7ebdc1fd4ef261154d5dddbc958dcb48534b6d27.png

-> Entering step build, name ''

request.instance changed from 0000000064a40c39000000004c9763f1 to 0000000064a40c37000000004c9763f1
request.headers.User-Agent was set to array(1) {
[0]=>
string(17) "aws-sdk-php/3.8.2"
}

-> Entering step build, name 's3.checksum'

no changes

-> Entering step build, name 's3.content_type'

request.instance changed from 0000000064a40c37000000004c9763f1 to 0000000064a40c34000000004c9763f1
request.headers.Content-Type was set to array(1) {
[0]=>
string(9) "image/png"
}

-> Entering step sign, name 'retry'

no changes

-> Entering step sign, name 'signer'

request.instance changed from 0000000064a40c34000000004c9763f1 to 0000000064a40c17000000004c9763f1
request.headers.X-Amz-Content-Sha256 was set to array(1) {
[0]=>
string(64) "08879a5305494cc0c099361f1b65cd58215a4b8551cc675f78fd6d2de276972d"
}

request.headers.X-Amz-Date was set to array(1) {
[0]=>
string(16) "20151028T033355Z"
}

request.headers.Authorization was set to array(1) {
[0]=>
string(251) "AWS4-HMAC-SHA256 Credential=app/console doctrine:migaP7JAKIAIYSKALZTFUU3A/20151028/ap-southeast-1/s3/aws4_request, SignedHeaders=host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=[SIGNATURE]
}

-> Entering step sign, name 's3.put_object_url'

no changes

-> Entering step sign, name 's3.permanent_redirect'

no changes

  • Hostname was NOT found in DNS cache
  • Trying 54.231.243.138...
  • Connected to s3-ap-southeast-1.amazonaws.com (54.231.243.138) port 443 (FIX Changed session IDs now have data written #822)
  • successfully set certificate verify locations:
  • CAfile: none
    CApath: /etc/ssl/certs
  • SSL connection using ECDHE-RSA-AES128-SHA
  • Server certificate:
  • subject: C=US; ST=Washington; L=Seattle; O=Amazon.com, Inc.; OU=S3-B; CN=*.s3-ap-southeast-1.amazonaws.com
  • start date: 2015-08-04 00:00:00 GMT
  • expire date: 2015-12-31 23:59:59 GMT
  • subjectAltName: s3-ap-southeast-1.amazonaws.com matched
  • issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of use at https://www.verisign.com/rpa (c)10; CN=VeriSign Class 3 Secure Server CA - G3
  • SSL certificate verify ok.

PUT /prod-user-uploaded-images/MENU-ITEM-IMAGES/7ebdc1fd4ef261154d5dddbc958dcb48534b6d27.png HTTP/1.1
Host: s3-ap-southeast-1.amazonaws.com
x-amz-acl: public-read
Content-Type: image/png
X-Amz-Content-Sha256: 08879a5305494cc0c099361f1b65cd58215a4b8551cc675f78fd6d2de276972d
X-Amz-Date: 20151028T033355Z
Authorization: AWS4-HMAC-SHA256 Credential=app/console doctrine:migaS3/20151028/ap-southeast-1/s3/aws4_request, SignedHeaders=host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=[SIGNATURE]
User-Agent: aws-sdk-php/3.8.2 GuzzleHttp/6.1.0 curl/7.35.0 PHP/5.5.9-1ubuntu4.11
Content-Length: 4198

  • upload completely sent off: 4198 out of 4198 bytes
    < HTTP/1.1 400 Bad Request
    < x-amz-request-id: C92EB847871E8801
    < x-amz-id-2: H8vjDCd7FsIUFGWUiwUhB9l2286SRT8k+bdecNY4hUEYjYrPjLPHBKXJuCNh7Zxk2roXx6VY+xs=
    < Content-Type: application/xml
    < Transfer-Encoding: chunked
    < Date: Wed, 28 Oct 2015 03:34:56 GMT
    < Connection: close
  • Server AmazonS3 is not blacklisted
    < Server: AmazonS3
    <
  • Closing connection 822

<- Leaving step sign, name 's3.permanent_redirect'

error was set to array(13) {
["instance"]=>
string(32) "0000000064a40ce4000000004c91fab1"
["class"]=>
string(28) "Aws\S3\Exception\S3Exception"
["message"]=>
string(750) "Error executing "PutObject" on "https://s3-ap-southeast-1.amazonaws.com/prod-user-uploaded-images/MENU-ITEM-IMAGES/7ebdc1fd4ef261154d5dddbc958dcb48534b6d27.png"; AWS HTTP error: Client error: 400 AuthorizationHeaderMalformed (client): The authorization header is malformed; the Credential is mal-formed; expecting "/YYYYMMDD/REGION/SERVICE/aws4_request". -
AuthorizationHeaderMalformedThe authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".C92EB847871E8801H8vjDCd7FsIUFGWUiwUhB9l2286SRT8k+bdecNY4hUEYjYrPjLPHBKXJuCNh7Zxk2roXx6VY+xs="
["file"]=>
string(73) "/home/ubuntu/www/shifoo/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php"
["line"]=>
int(152)
["trace"]=>
string(3394) "#0 /home/ubuntu/www/shifoo/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(76): Aws\WrappedHttpHandler->parseError(Array, Object(GuzzleHttp\Psr7\Request), Object(Aws\Command))
#1 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(199): Aws\WrappedHttpHandler->Aws{closure}(Array)
#2 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(170): GuzzleHttp\Promise\Promise::callHandler(2, Array, Array)
#3 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/RejectedPromise.php(40): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}(Array)
#4 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/TaskQueue.php(60): GuzzleHttp\Promise\RejectedPromise::GuzzleHttp\Promise{closure}()
#5 /home/ubuntu/www/shifoo/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(96): GuzzleHttp\Promise\TaskQueue->run()
#6 /home/ubuntu/www/shifoo/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(123): GuzzleHttp\Handler\CurlMultiHandler->tick()
#7 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(240): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#8 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(217): GuzzleHttp\Promise\Promise->invokeWaitFn()
#9 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(261): GuzzleHttp\Promise\Promise->waitIfPending()
#10 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(219): GuzzleHttp\Promise\Promise->invokeWaitList()
#11 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(261): GuzzleHttp\Promise\Promise->waitIfPending()
#12 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(219): GuzzleHttp\Promise\Promise->invokeWaitList()
#13 /home/ubuntu/www/shifoo/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#14 /home/ubuntu/www/shifoo/vendor/aws/aws-sdk-php/src/AwsClient.php(202): GuzzleHttp\Promise\Promise->wait()
#15 /home/ubuntu/www/shifoo/vendor/aws/aws-sdk-php/src/AwsClient.php(167): Aws\AwsClient->execute(Object(Aws\Command))
#16 /home/ubuntu/www/shifoo/src/Sequoia/HackBundle/Manager/MenuItemManager.php(485): Aws\AwsClient->__call('putObject', Array)
#17 /home/ubuntu/www/shifoo/src/Sequoia/HackBundle/Manager/MenuItemManager.php(485): Aws\S3\S3Client->putObject(Array)
#18 /home/ubuntu/www/shifoo/src/Sequoia/HackBundle/Controller/MenuItemController.php(338): Sequoia\HackBundle\Manager\MenuItemManager->addFile(Array, Object(Symfony\Component\HttpFoundation\FileBag), '114')
#19 [internal function]: Sequoia\HackBundle\Controller\MenuItemController->postMenuitemImageAction()
#20 /home/ubuntu/www/shifoo/app/bootstrap.php.cache(2974): call_user_func_array(Array, Array)
#21 /home/ubuntu/www/shifoo/app/bootstrap.php.cache(2936): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#22 /home/ubuntu/www/shifoo/app/bootstrap.php.cache(3085): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /home/ubuntu/www/shifoo/app/bootstrap.php.cache(2335): Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /home/ubuntu/www/shifoo/web/app_dev.php(14): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#25 {main}"
["type"]=>
string(6) "client"
["code"]=>
string(28) "AuthorizationHeaderMalformed"
["requestId"]=>
string(16) "C92EB847871E8801"
["statusCode"]=>
int(400)
["result"]=>
NULL
["request"]=>
array(6) {
["instance"]=>
string(32) "0000000064a40c17000000004c9763f1"
["method"]=>
string(3) "PUT"
["headers"]=>
array(8) {
["X-Amz-Security-Token"]=>
string(7) "[TOKEN]"
["Host"]=>
array(1) {
[0]=>
string(31) "s3-ap-southeast-1.amazonaws.com"
}
["x-amz-acl"]=>
array(1) {
[0]=>
string(11) "public-read"
}
["User-Agent"]=>
array(1) {
[0]=>
string(17) "aws-sdk-php/3.8.2"
}
["Content-Type"]=>
array(1) {
[0]=>
string(9) "image/png"
}
["X-Amz-Content-Sha256"]=>
array(1) {
[0]=>
string(64) "08879a5305494cc0c099361f1b65cd58215a4b8551cc675f78fd6d2de276972d"
}
["X-Amz-Date"]=>
array(1) {
[0]=>
string(16) "20151028T033355Z"
}
["Authorization"]=>
array(1) {
[0]=>
string(251) "AWS4-HMAC-SHA256 Credential=app/console doctrine:migaS3AccessKey/20151028/ap-southeast-1/s3/aws4_request, SignedHeaders=host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=[SIGNATURE]
}
}
["body"]=>
string(4198) "�PNG

IHDR�Rh���Cx��tEXtSoftwareAdobe ImageReadyq�e<��IDATx��]�q�;��Y�/]/�O{4�������Ed�"#�����H]�*��"�uܓf��Z��v������g�;�����,���ht���
!H����
=H�/:��$O�ϐ���;��B� R�It��
�3��$��$����(���(���("��("�$
"�$�>���.á��a���������Y����/��#��������/ճ��uն��2���!��e���O�s�s,@�q�K �y���Rq���7 �ܝ�G�U;�5ߝW��TO^�׉���w/��������4�{��{r�>����g5�|]��w�0�:qbU?��Ǣ�NL�}��G~;��<��Ho��BB�������I��s�yp,BcEZ��4���& ���Tϵp�B����z�M8�=�w��<��w�N�fL��D����<��a�Gf:u�-���KGvJD�E�C���s�+&ԍ��� �]�?��莢}�}����h������"�Y���l�����g�c��T6�hpH ��A{g���ܾWGJE��Z����^���b�8�MF�X}�]�w�;�����3��c�Hԇ�����;�g׳�I����L� R[%��P=�L�NdTcZE��D�� ��/'��q��դ%�3I�Dى-�rb�I��g] RG����;Y(�У�t������(�����Di���Yد��� ҇�T���OF�M�Roh����5�H���k��)�f���L����2R���������(�C��<F&����?۵n!m2����SV�Fk?�>N����R������ƃ"����m[cL�DY��Z2�����sc����-�����Y������� &����1�T����Ecq�Аs�(H��F���N������\����($��F�0�WMc��Ԝ����� ������$�2�?S����Rz�me������}�Qɟ;�ʯ����4��S��M�xYF.��v}:E��H�'�L��ka�"�Ւ ����Sn�"n�������M�>g�r-B�����'���7���J����7:�|��B_���@o�^B��NҼb�r��~�!>�E��e�Dq��|q8���ov(yX������F���k� �F2I$�3$������� ���v�7�
9����-L�\�����$O���;�Z5$ؙ���d�-�u��/JN�.����"���
2KC�^ǐ �t�'��0���F��(���g�A���<}dqR���{Y�l�5��ϥ�R�3��)�)�pmָ����2׵��:����o���W���w2D�#��&��_��pOħ�H��������R�� &R���G89"6! ө���,�D.]�%d}����L�ɢ�r�!�M�?����������^�|�)�������%�o؀ז}�(��f��do|�p,�����ИM#���4?G��;L�tW�o����,���#��D��0������xl���EW.]�M�;�yJoJ�R�}T��Uh�'f��;��+���T$�>ؑ�L�y���(�[��?������z�u������4�L��ҙKO̎��H�_5��o�����2�>�EZ�3Էq@�7�.��{tj�K.�����V���nd?�D<�����pT�;�,�O��������u(�u@��G�����/���ʈ�)���)S�����"I�_�T�7���0������)?�S�����S�C��;[/?��-7CZ����u����E���h4�����#��� �H)�hT����\�r7 �.��)��JI��)���}M�h��@���6�b�DS��=�tf0�� ���$�� /gq0�����m:��0�U�#O���B�A��o߱�<���BwưF4����)�1,gQȷ$謩绸1D�i�1)?x6ԃ^9�]۶�)�Y3r�if�ۖ�ѩ�'�/����ئQLd:�1s��'G����g�}�?�a����1�j�El�'�ԙ'����Hh������Rޘ�d�Bc��6��E�/�B���
��1�z?f��D�Q9/������;�� �NM��?��td���S��"�2}�z��]��qg#>���)/���#�����@�.�6��qd8��ࡍ���u�e�#�X��MM3��V�5�w\��U��^זH7��>��T�/�����H�5=S���T�e^5ȶ�]�D���s�y%��77��is�_r�82&���z��}�e�;e+໽&J�9i!������-���6\D�&�
]�Զ�j��@�,o����̔�!U��������;�1�?�M
@o��)�����<�B����
��}�?�SD�vd��p_$JQ��U�t��)��ŀ�N�RL;sA����ưq�A�w�ͭ0+hm|a�#]�bܣF���?l_��H閿��g�y���|Djx�$�����S'�0�T<���A�Y�fm��Y�_"j�k�+Mr�ߕ�v����v�S?
c@�?����ym�����M�����k����D�/թe9��K��Wu���3MoT�l�\ GgLȉ���R����F�R����9����:9��e���JU/�[�"�DH�d�SRp��²��P.�)��wY�b�����8�(������1��=���c�I�������\6���#]G���>���B���ch4�H�.8�i���Ҏ��G,b��8��Օk��B�tR����T�!܈��c���y����n���7�[OW^#�c̯$u������� o4�D�����-"��#����)����t��ط�� �I�7"��2���� �-�hO#�m��NO&N��ņ���o��Ջ�on6%�G���-���E2�C����<���%�����'jc:�%�� �����S$�D|���0��Ih^QJ~j��;���Q���S�Z��w� ��ʦx"�>� _��-�>��5��s��[ש�>���^&�v��Lyl���A�R#���_�6e���L�����)Ni���x�YKj�q���N��ש��7!���Gw�Kn5�~�U���$ZD����e�&���0�6�t�5�ag|��� _��|��U�ݰ�C�G�-����,�}�i��w��az,_ZF�����m�|�⫅����dD-i�L��E��a?�"��������D�n��f�X��3�R�iyl_�>��;��;�v.���գ�����s��Lw�V_��<�G�(��f]R)Dl��2KxmT�E3�$'����^�G�ǐ��lwV��)��t���jm�_zO_�O�+4�.㥋˺z�$�׺���~��e���n�����=���r������9��:�x&�+k�eOM;z���u�X������6��1t��"����z�f��:�����;�b�Q���mu��p��I�Z���.��8�����������d��=����HJ �zlG�39�)x&��0�<@A�E��i����#�o���5�A�#б�v�-�E�B|>�%�6��jL��D �dVA�^Q�L��3�B���s�����;�c��\9�\ı^�����_I�������pW�(���:���0/��ĔW �Fy&�o.Itp_u_YYL�R�!��E�\W��D�L�V����F�<��"�:�<=/"n�9�e�E;�- y�k��ӟT�_%��ԽL�|b2 �y���r��5��b��N�Z} �6�b�LD�MAd�Q��%������(��;x �t0�����n."�M�q���j����<�6�co�b�F�tGQ��i>������'J�&Źۼ�q.ҫ�5���ʭd?��j�7i��z�Q:�<����/���rΞ��'>��"j ��6�4�g�Ҭ�����d��БQ�㹭�w�� t����Ly�|'OJ��J�����}�����-7 \�|iB ���=��T!�P��ư�%;��hv�E^�s��e_|���Z_�����K>����<�u�������������dy"ϩ����Q���������2�׵�O�v�\�Z������kۋ�H)*����c���z��4���r�h��΂\J�q��f�w����]^�!�'c��z4l�sJ�_�\Nb��p�\����s�c����%����{��<F"�M0[��t����� ���������6�˲�����#���u���X?���WG��]���� ���h��
;���˷.��O"p�#���{n(w��A��5��0l!�z�I~fs�����r_~�څ���U����%rgr��]o+�+�ǚ_������|W�c�)m�y��������:"��
��D
"����H��)��D
"�@� R�)�����H�@� RD
"����H��)��D
"�@��p��;
��/1,�I����@-��O�IEND�B`�"
["scheme"]=>
string(5) "https"
["path"]=>
string(88) "/prod-user-uploaded-images/MENU-ITEM-IMAGES/7ebdc1fd4ef261154d5dddbc958dcb48534b6d27.png"
}
["response"]=>
array(4) {
["instance"]=>
string(32) "0000000064a40c2e000000004c9763f1"
["statusCode"]=>
int(400)
["headers"]=>
array(8) {
["X-Amz-Security-Token"]=>
string(7) "[TOKEN]"
["x-amz-request-id"]=>
array(1) {
[0]=>
string(16) "C92EB847871E8801"
}
["x-amz-id-2"]=>
array(1) {
[0]=>
string(76) "H8vjDCd7FsIUFGWUiwUhB9l2286SRT8k+bdecNY4hUEYjYrPjLPHBKXJuCNh7Zxk2roXx6VY+xs="
}
["Content-Type"]=>
array(1) {
[0]=>
string(15) "application/xml"
}
["Transfer-Encoding"]=>
array(1) {
[0]=>
string(7) "chunked"
}
["Date"]=>
array(1) {
[0]=>
string(29) "Wed, 28 Oct 2015 03:34:56 GMT"
}
["Connection"]=>
array(1) {
[0]=>
string(5) "close"
}
["Server"]=>
array(1) {
[0]=>
string(8) "AmazonS3"
}
}
["body"]=>
string(382) "
AuthorizationHeaderMalformedThe authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".C92EB847871E8801H8vjDCd7FsIUFGWUiwUhB9l2286SRT8k+bdecNY4hUEYjYrPjLPHBKXJuCNh7Zxk2roXx6VY+xs="
}
}

Inclusive step time: 0.06715989112854

<- Leaving step sign, name 's3.put_object_url'

no changes
Inclusive step time: 0.067346096038818

<- Leaving step sign, name 'signer'

no changes
Inclusive step time: 0.067626953125

<- Leaving step sign, name 'retry'

no changes
Inclusive step time: 0.068167924880981

<- Leaving step build, name 's3.content_type'

no changes
Inclusive step time: 0.068434953689575

<- Leaving step build, name 's3.checksum'

no changes
Inclusive step time: 0.068613052368164

<- Leaving step build, name ''

no changes
Inclusive step time: 0.068833112716675

<- Leaving step build, name 'builder'

no changes
Inclusive step time: 0.069123983383179

<- Leaving step validate, name 'validation'

no changes
Inclusive step time: 0.069763898849487

<- Leaving step init, name 's3.location'

no changes
Inclusive step time: 0.070501089096069

<- Leaving step init, name 's3.save_as'

no changes
Inclusive step time: 0.07062816619873

<- Leaving step init, name 's3.source_file'

no changes
Inclusive step time: 0.070780992507935

<- Leaving step init, name 's3.ssec'

no changes
Inclusive step time: 0.071077823638916

"Error executing "PutObject" on "https://s3-ap-southeast-1.amazonaws.com/prod-user-uploaded-images/MENU-ITEM-IMAGES/7ebdc1fd4ef261154d5dddbc958dcb48534b6d27.png"; AWS HTTP error: Client error: 400 AuthorizationHeaderMalformed (client): The authorization header is malformed; the Credential is mal-formed; expecting "/YYYYMMDD/REGION/SERVICE/aws4_request". - \nAuthorizationHeaderMalformed</Code>The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4_request".</Message>C92EB847871E8801</RequestId>H8vjDCd7FsIUFGWUiwUhB9l2286SRT8k+bdecNY4hUEYjYrPjLPHBKXJuCNh7Zxk2roXx6VY+xs=</HostId></Error>"
``

@jeskew
Copy link
Contributor

jeskew commented Oct 28, 2015

The auth header captured is: Authorization: AWS4-HMAC-SHA256 Credential=app/console doctrine:migaS3/20151028/ap-southeast-1/s3/aws4_request, SignedHeaders=host;x-amz-acl;x-amz-content-sha256;x-amz-date, Signature=[SIGNATURE].

Is 'app/console doctrine:migaS3' somehow being set as the AWS_ACCESS_KEY_ID environment variable?

@amitchhajer
Copy link

Yes right. I messed up a little in parameters. My bad.
Thanks for the help.

@IamAbhiKaushik
Copy link

Hey, can you tell me how did you solve the error?

@KevinM2k
Copy link

For me, the error was simply having the key as 'credentials'. It should be 'credential' without the s on the end.

@diehlaws diehlaws removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Apr 25, 2019
@nitish-predera
Copy link

I was having same issue in elasticsearch S3 repository plugin. It turns out my access key was incorrect. Remember to verify your credentials for any typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants