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

SNOW-1061246 "account" parameter is always required by sf.DSN? #1054

Closed
williamhbaker opened this issue Feb 18, 2024 · 3 comments
Closed

SNOW-1061246 "account" parameter is always required by sf.DSN? #1054

williamhbaker opened this issue Feb 18, 2024 · 3 comments
Assignees
Labels
status-triage_done Initial triage done, will be further handled by the driver team

Comments

@williamhbaker
Copy link

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of GO driver are you using
    v1.7.2

  2. What operating system and processor architecture are you using?
    darwin/arm64

  3. What version of GO are you using?
    go version go1.22.0 darwin/arm64

  4. Server version:* E.g. 1.90.1
    8.6.2

  5. What did you do?

Tried to use sf.DSN to make a connection string from a *sf.Config, using a host that includes the account name, and it still requires that a separate account parameter be set, even though this should be optional from what I'm seeing here, since the account identifier is specified after the "@" sign, as part of the host.

This code produces an error 260000: account is empty

	cfg := &sf.Config{
		// Account:  "account",
		Host:     "<orgname>-<account_name>.snowflakecomputing.com",
		User:     "user",
		Password: "password",
	}

	dsn, err := sf.DSN(cfg)
	if err != nil {
		panic(err)
	}
	fmt.Println(dsn)
  1. What did you expect to see?

Ideally this would create a connection string without an account parameter, and include the host.

For example, this code works:

	cfg := &sf.Config{
		Account:  "account",
		Host:     "<orgname>-<account_name>.snowflakecomputing.com",
		User:     "user",
		Password: "password",
	}

	dsn, err := sf.DSN(cfg)
	if err != nil {
		panic(err)
	}
	fmt.Println(dsn)

It outputs this connection string: user:password@<orgname>-<account_name>.snowflakecomputing.com:443?account=account&ocspFailOpen=true&validateDefaultParameters=true

What I'd like is a way to get a connection string like this: user:password@<orgname>-<account_name>.snowflakecomputing.com:443?ocspFailOpen=true&validateDefaultParameters=true

  1. Can you set logging to DEBUG and collect the logs?

N/A

  1. What is your Snowflake account identifier, if any? (Optional)

N/A

@williamhbaker williamhbaker added the bug Erroneous or unexpected behaviour label Feb 18, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Feb 19, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage Issue is under initial triage and removed bug Erroneous or unexpected behaviour labels Feb 19, 2024
@sfc-gh-dszmolka
Copy link
Contributor

Hi - indeed the linked documentation bit might be a bit confusing. I believe the account is always mandatory (for other drivers too, besides the gosnowflake one) and might be optional only if you're using the connection string, something like this:
db, err := sql.Open("snowflake", "jsmith:mypassword@my_organization-my_account/mydb/testschema?warehouse=mywh")

Could this be something which works for you ?

@williamhbaker
Copy link
Author

Yes building the connection string by hand would work and I've tested that it does work without the account parameter. But I was expecting this to be optional when using sf.DSN as well.

@sfc-gh-dszmolka
Copy link
Contributor

good to hear it's working for you ! for the sf.DSN, I'm afraid you'll need to use the account as a non-optional parameter as documented.

Since this works as expected, I'm now marking this issue as closed but if you feel it's still a bug, please comment and I can reopen and look further.

@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage labels Feb 21, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka changed the title "account" parameter is always required by sf.DSN? SNOW-1061246 "account" parameter is always required by sf.DSN? Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants