Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

User not authorized to perform this action. at Http2CallStream.call.on #428

Closed

Description

Got the following issue trying to send request to gcp pubsup:

(node:28) UnhandledPromiseRejectionWarning: Error: User not authorized to perform this action. at Http2CallStream.call.on (/app/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/client.js:96:45) at Http2CallStream.emit (events.js:202:15) at process.nextTick (/app/node_modules/google-gax/node_modules/@grpc/grpc-js/build/src/call-stream.js:71:22) at processTicksAndRejections (internal/process/next_tick.js:74:9)

Activity

  1. JustinBeckwith commented on Jul 25, 2019

    @JustinBeckwith
    Contributor

    Greetings! Can you share more about your setup?

    • What library are you trying to use?
    • What version of the library are you using?
    • Are you trying to use react, angular, now.sh, or some other sort of non-strictly nodejs environment?
    • What version of node.js are you using?
  2. artem-konovalov-personal commented on Jul 25, 2019

    @artem-konovalov-personal
    Author

    Sure thing

    My deps are:

    "dependencies": {
        "@google-cloud/pubsub": "0.30.1",
        "@google-cloud/storage": "3.0.2",
        "express": "4.17.1",
        "express-fileupload": "1.1.5",
        "get-stream": "5.1.0"
      },
    
    • I don't use any of react, angular, etc
    • node version is v12.6.0
  3. JustinBeckwith commented on Jul 25, 2019

    @JustinBeckwith
    Contributor

    Awesome. Could you share a code snippet that triggers the exception?

  4. artem-konovalov-personal commented on Jul 25, 2019

    @artem-konovalov-personal
    Author

    JFYI: yarn says that pubsub depends on google-gax "^1.0.0"

    My code is as follows:

    const PubSub = require('@google-cloud/pubsub');
    
    
    const objectList = [{data: 1}, {data: 2}];
    const pubsub = new PubSub.PubSub({ projectId, keyFilename });
    const topic = pubsub.topic(myTopic);
    
    objectList.forEach(async (data) => {
                await topic.publishJSON(data);
            });
    
  5. JustinBeckwith commented on Jul 25, 2019

    @JustinBeckwith
    Contributor

    So I suspect this is an issue with the permissions available to your service account. Can you verify your service account has the roles/pubsub.publisher role?
    https://cloud.google.com/pubsub/docs/access-control

  6. artem-konovalov-personal commented on Jul 25, 2019

    @artem-konovalov-personal
    Author

    okay, much thanks! I'll review and post any results to this topic :)

  7. artem-konovalov-personal commented on Jul 29, 2019

    @artem-konovalov-personal
    Author

    @JustinBeckwith We've fixed the issue with pubsub using correct SA.
    Much thanks for your help!

    Gonna close the issue as far as the question is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions