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

resource: snowflake_file_format : Error: Only one of Rename or Set can be set at once. - on provider upgrade without snowflake_file_format resource change #1947

Closed
csbain opened this issue Jul 12, 2023 · 6 comments · Fixed by #2192 or #2161
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@csbain
Copy link

csbain commented Jul 12, 2023

Provider Version

0.68.1

Terraform Version
1.5.2

Describe the bug

Redeploying a stack with snowflake_file_format, upgrading the snowflake terraform provider from a previous version (0.67.0)
The following error is received on terraform apply (plan is ok) with no changes to the snowflake_file_format resource.


│ Error: Only one of Rename or Set can be set at once.

│ with module.snowflake_table.snowflake_file_format.firehose_no_ext_json,
│ on s3_to_snowflake_pi/snowflake.tf line 101, in resource "snowflake_file_format" "firehose_no_ext_json":
│ 101: resource "snowflake_file_format" "firehose_no_ext_json" {

Expected behavior

successful apply with no error

Code samples and commands
resource "snowflake_file_format" "firehose_no_ext_json" {
name = "FIREHOSE_NO_EXT_JSON"
database = data.snowflake_database.sf_env_db.name
schema = snowflake_schema.schema.name
format_type = "JSON"
file_extension = ""
binary_format = "HEX"
trim_space = false
null_if = ["\N"]
enable_octal = false
allow_duplicate = false
strip_outer_array = false
strip_null_values = false
replace_invalid_characters = false
ignore_utf8_errors = false
skip_byte_order_mark = true
}

PLEASE NOTE null_if has not been changed since last run.

Output from plan:

module.snowflake_table.snowflake_file_format.firehose_no_ext_json will be updated in-place

~ resource "snowflake_file_format" "firehose_no_ext_json" {
id = "WAIO_DATA_UAT|RAW_WAIO_ENT_PI_SYSTEM_STREAMING|FIREHOSE_NO_EXT_JSON"
name = "FIREHOSE_NO_EXT_JSON"
~ null_if = [
- "N",
+ "\N",
]
# (25 unchanged attributes hidden)
}

Please add code examples and commands that were run to cause the problem.

Add any other context about the problem here.

This has only occured since upgrading from 0.67 to 0.68.1

@csbain csbain added the bug Used to mark issues with provider's incorrect behavior label Jul 12, 2023
@mvanzanten-infostrux
Copy link

We are seeing the same issue with an older version of Terraform (1.2.4) and a newer version of Snowflake (v0.69.0).

Is there any update on this issue? This is affecting a production rollout that was working on a previous version.

@joshtree41
Copy link

I'm still seeing this on version 0.70.0

@mddataminr
Copy link

A work around I found is to replace the file_format to allow it to update to a newer version. From Terraform Docs

terraform apply -replace="aws_instance.example"

@chriselion
Copy link

I'm seeing this on v0.74.0, even when changing the comment on a snowflake_file_format

@sfc-gh-asawicki
Copy link
Collaborator

Hey @csbain. Thanks for reporting the issue.

It seems that v0.68.0 has introduced a regression in file format resource behavior. The fix should be easy, I will handle this change this week.

sfc-gh-asawicki added a commit that referenced this issue Nov 14, 2023
sfc-gh-asawicki added a commit that referenced this issue Nov 14, 2023
* Fix file format csv parameters config

Fixes #2176

* Fix show by id for dynamic table

Fixes #2173

* Add helper method

* Refactor test

* Fix 2134

Fixes #2134

* Fix 1947

Fixes #1947

* Fix fmt

* Fix after review
@cekelly
Copy link

cekelly commented Oct 29, 2024

We are still seeing this issue when using a Parquet File Format. We are not able to set the replace_invalid_characters option. Using Release 0.78.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior
Projects
None yet
7 participants