https://pulumi.com logo
t

tall-photographer-1935

12/07/2021, 11:05 PM
When attempting to create a Cloud SQL User using Pulumi Classic (Python), I receive this error:
Copy code
error: expected non-nil error with nil state during Create of urn:pulumi:dev::****::gcp:sql/user:User::db user addl-user1 in **
code sample:
Copy code
gcp_classic_db_user.User(resource_name=f'db user {user_args.username} in {created_instance_name}',
                                            args=user_args.database_user_args,
                                            opts=ResourceOptions(depends_on=self.instance))
Any ideas on how to fix this?
g

great-queen-39697

12/09/2021, 3:30 PM
That's the kind of error I'd expect if there's a missing config in either the user object or the database object. Can you share a bit more of the code, specifically what's defining the user_args?
t

tall-photographer-1935

12/09/2021, 6:42 PM
So, what's interesting is that it actually creates the resources, but for each user I add to the database, that message comes back. And it isn't actually stored in the pulumi state.
the arguments in the
user_args
are here:
Copy code
class AdditionalDatabaseUserArgs:
    def __init__(self,
                 project: str,
                 username: str,
                 instance: str,
                 password: str = None,
                 host: str = 'localhost'): # password is required for postgres
        if password is None:
            password = pulumi_random.RandomPassword(f"password for {username}", length=15, special=True).result
        self.username = username
        self.instance = instance
        self.password = password
        self.host = host
        self.database_user_args = gcp_classic_db_user.UserArgs(instance=instance, name=username, password=password, host=host, project=project)
so it creates the user in the GCP Classic Provider
g

great-queen-39697

12/09/2021, 6:56 PM
huh, interesting. Give me a bit to dig in and see what I can figure out
t

tall-photographer-1935

12/09/2021, 7:04 PM
Thank you!
g

great-queen-39697

12/09/2021, 8:43 PM
We're still digging into it; had to pull a couple other folks in.
t

tall-photographer-1935

12/09/2021, 8:57 PM
all good. I appreciate the effort!
Hi Laura, just checking in here to see if you've got an update. Thanks!
g

great-queen-39697

12/13/2021, 6:29 PM
Hi! So it looks like our system is swallowing the underlying error coming from the bridge (we've got a PR in the works to patch that so the error surfaces properly). At the moment, I don't know exactly what's wrong with your code, unfortunately 😞
t

tall-photographer-1935

12/13/2021, 6:31 PM
No worries! Thank you for taking a look at it. do you know if that PR is public and if so, can you link it to me?
g

great-queen-39697

12/13/2021, 8:35 PM
It should be! I don't see the specific one that was being discussed up just yet, but here's the repo to watch: https://github.com/pulumi/pulumi-terraform-bridge/ It does look like they're debating whether this PR answers the question, though: https://github.com/pulumi/pulumi-terraform-bridge/pull/401
t

tall-photographer-1935

12/13/2021, 8:37 PM
awesome, thank you!!
🙇‍♀️ 1