GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Getting PERMISSION_DENIED when running QuickstartSample class · Issue #813 · GoogleCloudPlatform/java-docs-samples

Getting PERMISSION_DENIED when running QuickstartSample class #813

New issue
Copy link
New issue
Copy link
Closed
Closed
Getting PERMISSION_DENIED when running QuickstartSample class#813
Copy link

Description

@choudharysuchi
choudharysuchi
opened on Aug 17, 2017
Issue body actions

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

  1. lesv commented on Aug 17, 2017

    @lesv
    lesv
    on Aug 17, 2017
    Contributor
    More actions

    The Video and DLP api's need GOOGLE_APPLICATION_CREDENTIALS set to a service account for that project.

  2. choudharysuchi commented on Aug 18, 2017

    @choudharysuchi
    choudharysuchi
    on Aug 18, 2017
    Author
    More actions

    Thanks for the reply.

    However I have already configured this in environment variables as GOOGLE_APPLICATION_CREDENTIALS = absolute path of <VideoFilteration-6b6344b603b9.json>.

  3. jabubake commented on Sep 25, 2017

    @jabubake
    jabubake
    on Sep 25, 2017
    Contributor
    More actions

    It does seem like the environment variable GOOGLE_APPLICATION_CREDENTIALS is somehow not getting picked up. Can you try System.getenv("GOOGLE_APPLICATION_CREDENTIALS") within your code and confirm that it does correctly point to your credentials JSON ? Also can you provide information on your development environment ?

  4. jabubake commented on Jun 15, 2018

    @jabubake
    jabubake
    on Jun 15, 2018
    Contributor
    More actions

    Closing issue, please re-open if you are still running into issues.

  5. jabubake
    closed this as completedon Jun 15, 2018
  6. jaindee commented on Aug 2, 2018

    @jaindee
    jaindee
    on Aug 2, 2018
    More actions

    Hi I am running into the same problem, however i am getting the correct path of the json file i provided.

  7. ejgutierrezvega commented on Aug 3, 2018

    @ejgutierrezvega
    ejgutierrezvega
    on Aug 3, 2018
    More actions

    Hi, I'm following the quick start from Stackdriver and I'm getting the same issue.
    https://opencensus.io/quickstart/java/metrics/#1

    At the beginning I was having issues reading the system environments, but now I'm able to run the code input some samples and after some time I'm getting the following exception.

    I created the system account with only the role of "Monitoring Metric Writer".

    io.opencensus.exporter.stats.stackdriver.StackdriverExporterWorker export
    WARNING: ApiException thrown when exporting TimeSeries.
    com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: The caller does not have permission
    at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:55)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
    at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
    at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:95)
    at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:61)
    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:492)
    at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:467)
    at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
    at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
    at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
    at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684)
    at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
    at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
    at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
    at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:391)
    at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:471)
    at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:553)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:474)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:591)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
    at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    
  8. minherz
    added 3 commits that reference this issue on Nov 9, 2022

    chore(main): release 0.122.17 (#815)

    2e592cb

    chore(main): release 0.122.17 (#815)

    1c78d12

    chore(main): release 0.122.17 (#815)

    999e906
  9. Shabirmean
    added a commit that references this issue on Nov 11, 2022

    chore(deps): update dependency com.google.cloud:libraries-bom to v26.…

    aeb9c0a
  10. Sita04
    added 2 commits that reference this issue on Nov 11, 2022

    deps: update dependency org.seleniumhq.selenium:selenium-chrome-drive…

    408e965

    deps: update dependency org.seleniumhq.selenium:selenium-chrome-drive…

    9032c52
  11. Shabirmean
    added a commit that references this issue on Nov 18, 2022

    chore(deps): update dependency com.google.cloud:google-cloud-aiplatfo…

    045e04c
  12. gcf-merge-on-green
    added a commit that references this issue on Dec 20, 2022

    samples: migrate code from googleapis/java-aiplatform (#7451)

    24b693d
  13. Sita04
    added 2 commits that reference this issue on Feb 7, 2023

    deps: update dependency com.google.cloud:google-cloud-pubsub to v1.11…

    793fd90

    chore(main): release 3.1.3 (#822)

    464b124
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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.