Skip to main content

How can I increase the timeout when uploading to Cloudinary?

Comments

16 comments

  • Digiphoto Entertainment Imaging

    Hi,

    How set this limit in .NET?

    Thanks

    0
  • Nadav Ofir

    Changing the timeout on our .NET libraries is still not supported. Default value is 100000 milliseconds (=100 seconds).
    As the libraries currently use the WebRequest class for HTTP client, you can dive into the code to implement this on your own. We will update here once it becomes officially supported.

    UPDATE: customizing timeout within our .NET libraries is now supported as well.

    0
  • Navjeet Sandhu

    Hey nadav, the node.js update that you just added has an error in syntax. The {timeout:60000} is supposed to come after the callback function

    0
  • Nadav Ofir

    Hi Navjeet, this syntax relates to the .v2 syntax, e.g.:
    var cloudinary = require('cloudinary').v2;

    0
  • Kathy Smith

    What time unit is the timeout measured in? In some examples it's 60, others 60000. I assume 60 is in seconds, but 60000 is milliseconds? Why is the unit different between different languages?

    Is it possible to set a default timeout anywhere? Using Django Admin's CloudinaryField it doesn't seem like it's easy to override a timeout since we don't directly access the uploader.

    0
  • Ido

    Hi Richard.

     

    There is currently no way to implement a global timeout like you say.

    We do have an open request with our dev team to allow more access in CloudinaryField and the timeout is one of them.
    As soon as there are any insights regarding this I would let you know.

    The implementation in seconds and milliseconds is different because the languages and SDKs are different, Some of our libraries perfromed better with milliseconds implementation so we chose that.
    In other cases the default was seconds so we wanted to conform to the default.

     

    Hope that helps.

    0
  • Said Roohullah

    Hi Nadav,

    I got this error:
    'stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException'
     
    I have used: <PackageReference Include="CloudinaryDotNet" Version="1.14.0" />
     
    How can I solve this problem?
     

     

    0
  • Aditi Madan

    Hi Said,

    We will need more information in order to investigate this issue. Can you please share the code snippet and your cloud name and we will be able to check further. If privacy is a concern, then please feel free to open a support ticket at support@cloudinary.com.

    Regards,

    Aditi

    0
  • Aleksandar Kostadinov

    Hi Said,

    Thanks for sharing that.

    Looking at the code, the one thing that may cause timeouts from the Cloudinary side, depending on the size of the file you are uploading, is the fact you're requesting an incoming transformation based on the following line: https://github.com/jahanalem/DatingApp/commit/dc880a46cb22b505a824b6612a67c4279e87d37d#diff-56a13120aebd0d27d86b06af7efb1b1d5cec2bb5f26f0df337f061392c940cb3R36

    Since you aren't passing the 'Async' parameter set to true this transformation is attempted to be run synchronously on Cloudinary which will increase the processing time and that may be the cause of the errors you're seeing.

    The ` UploadAsync` method makes the upload async on the client-side meaning your code doesn't stall until it gets a response, but this doesn't control the sync vs async processing of the transformation on Cloudinary.

    As a first step, may I please ask you to pass the 'Async' parameter set to true in your `ImageUploadParams` and test again?

    In addition, from the error you are receiving, I suspect the timeout isn't coming from the SDK but rather coming from the line before the upload: https://github.com/jahanalem/DatingApp/commit/dc880a46cb22b505a824b6612a67c4279e87d37d#diff-56a13120aebd0d27d86b06af7efb1b1d5cec2bb5f26f0df337f061392c940cb3R32

    Could you also please verify that there is data coming through on that stream?

    Lastly, could you try uploading by passing the path to that file from disk rather than a stream, does that work?

    0
  • Samrat Shahajahan

    Thanks it's work..

    0
  • Ionut

    Hello everyone,

    What version of sdk for nodejs do we have timeout property? Version 1.23.0 doesn't have that timeout property.

    0
  • Igor Vorobeychik

    Hi,

    Thanks for reaching out.
    Let me check the exact version, but can you expand on the type of error you are getting and what size of assets are you uploading to Cloudinary?

    Best regards,
    Igor

    0
  • Jackie Catania

    Hi, 

    It appears that v1.23 should support a "timeout"parameter - please implement the following: cloudinary.v2.uploader.upload('my_image.jpg', {timeout:60000}, function(error,result){});

    If you are running into any issues, could you please provide us with your code so that we can troubleshoot deeper? 

    Thanks, 
    Jackie

    0
  • Ionut

    Hello Jackie,

    Looking in the file node_modules/cloudinary/types/index.d.ts the interface UploadApiOptions doesn't contain timeout.

    The error that I am getting is 
    error: { message: 'Timeout waiting for parallel processing.', name: 'Error', http_code: 420 }.

    Currently I am using v1.23. 

    Kind regards,

    Ionut

    0
  • Kushal Chawla

    Hi Ionut,
    Thanks for sending the error message, really helpful.
    What kind of asset are you trying to upload? If it's a big image/video then we recommend that you use eager_async: true as the error you're seeing is due to a previous operation that is still in progress on the asset.

    If possible can you share more details about your asset like size, type, format, and if eager_async: true helped or not?

    Thanks,
    Kushal

    0

Please sign in to leave a comment.