Skip to content

Asynchronous call times out in production #368

Description

@mishaetaya

the API works fine on localhost, but as soon as I run the async operation in production (on heroku) I get the following error after a few minutes:

Error: Total timeout exceeded before any response was received
  at Timeout._onTimeout (/app/node_modules/google-gax/lib/longrunning.js:347:11)
  at retry (/app/node_modules/google-gax/lib/longrunning.js:327:31)
   at Timer.listOnTimeout (timers.js:207:5)
   at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)

the operation.promise() never resolves. Any guidance on this?

speech.startRecognition(googleFileUrl, config)
   .then((results) => {
    const operation = results[0];
    return operation.promise();
  })
  .then((results) => {
     var transcription = results[0];
      console.log(`Transcription: ${transcription}`);
  })
  .catch((err) => {
    console.error('Transcription error:', err);
  });

Activity

  1. jmdobry commented on May 2, 2017

    @jmdobry
    Member

    How long is the audio you're analyzing?

  2. mishaetaya commented on May 3, 2017

    @mishaetaya
    Author

    Hi Jason,

    I was testing with clips less than 10 seconds. My site is https, so I discovered that was at the root of my problem. I did made it work by rerouting the post request through http...so it works now, but I guess still my question is why does it not work on a secure route?

    thank you!

  3. jmdobry commented on May 5, 2017

    @jmdobry
    Member

    Wait, were you trying to run this code in the browser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚨This issue needs some love.triage meI really want to be triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions