Skip to content
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

[Bug]: Issue with Terraform Import: "Plugin did not respond" Error When Importing Tables and Procedures #3072

Closed
1 task
BLUENO01 opened this issue Sep 13, 2024 · 2 comments
Labels
general-usage General help/usage questions

Comments

@BLUENO01
Copy link

BLUENO01 commented Sep 13, 2024

Terraform CLI Version

1.9.5

Terraform Provider Version

0.95.0

Terraform Configuration

main.tf
terraform {
  required_providers {
    snowflake = {
      source  = "Snowflake-Labs/snowflake"
      version = "~> 0.95"
    }
  }
}

provider "snowflake" {
  account  = var.snowflake_account
  user = var.snowflake_user
  password = var.snowflake_password
  role     = var.snowflake_role
  warehouse = var.snowflake_warehouse
}

# 変数の宣言
variable "snowflake_account" {
  type = string
}

variable "snowflake_user" {
  type = string
}

variable "snowflake_password" {
  type = string
  sensitive = true
}

variable "snowflake_role" {
  type = string
}

variable "snowflake_warehouse" {
  type = string
}

Category

category:import

Object type(s)

resource:table

Expected Behavior

I wanted to use terraform import to manage existing tables, procedures, views, and other objects in the already established Snowflake environment with Terraform.

Actual Behavior

I executed terraform import to manage existing tables, procedures, and other objects in the Snowflake environment using Terraform. However, the import process shows inconsistent results depending on the object type: some imports succeed, while others fail due to plugin errors, as shown in the error message below. (For example, importing databases, schemas, and views works, but importing tables and procedures fails.)

I have considered the possibility that this issue might be related to the version, and I tested the following environments:

Snowflake versions: 8.34.0 and 8.33.1 (I tested both environments, and similar issues occurred in both.)
Terraform Snowflake Provider versions: 0.83.1 to 0.95.0 (I tested all versions up to the latest one.)
`╷
│ Error: Plugin did not respond

│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.


│ Error: Plugin did not respond

│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).UpgradeResourceState call. The plugin logs may contain more details.

`

Steps to Reproduce

The folder structure used for execution was as follows:
スクリーンショット 2024-09-13 12 01 02

  1. I ran terraform init in the above directory.
  2. In the same directory, I executed the following import commands. Importing tables and procedures resulted in errors:

terraform import -var-file=prod.tfvars snowflake_table.XXTABLE XXDB.XXSCHEMA.XXTABLE

terraform import -var-file=prod.tfvars snowflake_view.XXVIEW XXDB.XXSCHEMA.XXVIEW

terraform import -var-file=prod.tfvars snowflake_procedure.procXX XXDB.XXSCHEMA.procXX

How much impact is this issue causing?

Low

Logs

No response

Additional Information

No response

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@BLUENO01 BLUENO01 added the bug Used to mark issues with provider's incorrect behavior label Sep 13, 2024
@sfc-gh-asawicki sfc-gh-asawicki added general-usage General help/usage questions and removed bug Used to mark issues with provider's incorrect behavior labels Sep 13, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @BLUENO01. Thanks for reaching out to us.

Please check the import commands:

After fixing the import commands according to the referenced docs, you should complete import successfully.

One note: we are currently reworking the objects on our road to V1. Because of that, import commands differ between the resources. We will eventually have them unified, please follow our release notes and migration guide (https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#migration-guide).

@sfc-gh-asawicki
Copy link
Collaborator

Closing the issue due to inactivity. Please create a new one if the issue persists in the newest version of the provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general-usage General help/usage questions
Projects
None yet
Development

No branches or pull requests

2 participants