https://pulumi.com logo
#python
Title
# python
h

helpful-processor-86468

08/14/2020, 11:48 AM
any clue why im getting:
gcp:organizations/getIAMPolicy:getIAMPolicy returned an error: grpc: error while marshaling: proto: repeated field Values has nil element
with:
Copy code
scheduler_policy_func_invoker = organizations.get_iam_policy(bindings=[
        {
            "members": [job_account_member],
            "role": "roles/cloudfunctions.invoker",
        },
    ])
w

witty-ice-69000

08/14/2020, 12:01 PM
Based on my recent experience with the same error in a different context, I would suggest that your
job_account_member
variable is empty. Perhaps it's an async problem where the future/promise isn't working as expected but in any case the opaque (to the Python layer) error message is clearly abstraction bleed-through that hasn't been captured properly. If you can replace
job_account_member
with the literal text I suspect your problem will disappear.
h

helpful-processor-86468

08/14/2020, 12:03 PM
Hmm, what if I can't? I'm creating service account and
job_account_member
is a product of using apply on this service account
w

witty-ice-69000

08/14/2020, 12:08 PM
Yeah. That's a problem. In my case (explained in very recent history here in the channel if you're curious) I was just trying to consume the AWS ARN of a recently created resource; in this case I could manually extrapolate the expected ARN because ARNs have predictable structure. It seemed to work, although I'm concerned that there is a latent race condition that may cause it to randomly fail in future. Being able to consume the variable as generated makes a lot more sense.
If you have Pulumi support it might be a good idea to contact them for an answer. The documentation just seems to point to
Output.apply()
as the correct solution but that definitely didn't work in my case.
h

helpful-processor-86468

08/14/2020, 12:22 PM
I don't have pulumi support. What troubles me is that in other places it works just fine.
For example I have a
cloud scheduler
that takes this
job_account_member
as a parameter.
It goes through smoothly
but when i try to build iam policy document it shits on this async process and just tries to access this variable immedietly.
ill file an issue, becuase it seems like very critical bug
w

witty-ice-69000

08/14/2020, 12:34 PM
Maybe it is something intrinsic to IAM policies, because my situation related to IAM as well. If you post a link to your issue report I'll add some comments about my context in case it helps.
h

helpful-processor-86468

08/14/2020, 12:48 PM