TkTech / ckanext-cloudstorage

Implements support for resource storage against multiple popular providers via apache-libcloud (S3, Azure Storage, etc...)
MIT License
35 stars 55 forks source link

Does not work with Apache Libcloud 2.0 #15

Closed Zharktas closed 7 years ago

Zharktas commented 7 years ago

Most likely issue with libcloud itself but with 2.0 multipart uploading gives following stacktrace:

 InvalidCredsError: u'<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><AWSAccessKeyId>AKIAJJJNQVUJXSNLU4GA</AWSAccessKeyId><StringToSign>AWS4-HMAC-SHA256\n20170524T140218Z\n20170524/eu-west-1/s3/aws4_request\n9cfbe41772b48e51f3a4174465e687b2358e41db68d1272bad1e28b9b97f90b4</StringToSign><SignatureProvided>aecd81a2565eb1efa44678f1a3acf760f7838b1398dac99fa4456a6147645da4</SignatureProvided><StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 37 30 35 32 34 54 31 34 30 32 31 38 5a 0a 32 30 31 37 30 35 32 34 2f 65 75 2d 77 65 73 74 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 39 63 66 62 65 34 31 37 37 32 62 34 38 65 35 31 66 33 61 34 31 37 34 34 36 35 65 36 38 37 62 32 33 35 38 65 34 31 64 62 36 38 64 31 32 37 32 62 61 64 31 65 32 38 62 39 62 39 37 66 39 30 62 34</StringToSignBytes><CanonicalRequest>POST\n/sixodp-testi-ampari/resources/56a057d5-3b57-4483-b8d9-1200ac0bbd60/book.xlsx\nuploads=\naccept-encoding:gzip,deflate\nhost:s3-eu-west-1.amazonaws.com\nuser-agent:libcloud/2.0.0 (Amazon S3 (eu-west-1))\nx-amz-content-sha256:UNSIGNED-PAYLOAD\nx-amz-date:20170524T140218Z\n\naccept-encoding;host;user-agent;x-amz-content-sha256;x-amz-date\nUNSIGNED-PAYLOAD</CanonicalRequest><CanonicalRequestBytes>50 4f 53 54 0a 2f 73 69 78 6f 64 70 2d 74 65 73 74 69 2d 61 6d 70 61 72 69 2f 72 65 73 6f 75 72 63 65 73 2f 35 36 61 30 35 37 64 35 2d 33 62 35 37 2d 34 34 38 33 2d 62 38 64 39 2d 31 32 30 30 61 63 30 62 62 64 36 30 2f 62 6f 6f 6b 2e 78 6c 73 78 0a 75 70 6c 6f 61 64 73 3d 0a 61 63 63 65 70 74 2d 65 6e 63 6f 64 69 6e 67 3a 67 7a 69 70 2c 64 65 66 6c 61 74 65 0a 68 6f 73 74 3a 73 33 2d 65 75 2d 77 65 73 74 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 0a 75 73 65 72 2d 61 67 65 6e 74 3a 6c 69 62 63 6c 6f 75 64 2f 32 2e 30 2e 30 20 28 41 6d 61 7a 6f 6e 20 53 33 20 28 65 75 2d 77 65 73 74 2d 31 29 29 0a 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3a 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44 0a 78 2d 61 6d 7a 2d 64 61 74 65 3a 32 30 31 37 30 35 32 34 54 31 34 30 32 31 38 5a 0a 0a 61 63 63 65 70 74 2d 65 6e 63 6f 64 69 6e 67 3b 68 6f 73 74 3b 75 73 65 72 2d 61 67 65 6e 74 3b 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3b 78 2d 61 6d 7a 2d 64 61 74 65 0a 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44</CanonicalRequestBytes><RequestId>2D6BF09C6C0F54B1</RequestId><HostId>hMYLnbKXuOK3qLPfsOY2uUY1KxYz+tDiOGaTWW3Q/zkCSMQlhIqcJphF6AkgLAY2SvASwDH5vbE=</HostId></Error>'
Zharktas commented 7 years ago

Works fine when I installed Libcloud 1.5 to the server.

TkTech commented 7 years ago

The switch to requests in libcloud replaces their extremely crappy home-brewed HTTP client. It's a good change, unfortunately it seems like the libcloud folks really hate tests and it's broken just about everything.

TkTech commented 6 years ago

If you need to use libcloud2 for v4 S3 support (ca-central-1, sea-* regions), a patched version is available https://github.com/TkTech/ckanext-cloudstorage/tree/libcloud2