https://flyte.org logo
#ask-ai
Title
# ask-ai
a

Andrew

03/27/2024, 4:58 PM
@Glime I got the following error after updating my deploy-flyte code from main, and running
terraform apply
Copy code
╷
│ Error: Error, failed to deleteuser flyteadmin in instance flyte-gcp-db-faa4d2be: googleapi: Error 400: Invalid request: failed to delete user flyteadmin: . role "flyteadmin" cannot be dropped because some objects depend on it Details: 41 objects in database flyteadmin., invalid
│
│
╵
╷
│ Error: Error when reading or editing Database: googleapi: Error 400: Invalid request: failed to delete database "flyteadmin". Detail: pq: database "flyteadmin" is being accessed by other users. (Please use psql client to delete database that is not owned by "cloudsqlsuperuser")., invalid
│
│
╵
g

Glime

03/27/2024, 4:58 PM
Based on the context provided, it seems like you're encountering an issue related to database user and database deletion in Google Cloud Platform (GCP) while using Terraform for Flyte deployment. The error messages indicate two main issues: 1. The role "flyteadmin" cannot be dropped because some objects in the database depend on it. 2. The database "flyteadmin" is being accessed by other users, which prevents its deletion. To resolve these issues, you may need to follow these steps: • ​*Ensure no active connections to the database*​: Before attempting to delete the database or the user, make sure that there are no active connections. This might involve stopping your Flyte deployment or any other services that might be accessing the database. • ​*Drop dependent objects*​: The error message suggests that there are objects in the database that depend on the "flyteadmin" role. You will need to either drop these objects or reassign their ownership to another role before you can drop the "flyteadmin" role. This can be done using SQL commands in the psql client. • ​*Use psql client for deletion*​: As suggested in the error message, using the psql client to delete the database that is not owned by "cloudsqlsuperuser" might be necessary. This gives you more control over the deletion process and allows you to ensure that no dependencies are blocking the operation. Unfortunately, the provided context does not include specific documentation or commands for resolving these issues directly. However, these general steps should guide you towards resolving the problem. If you're not familiar with SQL commands or the psql client, you might need to consult the PostgreSQL documentation or seek assistance from someone who has experience with database administration. For more detailed guidance on managing PostgreSQL users and databases, you might find the PostgreSQL documentation helpful: PostgreSQL Documentation Additionally, reviewing the Terraform documentation for Google Cloud SQL might provide insights into managing databases and users through Terraform: Terraform Google Cloud SQL Documentation --- This is an AI-generated response, take its recommendations with caution. Please help us improve the model accuracy by giving this response a thumbs up/thumbs down reaction. Answered By Glime 👍 button 👎 button
d

David Espejo (he/him)

03/27/2024, 5:00 PM
@Andrew sorry about that. This commit aimed to generalize the DB name, used not only by flyteadmin Once running tho, it's not possible to drop it
a

Andrew

03/27/2024, 5:01 PM
I gotcha. How can I workaround that, then with terraform?
d

David Espejo (he/him)

03/27/2024, 5:03 PM
A better way to handle this would be to make it configurable, but for now your local sql.tf should use
flyteadmin
a

Andrew

03/27/2024, 5:06 PM
oh ok, yeah that makes sense, will do. Thanks!