Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Samples tests are failing with PermissionDenied #243

Closed
parthea opened this issue Oct 24, 2022 · 1 comment
Closed

Samples tests are failing with PermissionDenied #243

parthea opened this issue Oct 24, 2022 · 1 comment
Assignees
Labels
api: iam Issues related to the googleapis/python-iam API. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@parthea
Copy link
Contributor

parthea commented Oct 24, 2022

The sample test for create_deny_policy is failing with PermissionDenied. See build log here and stack trace below:

create_deny_policy.py:103: in create_deny_policy
    result = policies_client.create_policy(request=request).result()
../../google/cloud/iam_v2/services/policies/client.py:787: in create_policy
    metadata=metadata,
.nox/py-3-7/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py:154: in __call__
    return wrapped_func(*args, **kwargs)
.nox/py-3-7/lib/python3.7/site-packages/google/api_core/retry.py:288: in retry_wrapped_func
    on_error=on_error,
.nox/py-3-7/lib/python3.7/site-packages/google/api_core/retry.py:190: in retry_target
    return target()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = (parent: "policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fpython-docs-samples-tests/denypolicies"
policy {
 ...eing deleted has a tag with the value test"
  }
}
policy_id: "test-deny-policy-e49f57dd-603b-48b5-bcde-fd81ab1d17f6"
,)
kwargs = {'metadata': [('x-goog-request-params', 'parent=policies/cloudresourcemanager.googleapis.com%252Fprojects%252Fpython-docs-samples-tests/denypolicies'), ('x-goog-api-client', 'gl-python/3.7.12 grpc/1.50.0 gax/2.10.2 gapic/2.8.2')]}

    @functools.wraps(callable_)
    def error_remapped_callable(*args, **kwargs):
        try:
            return callable_(*args, **kwargs)
        except grpc.RpcError as exc:
>           raise exceptions.from_grpc_error(exc) from exc
E           google.api_core.exceptions.PermissionDenied: 403 Permission iam.googleapis.com/denypolicies.create denied on resource cloudresourcemanager.googleapis.com/projects/python-docs-samples-tests

.nox/py-3-7/lib/python3.7/site-packages/google/api_core/grpc_helpers.py:74: PermissionDenied
@product-auto-label product-auto-label bot added the api: iam Issues related to the googleapis/python-iam API. label Oct 24, 2022
@parthea parthea added samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed api: iam Issues related to the googleapis/python-iam API. labels Oct 24, 2022
@product-auto-label product-auto-label bot added the api: iam Issues related to the googleapis/python-iam API. label Oct 25, 2022
@Sita04
Copy link
Contributor

Sita04 commented Feb 13, 2023

The sample have been moved to python-docs-samples in PR: GoogleCloudPlatform/python-docs-samples#8497

@Sita04 Sita04 closed this as completed Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: iam Issues related to the googleapis/python-iam API. priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants