Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEADLINE_EXCEEDED error while running the Recognize.java file from cloud speech java-docs-samples #565

Closed
shuchishah opened this issue Mar 16, 2017 · 10 comments
Assignees
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@shuchishah
Copy link

In which file did you encounter the issue?

Speech\cloud\src\main\java\com\example\speech\Recognize.java

Did you change the file? If so, how?

No

Describe the issue

image

@lesv lesv added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. SPEECH labels Mar 24, 2017
@gguuss
Copy link
Contributor

gguuss commented Mar 28, 2017

@shuchishah Please provide more information about what's going on:

  • Are you using a GCS path? Can you gcsutil ls the path you're processing?
  • Have you setup your application as described (in better detail) in the GRPC example?
  • Have you tried the GRPC samples?

Also, can you try running the QuickStart sample:

cd speech/cloud-client/ && mvn clean package -DskipTests
mvn exec:java -Dexec.mainClass=com.example.speech.QuickstartSample

@shuchishah
Copy link
Author

I have tried for GCS path as well as for local file path.
I have also tried QuickstartSample but it is giving the same error.
I have created a maven application and added gRPC dependancies.
I have these pom.xml file which adds the gRPC 1.0.3 dependancy.
image

@gguuss
Copy link
Contributor

gguuss commented Mar 31, 2017

@shuchishah The most common issue with this is authentication, have you run gcloud auth application-default login and set your project configuration to a project with the Speech API enabled?

@shuchishah
Copy link
Author

I have already set the application credentials and Speech API is also enabled.

@gguuss
Copy link
Contributor

gguuss commented Apr 3, 2017

When you run gcloud auth application-default print-access-token does it show a valid token? You can check the token using the API explorer. You should also make sure to have an absolute path for the GOOGLE_APPLICATION_CREDENTIALS environment variable if you are using that. Finally, make sure the environment you're executing your Java from is consistent with how you are checking your gcloud environment.

@gguuss
Copy link
Contributor

gguuss commented Apr 7, 2017

One more thing worth checking:

Is your sample_rate (or sample_rate_hertz) set to the correct value for your audio?

If you're setting the value lower than your actual recorded sample rate, the API will assume that several times the actual recoded length of audio needs to be processed and will take abnormally long to process requests.

@shuchishah
Copy link
Author

Yes, I have checked sample_rate of audio.The same audio is working perfectly with python environment.

@gguuss
Copy link
Contributor

gguuss commented May 5, 2017

The version of Speech you're using is outdated. Please use the following configuration in pom.xml:

<dependency>
  <groupId>com.google.cloud</groupId>
  <artifactId>google-cloud-speech</artifactId>
  <version>0.17.1-alpha</version>
</dependency>
<dependency>
  <groupId>com.google.api</groupId>
  <artifactId>gax</artifactId>
  <version>1.0.0</version>
  <exclusions>
    <exclusion> <!-- exclude an old version of Guava -->
      <groupId>com.google.guava</groupId>
      <artifactId>*</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<dependency>
  <groupId>com.google.api</groupId>
  <artifactId>gax-grpc</artifactId>
  <version>0.16.0</version>
  <exclusions>
    <exclusion> <!-- exclude an old version of Guava -->
      <groupId>com.google.guava</groupId>
      <artifactId>*</artifactId>
    </exclusion>
  </exclusions>
</dependency>

You will need to make a few changes to make your code similar to those in this PR. It may also be useful for you to try starting from the Speech Java sample as there could be other changes I'm forgetting about since 0.10.0.

@nnegrey
Copy link
Contributor

nnegrey commented Dec 5, 2018

This appears to have been resolved. Please feel free to reopen if this is not true. :)

@nnegrey nnegrey closed this as completed Dec 5, 2018
@usmanQNL
Copy link

usmanQNL commented Jul 7, 2020

I am getting the same error DEADLINE EXCEEDED. Here is a snippet of the Eror. I am running the code without any change from your example(s).

Suppressed: com.google.api.gax.rpc.AsyncTaskException: Asynchronous task failed at com.google.api.gax.rpc.ApiExceptions.callAndTranslateApiException(ApiExceptions.java:57) at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112) at com.google.cloud.texttospeech.v1.TextToSpeechClient.synthesizeSpeech(TextToSpeechClient.java:268) at com.google.cloud.texttospeech.v1.TextToSpeechClient.synthesizeSpeech(TextToSpeechClient.java:241) at com.gcp.cloudfunctions.CloudTextToSpeech.toSpeech(CloudTextToSpeech.java:78) at com.gcp.cloudfunctions.TestMain.main(TestMain.java:181) Caused by: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 19.943840244s. [buffered_nanos=1336808751, buffered_nanos=18610183072, waiting_for_connection]

I tried running it from CloudFunction but I get the same error there. The offending line (while debugging) seems to be this one.

SynthesizeSpeechResponse response = textToSpeechClient.synthesizeSpeech(input, voice, audioConfig);

Any advice?

@gguuss gguuss removed their assignment Jul 13, 2020
minherz pushed a commit that referenced this issue Nov 16, 2022
…565)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://github.com/GoogleCloudPlatform/cloud-opensource-java) | `16.4.0` -> `17.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/compatibility-slim/16.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/confidence-slim/16.4.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset).
minherz pushed a commit that referenced this issue Nov 17, 2022
…565)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://github.com/GoogleCloudPlatform/cloud-opensource-java) | `16.4.0` -> `17.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/compatibility-slim/16.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/confidence-slim/16.4.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset).
anguillanneuf pushed a commit that referenced this issue Dec 5, 2022
…565)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:libraries-bom](https://github.com/GoogleCloudPlatform/cloud-opensource-java) | `16.4.0` -> `17.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/compatibility-slim/16.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/17.0.0/confidence-slim/16.4.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-asset).
Sita04 pushed a commit that referenced this issue Feb 7, 2023
🤖 I have created a release \*beep\* \*boop\*
---
### [2.4.4](https://www.github.com/googleapis/java-dlp/compare/v2.4.3...v2.4.4) (2021-07-02)


### Bug Fixes

* Add `shopt -s nullglob` to dependencies script ([#570](https://www.github.com/googleapis/java-dlp/issues/570)) ([a48d010](https://www.github.com/googleapis/java-dlp/commit/a48d0100ece21f77bf0a097668c6b928901bb97e))
* Update dependencies.sh to not break on mac ([#565](https://www.github.com/googleapis/java-dlp/issues/565)) ([b50633b](https://www.github.com/googleapis/java-dlp/commit/b50633bb19291cffce6397e687c5ceb70cb4d425))


### Dependencies

* update dependency com.google.cloud:google-cloud-pubsub to v1.113.4 ([#569](https://www.github.com/googleapis/java-dlp/issues/569)) ([2f56edd](https://www.github.com/googleapis/java-dlp/commit/2f56eddaf8c2083ea243554703532e93c111a6d5))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#574](https://www.github.com/googleapis/java-dlp/issues/574)) ([31110da](https://www.github.com/googleapis/java-dlp/commit/31110da3cdce9882bb98d14adc49196050ac21dd))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

6 participants