terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

Invalid predecessor DB.SCHEMA."[]" was specified.

Open ezeql opened this issue 2 years ago • 4 comments

Provider Version

snowflake-labs/snowflake v0.37.0

Terraform Version

Terraform v1.2.2

Describe the bug terraform apply first time using 0.37.0 got to

 Error: error removing old after dependency from task DATABASE|SCHEMA|TASK: 091085 (42601): Invalid predecessor DATABASE.SCHEMA."[]" was specified.
 
   with module.snowflake.snowflake_task.task,
   on ../../../modules/snowflake/tasks.tf line 1, in resource "snowflake_task" "task":
    1: resource "snowflake_task" "task {

Expected behavior

Should apply the changes correctly.

Code samples and commands

resource "snowflake_task" "task" {
  database             = "DATABASE"
  name                 = "TASK"
  schema               = "SCHEMA"
  warehouse            = "WAREHOUSE"
  schedule             = "60 MINUTE"
  sql_statement        = "call merge()"
  enabled              = true
  user_task_timeout_ms = 86400000
}

Additional context

We experienced the issue described on https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1071 before the current problem. Upgrading to 0.37.0 seemed to solve it, yet we're facing this new one.

UPDATE: It only showed once after the first apply. Following plans seemed to work as expected. Will expand shortly.

ezeql avatar Jun 29 '22 15:06 ezeql

@ezeql We're also now seeing this problem. Hopefully gets sorted quickly. I'm sure there's some hacky way to get around it - but I've not quite figured it out yet!

jodybuz avatar Jun 30 '22 15:06 jodybuz

hi @jodybuz, this issue only showed up once, the first apply after using 0.37.0. terraform plan worked correctly afterward.

ezeql avatar Jun 30 '22 16:06 ezeql

I can confirm with @ezeql that this issue only occurred once after upgrading to 0.37.0. Stranger even that this issue only occured on 1 task out of 8 possible ones. Whatever changes it tried to make caused the task to become suspended.

AidanHarveyNelson avatar Jul 05 '22 03:07 AidanHarveyNelson

This persisted for me and I couldn't find a workaround unfortunately

dlawrences avatar Jul 15 '22 20:07 dlawrences