You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
java.lang.RuntimeException: General Error on signed upload with chunk_size option #148
When the size of the uploading file is bigger then chunk_size option I'm getting the following error
java.lang.RuntimeException: General Error
at com.cloudinary.android.UploaderStrategy.callApi(UploaderStrategy.java:145)
at com.cloudinary.Uploader.callApi(Uploader.java:34)
at com.cloudinary.Uploader.uploadLargeParts(Uploader.java:218)
at com.cloudinary.Uploader.uploadLarge(Uploader.java:149)
at com.cloudinary.android.DefaultRequestProcessor.doProcess(DefaultRequestProcessor.java:223)
at com.cloudinary.android.DefaultRequestProcessor.processRequest(DefaultRequestProcessor.java:87)
at com.cloudinary.android.MediaManager.processRequest(MediaManager.java:441)
at com.cloudinary.android.AndroidJobStrategy$UploadJob.onRunJob(AndroidJobStrategy.java:264)
at com.evernote.android.job.Job.runJob(Job.java:124)
at com.evernote.android.job.JobExecutor$JobCallable.runJob(JobExecutor.java:183)
at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:168)
at com.evernote.android.job.JobExecutor$JobCallable.call(JobExecutor.java:151)
Hi @dimaportenko
Thank you very much for reporting this issue.
Can you please try to run your code with the following: MediaManager.get().getCloudinary().uploader().uploadLarge(file, options)
So I did more testing and I can confirm that unsigned upload works just fine. But signed request gives me a general error from the original message of this GitHub issue. It's same for
You are trying to develop the SDK for React native using our Android SDK
You are trying to upload a large file (less than 100 MB)
You are trying to sign the request (please share with us how do you do that in your ticket).
In order for us to be able to reproduce the issue, we need every piece of information.
Once you open that ticket with more info, we will be able to escalate it internally.
Please confirm that what we understand is correct - that you try to create a React Native library using our Android SDK (this might be important for the solution).
We are waiting for your ticket,
Thanks a lot,
Tamara
We're still waiting on news from the internal team. Could you follow up on a ticket for this issue so we can keep the line of communication open there?
@tommyg-cld the issue is still the same. From internal support discussion, it's related to the callback_url and
The iOS SDK sends a header called X-Requested-With with the value XMLHttpRequest while the Android SDK does not. When using the callback parameter, that is only honoured for requests that aren't XHR-based (i.e. XMLHttpRequest). This is why the uploads redirect on Android but not on iOS. If the callback parameter was not being utilised then requests from both SDKs would not need to redirect as that won't be relevant anymore.
I suggest the following if you are going to add a solution like add header X-Requested-With with the value XMLHttpRequest to the Android SDK. then you can close after the change. In case you are not going to fix it you can also close it, so it will not bother you.
@dimaportenko thx for the update, yes we have an internal ticket to add header X-Requested-With with the value XMLHttpRequest to the Android SDK so we will keep you posted.
Activity
tommyg-cld commentedon Sep 21, 2022
Can you confirm you are using upload_large method which is required for files larger than 100MB, this method also lets you set the chunk size. See https://cloudinary.com/documentation/upload_images#chunked_asset_upload
dimaportenko commentedon Sep 21, 2022
I can confirm there is no such method
upload_large. I searched for it but had no luck.here is sdk source code
dimaportenko commentedon Sep 21, 2022
Please check my source code (upload method) and help me to apply
upload_largehttps://github.com/gosourcellc/react-native-cloudinary-sdk/blob/main/android/src/main/java/com/reactnativecloudinarysdk/CloudinarySdkModule.javadimaportenko commentedon Sep 21, 2022
Also, I'm using files less than 100MB.
adimiz1 commentedon Sep 21, 2022
Hi @dimaportenko
Thank you very much for reporting this issue.
Can you please try to run your code with the following:
MediaManager.get().getCloudinary().uploader().uploadLarge(file, options)dimaportenko commentedon Sep 23, 2022
Ok, I think I was able to do upload like this
How can I get
requesIdhere? I would like to be able to cancel https://cloudinary.com/documentation/android_image_and_video_upload#cancel_an_uploadtommyg-cld commentedon Sep 23, 2022
Hi @dimaportenko , the request id should be included in the response header we send back.
Please let me know if you have any other questions or queries.
Kind Regards,
Thomas
dimaportenko commentedon Sep 23, 2022
@tommyg-cld can you share a code sample? Not sure how to use it. And I'm not able to find it in the documentation.
tommyg-cld commentedon Sep 23, 2022
@dimaportenko so you will need to use the dispatch method and this should return the request id per https://cloudinary.com/documentation/android_image_and_video_upload#mediamanager_upload_method
e.g.
String requestId = MediaManager.get().upload("imageFile.jpg").dispatch();dimaportenko commentedon Sep 23, 2022
@tommyg-cld I'm completely confused. I'm using this one
but I have the error, please see the first message of the thread. And you asked me to use https://cloudinary.com/documentation/upload_images#chunked_asset_upload which doesn't exist. Then @adimiz1 said I have to use
It works for upload but there is no request Id. So I can't cancel it. Please help me, I don't understand
tommyg-cld commentedon Sep 23, 2022
@dimaportenko apologies, that was just an example,
does the below work?
String requestId = MediaManager.get().getCloudinary().uploader().uploadLarge(file, options).dispatch();dimaportenko commentedon Sep 23, 2022
Nope.
uploadLargereturnMapand it hasn'tdispatchmethod.dimaportenko commentedon Sep 26, 2022
Also, this one isn't working for signed request
tommyg-cld commentedon Sep 26, 2022
@dimaportenko let me check internally with the team and will get back to you.
dimaportenko commentedon Sep 28, 2022
So I did more testing and I can confirm that unsigned upload works just fine. But signed request gives me a general error from the original message of this GitHub issue. It's same for
The error message doesn't give any tips. Can you help me with what is wrong here?
tommyg-cld commentedon Sep 28, 2022
@dimaportenko apologies for the delay in getting back.
So right now dispatch is not supported with upload_large, the request-id will only return when using the MediaManager object to upload. e.g.
MediaManager.get().upload("imageFile.jpg").dispatch();We are checking further if we can support it.
Regarding the general error, please could you give us exactly how you sign your requests? I'm seeing a NoMethodError exception in our logs.
Also incase you didn't read it yet, here is how to setup signed upload: https://cloudinary.com/documentation/android_image_and_video_upload#signed_upload
dimaportenko commentedon Sep 28, 2022
It works fine if file size less then
chunk_size. If file size is bigger then I'm gettingGeneral Errorcloudinary.uploader().uploadLargeabove doesn't work. I'm getting api_key missing. So I have to add following to the optionsAnd the same thing here I can upload just fine if the file size less then
chunk_size. And I'm getting 'General Error' if bigger.tommyg-cld commentedon Sep 29, 2022
@dimaportenko we are taking a look so will get back asap.
tamaracloudinary commentedon Oct 2, 2022
Hi @dimaportenko,
Can you please open a support ticket here: https://support.cloudinary.com/hc/en-us/requests/new with your cloud name and include more information on this?
This is what we know so far:
In order for us to be able to reproduce the issue, we need every piece of information.
Once you open that ticket with more info, we will be able to escalate it internally.
Please confirm that what we understand is correct - that you try to create a React Native library using our Android SDK (this might be important for the solution).
We are waiting for your ticket,
Thanks a lot,
Tamara
dimaportenko commentedon Oct 25, 2022
Hi there, any updates?
rnamba-cloudinary commentedon Oct 26, 2022
Hey @dimaportenko,
We're still waiting on news from the internal team. Could you follow up on a ticket for this issue so we can keep the line of communication open there?
dimaportenko commentedon Oct 26, 2022
It's already a month passed already and no updates. It doesn't look like anybody working on this issue.
I didn't get any updates there, doesn't look helpful to me.
tamaracloudinary commentedon Nov 15, 2022
Hi @dimaportenko, I replied to the ticket you opened.
Let's continue this thread there.
tommyg-cld commentedon May 9, 2023
@dimaportenko just following up to see if this is still an issue? let me know if its ok to close out.
dimaportenko commentedon May 9, 2023
@tommyg-cld the issue is still the same. From internal support discussion, it's related to the
callback_urlandI suggest the following if you are going to add a solution like
add header X-Requested-With with the value XMLHttpRequest to the Android SDK. then you can close after the change. In case you are not going to fix it you can also close it, so it will not bother you.tommyg-cld commentedon May 10, 2023
@dimaportenko thx for the update, yes we have an internal ticket to
add header X-Requested-With with the value XMLHttpRequest to the Android SDKso we will keep you posted.