terraform-provider-snowflake
terraform-provider-snowflake copied to clipboard
Unable to list functions using provider v0.70.1
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(
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" = "
Code samples and commands
Data source declaration:
data "snowflake_functions" "current"{
depends_on = [snowflake_function.exampleone,snowflake_function.exampletwo]
database = "
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.
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.
Hey @aggielam26. Did you have a chance to migrate to the newer provider version?
Closing due to inactivity. @aggielam26 please bump to the newest version and create a new issue if the problem persists.