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

Unable to list functions using provider v0.70.1

Open aggielam26 opened this issue 2 years ago • 1 comments

Provider Version

0.70.1 (we have also noticed this issue with 0.54.0).

Terraform Version

0.14.11

Describe the bug

We are unable to list the functions (snowflake_functions.current.functions) using snowflake_functions as a data source. Upon including "functions" as a Terraform output, the output shows as "[tolist(null) /* of object */]" and the following error is received in the debug logs:

[DEBUG] error listing functions: unable to scan row for SHOW USER FUNCTIONS IN SCHEMA "<db_name>"."<schema_name>" err = %!w(): timestamp=2023-09-28T11:46:56.575Z

Expected behavior

We expect the list of functions to be returned in the Terraform output as it is when we use provider v0.37.1, for example:

functions_data = [ tolist([ { "argument_types" = tolist([ "FLOAT", ]) "comment" = "user-defined function" "database" = "" "name" = "" "return_type" = "FLOAT" "schema" = "<schema_name>" }, etc.

Code samples and commands

Data source declaration:

data "snowflake_functions" "current"{ depends_on = [snowflake_function.exampleone,snowflake_function.exampletwo] database = "" schema = "T" }

Usage:

locals { functions = [ data.snowflake_functions.current.functions ] }

Additional context

We have noted that the queries used for the output (found in Snowflake query history) for both versions of the provider are the same:

SHOW USER FUNCTIONS IN SCHEMA "<db_name>"."<schema_name>

However, with version 0.70.1 (and 0.54.0) the output "functions" is showing as a list of null, so we suspect there was some issue in between running the query and returning its results to Terraform.

aggielam26 avatar Oct 11 '23 19:10 aggielam26

Hey @aggielam26. Thanks for reaching out to us.

The version you are using uses the old, already-removed implementation. Because we are still in 0.x.x version, we are not providing bugfixes to the older releases - fixes are always in the newest versions.

Please try bumping to the newer versions of the provider (remember to follow the https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#migration-guide). Also, please bump your terraform to at least 1.1.5 version (this is required with newer provider versions).

Let me know if the error persists in the newer versions.

sfc-gh-asawicki avatar Mar 08 '24 14:03 sfc-gh-asawicki

Hey @aggielam26. Did you have a chance to migrate to the newer provider version?

sfc-gh-asawicki avatar Apr 10 '24 09:04 sfc-gh-asawicki

Closing due to inactivity. @aggielam26 please bump to the newest version and create a new issue if the problem persists.

sfc-gh-asawicki avatar Apr 26 '24 12:04 sfc-gh-asawicki