Repository navigation
DEADLINE_EXCEEDED, google-cloud-vision #1887
Copy link
Copy link
Closed
Labels
api: visionIssues related to the Cloud Vision API.Issues related to the Cloud Vision API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
I am developing a Scala (2.10.6) app that uses the google-cloud-vision Java library (0.11.2-beta), but am getting the following exception: com.google.api.gax.grpc.ApiException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED
I enabled FINE logging and see the following output before the exception occurs (certain values replaced with "BLAH"):
12:46:17.083 [ForkJoinPool-1-worker-3] INFO io.grpc.internal.ManagedChannelImpl - [ManagedChannelImpl@1e18908b] Created with target vision.googleapis.com:443
[ERROR] Apr 07, 2017 12:46:17 PM io.grpc.internal.ManagedChannelImpl <init>
[ERROR] INFO: [ManagedChannelImpl@1e18908b] Created with target vision.googleapis.com:443
12:46:17.202 [ForkJoinPool-1-worker-3] INFO c.g.api.client.http.HttpTransport - -------------- REQUEST --------------
POST https://accounts.google.com/o/oauth2/token
Accept-Encoding: gzip
User-Agent: Google-HTTP-Java-Client/1.21.0 (gzip)
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 827
12:46:17.203 [ForkJoinPool-1-worker-3] INFO c.g.api.client.http.HttpTransport - curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'User-Agent: Google-HTTP-Java-Client/1.21.0 (gz
ip)' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -d '@-' -- 'https://accounts.google.com/o/oauth2/token' << $$$
12:46:17.251 [ForkJoinPool-1-worker-3] INFO c.g.api.client.http.HttpTransport - Total: 827 bytes
12:46:17.252 [ForkJoinPool-1-worker-3] INFO c.g.api.client.http.HttpTransport - grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=BLAH
12:46:17.390 [ForkJoinPool-1-worker-3] INFO c.g.api.client.http.HttpTransport - -------------- RESPONSE --------------
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Alt-Svc: quic=":443"; ma=2592000; v="37,36,35"
Server: ESF
X-Content-Type-Options: nosniff
Pragma: no-cache
Date: Fri, 07 Apr 2017 19:46:17 GMT
X-Frame-Options: SAMEORIGIN
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Disposition: attachment; filename="json.txt"; filename*=UTF-8''json.txt
Content-Encoding: gzip
Expires: Mon, 01 Jan 1990 00:00:00 GMT
X-XSS-Protection: 1; mode=block
Content-Type: application/json; charset=utf-8
12:46:17.396 [ForkJoinPool-1-worker-3] INFO c.g.api.client.http.HttpTransport - Total: 203 bytes
12:46:17.397 [ForkJoinPool-1-worker-3] INFO c.g.api.client.http.HttpTransport - {
"access_token" : "BLAH",
"expires_in" : 3600,
"token_type" : "Bearer"
}
It looks as if the request for a bearer token succeeded, and yet the method call (batchAnnotateImages) hangs and eventually times out. Here is the code that I'm using:
val imageBytes = ByteString.readFrom(new FileInputStream(filePath))
val image = Image.newBuilder().setContent(imageBytes).build
val request =
AnnotateImageRequest
.newBuilder()
.addFeatures(Feature.newBuilder().setType(Feature.Type.LABEL_DETECTION).build)
.setImage(image)
.build
val scopedCredentials = credentials.createScoped(ImageAnnotatorSettings.getDefaultServiceScopes)
val channelProvider =
ImageAnnotatorSettings
.defaultChannelProviderBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(scopedCredentials))
.build
val settingsBuilder =
ImageAnnotatorSettings
.defaultBuilder()
.setChannelProvider(channelProvider)
settingsBuilder.batchAnnotateImagesSettings().getRetrySettingsBuilder().setTotalTimeout(Duration.standardSeconds(60))
val response =
ImageAnnotatorClient
.create(settingsBuilder.build)
.batchAnnotateImages(List(request))
I do not see the java.lang.UnsatisfiedLinkError reported in: #1430
Any ideas as to what might be going wrong, or further debugging steps that I should try?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: visionIssues related to the Cloud Vision API.Issues related to the Cloud Vision API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
garrettjonesgoogle commentedon May 30, 2017
We are using a newer version of grpc now - could you try again with a newer version of google-cloud-java?
garrettjonesgoogle commentedon Jul 18, 2017
No response, so I'm going to close out this issue. Please re-open if you are still having problems.
crazyberry7 commentedon Feb 19, 2020
Please reopen. I'm experiencing the exact same issue OP had w/ batchAnnotateImages().
chore: Update generation configuration at Wed Jun 25 02:32:25 UTC 2025 (
feat: next release from main branch is 1.43.0 (#1887)
feat: next release from main branch is 1.43.0 (#1887)
chore: Update generation configuration at Wed Jun 25 02:32:25 UTC 2025 (
deps: update dependency com.google.api.grpc:proto-google-cloud-trace-…
chore(main): release 2.26.0 (googleapis#1885)
deps: update dependency org.graalvm.buildtools:junit-platform-native …
chore(main): release 1.126.5 (#1907)
chore(main): release 1.133.0 (#2206)
deps: update dependency org.graalvm.buildtools:junit-platform-native …
chore(main): release 1.126.5 (#1907)
chore(main): release 1.133.0 (#2206)
chore(deps): update dependency com.google.cloud:libraries-bom to v26.…
chore(main): release 2.27.0 (googleapis#1887)