Skip to main content

I got a "Stale request" error for my upload API call, what does it mean?

Comments

12 comments

  • Tim Strietzel

    That is realy a helpful post! Thank you, Orly!

    Especially if you use VMs for development that you frequently hibernate/suspend and resume later on the VMs you can run into problems. The operating system (Ubuntu in my case) can lose track of the "real" time which leads to the error.

    Simply updating the system time of your development VM fixes the issue.

    Cheers!

    Tim

    1
  • kidkeeper

    It's not working on my own computer (not a VM).
    For some reason it doesn't take my local time and I can't set the time - it doesn't work:
    cloudinary = new Cloudinary(...);
    cloudinary.uploader().upload(file,
    ObjectUtils.asMap("timestamp", "129830123"));

    What I am doing wrong?

    P.S - It worked one time, I don't know what was changed...

    Thanks!

    0
  • emmanuel

    hello, Orly Bogler, does this mean I have to reset my time? How exactly do I solve this problem, pls?

    1
  • Maor Gariv

    Hi Emmanuel,

    Can you elaborate on your issue (provide relevant code, error message, etc.)?
    Feel free to open a new support ticket (https://support.cloudinary.com/hc/en-us/requests/new) if privacy is an issue.

    0
  • charlie

    Hi I was getting same error too.

    Here is the code:

    var uploadResult = new ImageUploadResult();

    if (file.Length >0)
    {

    using (var stream = file.OpenReadStream())
    {
    var uploadParam =newImageUploadParams()
    {
    File = new FileDescription(file.Name, stream),
    Transformation = new Transformation().Width(500).Height(500).Crop("fill").Gravity("face")
     
    };

    uploadResult = _cloudinary.Upload(uploadParam);
    }
    }
    0
  • Shirly Manor

    Hi Charlie,

    This error usually happens when the clock on the computer is not set to the right time.
    In order to provide a better feedback, can you please open a ticket at support@cloudinary.com with your cloud name and we can investigate more in this issue. 

    0
  • Jose D

    I tested image upload from my local machine (IST timing), and it works fine. Then tested the same code from development server (server timezone is UAE), I get the Stale request error. Please advice how can I solve this.

    Uncaught Cloudinary\Error: Stale request - reported time is 2019-03-13 06:03:08 +0000 which is more than 1 hour ago

    1
  • nyola mike

    Am using a php docker image for development on my local macos pc.

    and I get this same error.

    Fatal error: Uncaught Cloudinary\Error: Stale request - reported time is 2020-05-20 20:55:23 +0000 which is more than 1 hour ago in /var/www/html/bee/cloudinary/Uploader.php:559 S

    0
  • James Oduro

    I am developing an application in PHP and am gonna be using Cloudinary for all user uploads. Hopefully, upgrade to premium plan after development.

    my question on the subject error is:

    Does this mean this error will keep occurring if the user hibernates her computer and let's say return to the site in 2-3 days.??

    Am concerned with this because my application allows auto-login with cookies

    0
  • Aleksandar Kostadinov

    Hi James,

    The error is only relevant at the time the upload request is initiated from your code as that will be when the 'timestamp' parameter will be generated. If a user of your website triggers an upload then our SDKs would automatically generate the 'timestamp' as part of the signature creation and the upload request will be sent. If you're using one of our server-side SDKs to perform the uploads or if you are generating the signature right in your own code before the upload request is sent then you will not run into this case.

    0
  • Franz J Fortuny

    Those errors came up 3 years ago and now, after 7 years of never seen this error in my application (web page) it has started appearing:

    error.log:[Thu Jun 06 09:16:05.021262 2024] [:error] [pid 14384] [client 201.140.106.194:58426] PHP Fatal error:  Uncaught Cloudinary\\Error: Stale request - reported time is 2024-06-06 14:16:04 +0000 which is more than 1 hour ago in /var/www/html/ador4/phps/Uploader.php:344\nStack trace:\n#0 /var/www/html/ador4/phps/Uploader.php(63): Cloudinary\\Uploader::call_api('upload', Array, Array, '/tmp/2339536661...')\n#1 /var/www/html/ador4/gls/con1.php(347): Cloudinary\\Uploader::upload('/tmp/2339536661...', Array)\n#2 /var/www/html/ador4/gls/glenco1.php(52): sendtocloudf('teccimp', '<?xml version="...')\n#3 /var/www/html/ador4/gls/glenco1.php(26): glPolProv()\n#4 {main}\n  thrown in /var/www/html/ador4/phps/Uploader.php on line 344, referer: https://xxxxxxxxxxxx.com/index4b.html

    The code has not been changed, the server's time and time zone have not been change and the error is stopping our objects from being saved in our. From my side, nothing changed to generate this Stale Request Error. Did something change from the cloudinary side? Since June 1, it has not been possible to make it work.
     

     

    0
  • Ranson

    Hey Franz, 

    Did this request take longer than 1 hour to complete? The signatures generated are only valid for an hour, so for example during longer uploads the Signature may go stale and result in the error you're seeing. 

    If further assistance is required with this, please open up a request with us at support@cloudinary.com as we may need some additional logging information to continue our investigation. 

    0

Please sign in to leave a comment.