Comments (13)
The provider should respect normal resource Operation Timeouts.
from terraform-provider-mssql.
@magne can you give some more details on how this should work? I am running into the same issue with timeouts at 30 seconds. We tried adding the Operation Timeout to both azurerm_mssql_server and azurerm_sql_database and it does not seem to change it. We are using a SQL login.
from terraform-provider-mssql.
It would be great if the provider configuration allowed for a configurable timeout for connecting to the DB. Currently using Azure SQL serverless which goes to sleep after 1 hour...it usually takes it 45-60 seconds to wake up and I get:
Error: unable to read user [xxx].[xxx]: db connection failed after 30s timeout with mssql_user.xxx, on xxx.database.tf line 54, in resource "mssql_user" "xxx": 54: resource "mssql_user" "xxx" {
This is because the resource tries to connect to the instance to do the validation, and when we created the azure_mssql_server we didn't insert our output ip in the Firewall.
If you add your outgoing ip on the sql server firewall, it will run successfully.
from terraform-provider-mssql.
I am able to connect to the database locally and I am still getting this message:
Error: unable to read user [Communication].[Communication]: db connection failed after 30s timeout
│
│ with module.cluster.module._api_communication.mssql_user._api_db,
│ on ..\modules\cluster\modules\_api_with_db\main.tf line 67, in resource "mssql_user" "_api_db":
│ 67: resource "mssql_user" "_api_db"
from terraform-provider-mssql.
For anyone unsure of how to use the "normal resource Operation Timeouts" that magne mentions, here's a snippet:
resource "mssql_user" "users" {
server {
host = azurerm_mssql_server.main.fully_qualified_domain_name
azure_login {
client_id = null
client_secret = null
tenant_id = null
}
}
database = azurerm_mssql_database.my_database.name
username = "..."
roles = ["db_owner"]
timeouts {
default = "5m"
}
}
Note the timeouts block (which supports only the property default
).
from terraform-provider-mssql.
For anyone unsure of how to use the "normal resource Operation Timeouts" that magne mentions, here's a snippet:
resource "mssql_user" "users" { server { host = azurerm_mssql_server.main.fully_qualified_domain_name azure_login { client_id = null client_secret = null tenant_id = null } } database = azurerm_mssql_database.my_database.name username = "..." roles = ["db_owner"] timeouts { default = "5m" } }
Note the timeouts block (which supports only the property
default
).
I have the following:
resource "mssql_login" "example" {
# omit for brevity ...
timeouts {
default = "5m"
}
}
and I'm still getting:
Error: unable to read login [login_name]: db connection failed after 30s timeout
@magne, is this the correct way to use the Resource Timeouts mentioned above? There doesn't seem to be any documentation for this timeouts
property.
Note: I'm using the latest version (v0.2.5)
from terraform-provider-mssql.
@pisethdanh I think you'll find you'll keep getting that error message for 5 minutes. That's all that a resource operation timeout does.
from terraform-provider-mssql.
@waltervos , thank you for your response. The error message says it's timing out after 30 seconds, which doesn't respect the 5 minutes override that I specified. Unless I'm misconstruing how this works?
from terraform-provider-mssql.
@pisethdanh As far as I know this timeout value just refers to how long terraform will keep trying: https://www.terraform.io/language/resources/syntax#operation-timeouts
from terraform-provider-mssql.
@pisethdanh, could you try change the timeouts
block to
timeouts {
read = "5m"
}
If this works, I've misunderstood the terraform internals, assuming that the struct would automatically return the default if no specific timeout was set.
from terraform-provider-mssql.
@magne , thank you for your response. When setting create, read, update, or delete, I get this error:
It appears those attributes are not supported.
Speculation here, but Azure SQL MI may be throttling the read requests resulting in transient errors. Are there any plans to implement retry logic in this provider?
Apologies for resurrecting a closed issue. Is it more appropriate to create a new issue?
from terraform-provider-mssql.
It would be great if the provider configuration allowed for a configurable timeout for connecting to the DB. Currently using Azure SQL serverless which goes to sleep after 1 hour...it usually takes it 45-60 seconds to wake up and I get:
Error: unable to read user [xxx].[xxx]: db connection failed after 30s timeout with mssql_user.xxx, on xxx.database.tf line 54, in resource "mssql_user" "xxx": 54: resource "mssql_user" "xxx" {
Hello! I also faced this error. How did you resolve it?
from terraform-provider-mssql.
@nazirakz , no real resolution...I just re-run terraform and by the second time the DB is already awake
from terraform-provider-mssql.
Related Issues (20)
- Managed identity documentation and examples
- Export SID property from user/login HOT 1
- Password for DB user not treated as sensitive
- Granting roles to user in Azure Synapse Dedicated Pool database
- Cannot login using only env vars HOT 2
- The user is not added as a role member to the database HOT 1
- terraform apply always wants to do in place update HOT 2
- Unsure how to use azure_login HOT 1
- resource mssql_user reads server's password from the state rather than configuration HOT 1
- Why the "server" block instead of using provider authentication? HOT 15
- Unable to create Login for an Azure AD user/group HOT 16
- SQL Server admin authentication restrictions
- Azure DevOps MS SQL firewall HOT 8
- Using mssql_user without a client_id and client_secret HOT 2
- Feature request - Run SQL scripts
- Confused with client secret, password
- Unable to add UserAssignedIdentity on database as external user and grant db permission on mssql managed database HOT 1
- set application as an admin HOT 2
- `default_scema` is not set for identities from `EXTERNAL PROVIDER` for Azure SQL Database Users.
- Support create login with SID HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-mssql.