Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Stage resource does not specify database in transaction #994

Closed
sfc-gh-cfraleigh opened this issue May 4, 2022 · 2 comments
Closed

Stage resource does not specify database in transaction #994

sfc-gh-cfraleigh opened this issue May 4, 2022 · 2 comments
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@sfc-gh-cfraleigh
Copy link

Provider Version

0.25.36

Terraform Version

1.1.7

Describe the bug

When adding a new stage resource, getting this error

Error: error creating stage CONVOY_KAFKA_S3_STAGE: 090105 (22000): Cannot perform operation. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.

Expected behavior

Because the stage resource builds with a fully qualified name, I would expect this to not be an issue. I suspect snowflake would use the default catalog assigned to the user or service account used to make the call to snowflake. but if there is no default catalog, it doesn't use the database name passed into the resource.

Code samples and commands

this is from a TF apply

Additional context

apply output:

 # module.stage__lz_kafka_s3.snowflake_stage.stage will be created
  + resource "snowflake_stage" "stage" {
      + aws_external_id    = (known after apply)
      + copy_options       = "ON_ERROR=ABORT_STATEMENT,SIZE_LIMIT=16777216,PURGE=false,RETURN_FAILED_ONLY=false,MATCH_BY_COLUMN_NAME=NONE,ENFORCE_LENGTH=true,TRUNCATECOLUMNS=false,FORCE=false"
      + database           = "DB_NAME_HERE"
      + file_format        = "FORMAT_NAME=a_file_format"
      + id                 = (known after apply)
      + name               = "stage_name"
      + schema             = "My_schema"
      + snowflake_iam_user = (known after apply)
      + url                = "an_s3_url"
    }
@sfc-gh-cfraleigh sfc-gh-cfraleigh added the bug Used to mark issues with provider's incorrect behavior label May 4, 2022
@rubemz
Copy link

rubemz commented Jun 30, 2022

The same happens for pipes. See #533

@sfc-gh-asawicki
Copy link
Collaborator

We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.

@sfc-gh-asawicki sfc-gh-asawicki closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Used to mark issues with provider's incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants