Skip to content

SNOW-2135301: Connection fails when Host is provided but Account is not #1432

@frbvianna

Description

@frbvianna
  1. What version of GO driver are you using?
    1.14.1

  2. What operating system and processor architecture are you using?
    macOS 15.3.1, ARM64

  3. What version of GO are you using?
    1.24.1

  4. Server version:
    9.14.2

  5. What did you do?

Try to connect by initializing a Connector using Config instead of DSN:

	ctor := gosnowflake.NewConnector(gosnowflake.SnowflakeDriver{}, gosnowflake.Config{
		Host:     "<account>.snowflakecomputing.com",
		Port:     443,
		User:     "<user>",
		Password: "<pwd>",
		Database: "<db>",
	})

	_, err := ctor.Connect(ctx)
	if err != nil {
		return fmt.Errorf("failed to connect to Snowflake: %w", err)
	}
  1. What did you expect to see?

Expected to be able to connect since the account identifier can be implied from the Host, but received the following error instead:
failed to connect to Snowflake: 260000: account is empty

Can't the driver parse the account from the host similarly to how it's done in ParseDSN?

gosnowflake/dsn.go

Lines 427 to 430 in a1a961d

posDot := strings.Index(cfg.Host, ".")
if posDot > 0 {
cfg.Account = cfg.Host[:posDot]
}

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

    N/A

Metadata

Metadata

Labels

enhancementThe issue is a request for improvement or a new featurestatus-triage_doneInitial triage done, will be further handled by the driver team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions