Skip to content

DEADLINE_EXCEEDED, google-cloud-vision #1887

@ikerr

Description

@ikerr

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?

Metadata

Metadata

Labels

api: visionIssues related to the Cloud Vision API.priority: p1Important 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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions