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 — Permissions problem trying to create a sink · Issue #1614 · googleapis/google-cloud-python

Permissions problem trying to create a sink #1614

New issue
Copy link
New issue
Copy link
Closed
Closed
Permissions problem trying to create a sink#1614
Copy link
Assignees
tseaver
Labels
api: loggingIssues related to the Cloud Logging API.

Description

@tseaver
tseaver
opened on Mar 15, 2016
Issue body actions

While working on a system test for Sink.create, I'm running into a permissions problem:

>>> sink.create()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gcloud/logging/sink.py", line 145, in create
    client.connection.api_request(method='PUT', path=self.path, data=data)
  File "gcloud/connection.py", line 343, in api_request
    error_info=method + ' ' + url)
gcloud.exceptions.Forbidden: 403 The caller does not have permission (PUT https://logging.googleapis.com/v2beta1/projects/citric-celerity-697/sinks/test-sink)

Sinks.create is documented to require one of https://www.googleapis.com/auth/logging.admin or https://www.googleapis.com/auth/cloud-platform.

My client is set up with all permissions for the logging API:

>>> client.connection._credentials._scopes
'https://www.googleapis.com/auth/logging.read https://www.googleapis.com/auth/logging.write https://www.googleapis.com/auth/logging.admin https://www.googleapis.com/auth/cloud-platform'

Do I have to do something in the developer control panel to enable sinks?

Activity

Next
  1. tseaver
    added
    api: loggingIssues related to the Cloud Logging API.
    on Mar 15, 2016
  2. tseaver
    assigned
    jgeewax
    on Mar 15, 2016
  3. tseaver commented on Mar 15, 2016

    @tseaver
    tseaver
    on Mar 15, 2016
    ContributorAuthor
    More actions

    @jgeewax please loop in whoever would be able to point me in the right direction from the logging API team.

  4. tseaver commented on Mar 15, 2016

    @tseaver
    tseaver
    on Mar 15, 2016
    ContributorAuthor
    More actions

    Maybe germane: https://cloud.google.com/logging/docs/export/configure_export#exported-logs-permissions

  5. tseaver commented on Mar 15, 2016

    @tseaver
    tseaver
    on Mar 15, 2016
    ContributorAuthor
    More actions

    More likely an error on my part: the failed request was trying to do a PUT to the URL of the sink, which doesn't yet exist, instead of a POST to the /sinks quasi-container.

  6. tseaver commented on Mar 15, 2016

    @tseaver
    tseaver
    on Mar 15, 2016
    ContributorAuthor
    More actions

    But I'm betting that when I do get that part right, then the 403 will trigger because I don't have the bucket permissions set correctly.

  7. tseaver commented on Mar 15, 2016

    @tseaver
    tseaver
    on Mar 15, 2016
    ContributorAuthor
    More actions

    Grrr. Switching to POST doesn't fix it:

    gcloud.exceptions.Forbidden: 403 The caller does not have permission (POST https://logging.googleapis.com/v2beta1/projects/citric-celerity-697/sinks)
    

    That same URI works fine in the API Exploder.

  8. dhermes commented on Mar 16, 2016

    @dhermes
    dhermes
    on Mar 16, 2016
    Contributor
    More actions

    @jgeewax Any ideas?

  9. dhermes commented on Mar 16, 2016

    @dhermes
    dhermes
    on Mar 16, 2016
    Contributor
    More actions

    @callmehiphop @stephenplusplus @blowmage have you run into this?

  10. stephenplusplus commented on Mar 16, 2016

    @stephenplusplus
    stephenplusplus
    on Mar 16, 2016
    More actions

    Yes! Check this out: googleapis/google-cloud-node#1156

  11. stephenplusplus commented on Mar 16, 2016

    @stephenplusplus
    stephenplusplus
    on Mar 16, 2016
    More actions

    Related Ruby issue: googleapis/google-cloud-ruby#569

  12. blowmage commented on Mar 16, 2016

    @blowmage
    blowmage
    on Mar 16, 2016
    Contributor
    More actions

    IIRC the Pub/Sub IAM issue is different. The issue with creating Logging Sinks is that it requires a user account, not a service account. This is imposed by the API, and there isn't much we can do to get around it. @quartzmo, does that sound right?

  13. stephenplusplus commented on Mar 16, 2016

    @stephenplusplus
    stephenplusplus
    on Mar 16, 2016
    More actions

    Ah, my bad. We were getting errors creating Sinks with a Pub/Sub Topic as a destination, which traces back to the Pub/Sub IAM change, so I jumped at a connection between that issue and this one.

    Indeed, you must be authenticated as a user (through the gcloud SDK works). Here's the official word from a Logging member: googleapis/google-cloud-node#842 (comment)

  14. blowmage commented on Mar 16, 2016

    @blowmage
    blowmage
    on Mar 16, 2016
    Contributor
    More actions

    There are some additional steps for creating a sink to a Bucket, and @quartzmo was chasing that info down for our docs, so I'll defer to him on that as well. 😅

  15. quartzmo commented on Mar 16, 2016

    @quartzmo
    quartzmo
    on Mar 16, 2016
    Member
    More actions

    Unfortunately I haven't gotten it working yet, but I'll try again today.

    On Mar 16, 2016, at 7:02 AM, Mike Moore [email protected] wrote:

    There are some additional steps for creating a sink to a Bucket, and @quartzmo was chasing that info down for our docs, so I'll defer to him on that as well. 😅

    —
    You are receiving this because you were mentioned.
    Reply to this email directly or view it on GitHub

  16. 4 remaining items

  17. tseaver commented on Mar 17, 2016

    @tseaver
    tseaver
    on Mar 17, 2016
    ContributorAuthor
    More actions

    @blowmage wrote:

    The issue with creating Logging Sinks is that it requires a user account, not a service account. This is imposed by the API, and there isn't much we can do to get around it.

    @jgeewax Is there someplace where we can at least "argue with the ref" about this restriction? It seems perverse to deny service accounts the ability create logging sinks, when they can create and delete storage buckets, pubsub topics, bigquery datasets, bigtable clusters, etc.

  18. blowmage commented on Mar 17, 2016

    @blowmage
    blowmage
    on Mar 17, 2016
    Contributor
    More actions

    I agree it would be nice if the service did this for us. My guess is that it has to do with Storage not using IAM for permissions.

    Is adding permissions to the bucket something we should do in our libraries when creating a sink?

  19. tseaver commented on Mar 17, 2016

    @tseaver
    tseaver
    on Mar 17, 2016
    ContributorAuthor
    More actions

    I agree it would be nice if the service did this for us. My guess is that it has to do with Storage not using IAM for permissions.

    Pubsub uses IAM, and allows service accounts to create topics / subscriptions.

    Is adding permissions to the bucket something we should do in our libraries when creating a sink?

    Good question. Doing so "magically" would feel wrong to me. Maybe we should expose convenience functions, e.g., prepare_bucket_for_logging, prepare_topic_for_logging, and prepare_dataset_for_logging, which would make the needed permissions / role changes.

  20. quartzmo commented on Mar 17, 2016

    @quartzmo
    quartzmo
    on Mar 17, 2016
    Member
    More actions

    @blowmage Great question, but I agree with @tseaver that adding permissions automatically seems like going a bit too far. I think showing that it is required in the examples is good enough.

  21. tseaver commented on Mar 17, 2016

    @tseaver
    tseaver
    on Mar 17, 2016
    ContributorAuthor
    More actions

    FWIW, the logging API docs say:

    You must have owner permission to the project whose logs are being exported.

    I thought I had read (in the docs for setIamPolicy) that system accounts could not be granted the Owner permission. However, from the console permissions page, I was able to assign it to my service account, which then allows that account to create / delete sink resources.

    @jgeewax we will need to ensure that the system account used by Travis has the Owner role before merging the sink-related system tests.

  22. tseaver
    closed this as completedon Mar 17, 2016
  23. dhermes commented on Mar 18, 2016

    @dhermes
    dhermes
    on Mar 18, 2016
    Contributor
    More actions

    @tseaver Do you have access to edit that project in the Cloud Console?

  24. tseaver commented on Mar 18, 2016

    @tseaver
    tseaver
    on Mar 18, 2016
    ContributorAuthor
    More actions

    @dhermes The only project which shows up for me in the "Manage all projects" view is my own.

  25. dhermes commented on Mar 18, 2016

    @dhermes
    dhermes
    on Mar 18, 2016
    Contributor
    More actions

    OK. I can make the changes. Send me an email with the changes you want?

  26. theacodes
    unassigned
    jgeewax
    on Sep 28, 2018
  27. JustinBeckwith
    assigned
    tseaver
    on Feb 1, 2021
  28. parthea
    added 2 commits that reference this issue on Nov 24, 2025

    chore(deps): update all dependencies (#1614)

    32bfcdb

    fix: revert templates for iam endpoints (#1614)

    b15ef02
  29. parthea
    added a commit that references this issue on Mar 9, 2026

    feat(zb-experimental): implement close (#1614)

    bde3903
  30. parthea
    added a commit that references this issue on Apr 1, 2026

    feat: enable local json string validations (#1614)

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

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: loggingIssues related to the Cloud Logging API.

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.