-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task after = [...] issues in the 76 release #2207
Comments
I just run into this issue too. We're trying to upgrade from 0.69.0 to 0.80.0, and we have multiple tasks defined with
And then failed to apply them. Looking at the DEBUG logs, I found this line:
As a workaround, setting |
This issue happened to me. I upgraded v0.73 to v0.80.0. |
Fuller steps to reproduce (unable to edit original description, posting as a comment to aid the issue's progress/self-test):
terraform {
required_providers {
snowflake = {
source = "Snowflake-Labs/snowflake"
version = "0.69.0"
}
}
}
provider "snowflake" {
[… snipped …]
}
resource "snowflake_task" "parent_task" {
comment = "my parent task"
database = "MY_DB"
schema = "MY_SCH"
warehouse = "MY_WH"
name = "MY_PARENT_TASK"
schedule = "10 MINUTE"
sql_statement = "select * from snowflake_sample_data.tpch_sf1.orders limit 1;"
user_task_timeout_ms = 10000
enabled = true
}
resource "snowflake_task" "child_task" {
comment = "my child task"
database = "MY_DB"
schema = "MY_SCH"
warehouse = "MY_WH"
name = "MY_CHILD_TASK"
sql_statement = "select * from snowflake_sample_data.tpch_sf1.orders limit 10;"
user_task_timeout_ms = 10000
after = snowflake_task.parent_task.name
enabled = true
}
terraform {
required_providers {
snowflake = {
source = "Snowflake-Labs/snowflake"
version = "0.83.1"
}
}
}
provider "snowflake" {
[… snipped …]
}
resource "snowflake_task" "parent_task" {
comment = "my parent task"
database = "MY_DB"
schema = "MY_SCH"
warehouse = "MY_WH"
name = "MY_PARENT_TASK"
schedule = "10 MINUTE"
sql_statement = "select 'parent';"
user_task_timeout_ms = 10000
enabled = true
}
resource "snowflake_task" "child_task" {
comment = "my child task"
database = "MY_DB"
schema = "MY_SCH"
warehouse = "MY_WH"
name = "MY_CHILD_TASK"
sql_statement = "select 'child';"
user_task_timeout_ms = 10000
after = snowflake_task.parent_task.name
enabled = true
}
Related comment: #2346 (comment) |
Hi guys, any news for a bugfix in the next version? Could you tell me if a deadline has already been set for this? |
Hey, I will be working on this (and #2346) next week. I think we will get this working in v0.86 or v0.87 at the latest. |
@rmargarint-nydig @sfc-gh-hachouraria @mdefariaborges-rbi @sgavrilov-rbi, together with @sfc-gh-jcieslak we were able to reproduce the issue's cause. The reason was the change in parsing the I prepared a change in the parsing logic, it will be a part of the release next Wednesday/Thursday. |
Related issues: #2036 #2207 #2346. - (#2207) The reason was the change in parsing the `SHOW TASKS` response for `after` parameter. In earlier versions, the parsing was incorrect for the identifiers containing dot characters. The new one fixed the dot case but Snowflake identifiers surprised us one more time, and the basic case, without any `"` was not supported correctly. - (#2036) There is no way to unset `when` currently in Snowflake. We don't want to always `ForceNew` for when change. For that reason we run forceNew conditionally using `customdiff.ForceNewIfChange`. - (#2346) Waiting for answers but maybe this fix will also solve this issues.
Fix released as part of 0.86.0. @rmargarint-nydig @sfc-gh-hachouraria @mdefariaborges-rbi @sgavrilov-rbi, could you please check if bumping solves the issue for you? |
@sfc-gh-asawicki Thank you for your contribution. I upgraded from v0.73 to v0.86 and it successfully works. |
@sfc-gh-asawicki I can confirm that we could finally update from 0.69.0! I'm fine with closing this ticket. |
We have two confirmations, so I will close it. @rmargarint-nydig please open another ticket if the error persists for you in the newest provider version. |
I tried using 0.88.0 and 0.86.0 versions, both still have the same issue, please, reopen the issue. |
Hey @roberto-ross-verato. Thanks for reaching out to us. We have multiple confirmations that the described problem was solved with v0.86.0, so yours may differ. Please open a new issue with the description, example config, and reproduction steps. |
Terraform CLI and Provider Versions
76
Terraform Configuration
.
Expected Behavior
After the 76 release Task DAGs created through TF seem to have issues related to how the
after = [...]
is handled. According to the docs the predecessor tasks should be specified in the form ofafter = [snowflake_task.parent_task.name]
, which has been working fine for us for a long time. After upgrading to the 76 release (which from the PR seems to have changes related to how the after clause is handled) 100% of our tasks usingafter
are failing.Actual Behavior
The failure scenarios are complex and hard to describe in detail, but they fall in roughly these situations:
when using
after = [snowflake_task.parent.name]
and the task is already present, tf apply says there's an external change where the external state for after is "DB.SCHEMA.parent" but TF only expects "parent". Then during the actual apply it fails because TF apply seems to no longer correctly set the root task in suspended mode (and looking at the snowflake logs that's because it tries to "alter task parent suspend", when it should be doing "alter task db.schema.parent suspend".if we change it to
after = ["db.schema.parent"]
the above error goes away but now another error appears during apply where when it creates/updates the child task, it seems to re-fully qualify the parent name, so the snowflake error is because it's trying to useDB.SCHEMA."DB.SCHEMA.parent"
for what it actually sends to snowflake.Steps to Reproduce
terraform apply
How much impact is this issue causing?
High
Logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: