Skip to content

Getting PERMISSION_DENIED when running QuickstartSample class #813

Description

@choudharysuchi

There is a requirement in my project to analyse videos based upon the text provided by the customer. Tried using Google Cloud Video Intelligence API. Referred code from "https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/video/cloud-client"

However, I am getting the below issue while executing the QuickstartSample.java from local by passing the video kept on my system.

Exception in thread "main" java.util.concurrent.ExecutionException: com.google.api.gax.grpc.ApiException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Google Cloud Video Intelligence API has not been used in project usable-auth-library before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/videointelligence.googleapis.com/overview?project=usable-auth-library then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:500)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:479)
at com.google.api.gax.grpc.OperationFuture.get(OperationFuture.java:113)
at com.video.main.QuickstartSample.main(QuickstartSample.java:59)
Caused by: com.google.api.gax.grpc.ApiException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Google Cloud Video Intelligence API has not been used in project usable-auth-library before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/videointelligence.googleapis.com/overview?project=usable-auth-library then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
at com.google.api.gax.grpc.ExceptionTransformingCallable$ExceptionTransformingFuture.onFailure(ExceptionTransformingCallable.java:108)
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:53)
at com.google.common.util.concurrent.Futures$4.run(Futures.java:1123)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811)
at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:675)
at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:466)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:442)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Google Cloud Video Intelligence API has not been used in project usable-auth-library before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/videointelligence.googleapis.com/overview?project=usable-auth-library then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
at io.grpc.Status.asRuntimeException(Status.java:543)
... 15 more

Following are the steps which i followed,

  1. Created a maven project with only QuickstartSample.java file. Able to do maven build with clean install args.
  2. Created account on Google Cloud Platform, created a project with name "VideoFilteration", saved the service account key locally with enabling it and configuring it in environment variables.
  3. Installed Cloud SDK followed by "gcloud init" and "gcloud auth application-default login".

To my surprise, I never created "usable-auth-library" project on google cloud account for which I am getting the said issue.

Please provide your valuable inputs, as I am stuck on this error.

Thanks in Advance.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions