filestack / filestack-android

Official Android SDK for Filestack - API and content management system that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
154 stars 90 forks source link

Signature does not match error #140

Closed AbhijitKurane closed 6 years ago

AbhijitKurane commented 6 years ago

Hello, We are facing issue with error returned as below from file stack server, <Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

We are using latest lib (compile 'com.filestack:filestack-android:2.0.0-alpha.2') We are using below code to upload files,

Config config=new Config(BuildConfig.FILE_STACK_API_KEY, "","");
Client client=new Client(config);       
Flowable<Progress<FileLink>> progressFlowable = client.uploadAsync(strLocalFilePath, true);

It was working code. Don't know why suddenly this error is being faced.

Please help.

-- Thanks, Abhijit

shawnmaten commented 6 years ago

That error message is from the AWS S3 API. We upload files in parts and this message means the hash of a part isn't matching what S3 received. You shouldn't be seeing that. I'm not able to reproduce this error myself though. Could you give me specifics on the file or files you're uploading and the path you're passing into the upload call? What kind of files are they? What's the file size or range of sizes?

AbhijitKurane commented 6 years ago

Hey @shawnmaten , We are uploading the image file from SD card which can be nearly 5 MB utmost. (e.g.: /storage/emulated/0/ProjectName/IMG_20171221_161402228.jpg)

Currently we have two File Stack API key. One for production (client supplied api key) and one for development (we registered with free account for this api key) We are able to upload the files successfully with the development API key. But for production API key it fails. Development API key is linked with the free account where all the files are uploaded to default storage of File Stack. Production API key is linked with the premium account where while uploading the files we set the default storage of File Stack. But in case of production, client have S3 bucket which must have been linked with the File Stack. We think this must be causing issue. Please check.

-- Thanks, Abhijit

shawnmaten commented 6 years ago

@AbhijitKurane I'm still not able to reproduce this issue. That your seeing the S3 error is still odd to me, but if the exact same code works for one key and not another, the account configuration must have something to do with it. I would like you to open a support ticket so we can check your app settings.

AbhijitKurane commented 6 years ago

@shawnmaten , Thanks for the reply. I will open the support ticket as well as you suggested. But just wanted to highlight that the same production API key is working smoothly on iOS and for Android it is working smoothly with the development API key. For iOS platform currently developers are using library as below, pod ‘Filestack’, ‘~> 0.3.9’

Please guide.

-- Thanks, Abhijit

shawnmaten commented 6 years ago

Hi @AbhijitKurane. Have you opened a support ticket for this issue? And if so, what was the ticket number so I can reference it.

AbhijitKurane commented 6 years ago

Hello @shawnmaten , Below is the number we have received through mail. Ticket number: 24336 Please let us know if it helps.

shawnmaten commented 6 years ago

@AbhijitKurane I was finally able to reproduce the issue today. It seems to have something to do with having custom storage set. We will keep looking at it. Thanks for bringing this up.

AbhijitKurane commented 6 years ago

Hey thanks @shawnmaten . Please let us know once fixed. We have android play store released planned, please add comment here once you fix this.

shawnmaten commented 6 years ago

I've just pushed version 2.0.0-alpha.3 to Bintray. Please let me know if this fixes the issue.

AbhijitKurane commented 6 years ago

@shawnmaten Perfect! 👍 It works. Thank you.

AbhijitKurane commented 6 years ago

@shawnmaten , Just adding this note so that it can help others, Everything was working fine for the debug build but it fails for the release build. So we have added below entry in proguard file, -keep class com.filestack.** { *; }

Now it works fine.

-- Thanks, Abhijit

shawnmaten commented 6 years ago

Yes we should add instructions for ProGuard. I've made another issue for that. Thanks.