t8y2/dbx · error

invalid Hive socketTimeout %q: expected seconds

Error message

invalid Hive socketTimeout %q: expected seconds

What it means

This error means the 'sockettimeout' connection parameter could not be parsed as an integer number of seconds. The Hive driver expects socketTimeout to be a plain integer (e.g. '30'), which it converts to a time.Duration in seconds; any non-numeric or malformed value causes the config parser to reject it. It is thrown during connection-string/DNS parsing in config.go before any network connection is attempted.

Source

Thrown at agents/drivers/hive-go/config.go:595

			return fmt.Errorf("invalid Hive browserResponseTimeout %q: expected positive seconds", value)
		}
		config.BrowserResponseTimeout = time.Duration(parsed) * time.Second
	}
	config.BrowserDisableSSLCheck = parameterBool(values, "browserdisablesslcheck")
	if strings.EqualFold(config.Auth, "JWT") && config.JWT == "" {
		return errors.New("Hive JWT authentication requires jwt or the JWT environment variable")
	}
	if value := parameter(values, "fetchsize"); value != "" {
		parsed, err := strconv.Atoi(value)
		if err != nil || parsed <= 0 {
			return fmt.Errorf("invalid Hive fetchSize %q: expected a positive integer", value)
		}
		config.FetchSize = parsed
	}
	if value := parameter(values, "sockettimeout"); value != "" {
		parsed, err := strconv.ParseInt(value, 10, 64)
		if err != nil {
			return fmt.Errorf("invalid Hive socketTimeout %q: expected seconds", value)
		}
		if parsed > 0 {
			config.SocketTimeout = time.Duration(parsed) * time.Second
		}
	}
	if value := parameter(values, "thrift.client.max.message.size"); value != "" {
		parsed, err := strconv.ParseInt(value, 10, 32)
		if err != nil {
			return fmt.Errorf("invalid Hive thrift.client.max.message.size %q: expected bytes", value)
		}
		if parsed > 0 {
			config.MaxMessageSize = int32(parsed)
		}
	}
	if value := parameter(values, "retries"); value != "" {
		parsed, err := strconv.Atoi(value)
		if err == nil && parsed > 0 {
			config.Retries = parsed

View on GitHub (pinned to c0390bff16)

Solutions

  1. Remove the unit suffix and pass bare seconds as an integer, e.g. sockettimeout=30
  2. Validate the value with strconv.ParseInt before building the DSN
  3. Remove the sockettimeout parameter entirely to fall back to the driver default

Example fix

// before
dsn := "hive://user@host:10000/db?sockettimeout=30s"
// after
dsn := "hive://user@host:10000/db?sockettimeout=30"
Defensive patterns

Strategy: validation

Validate before calling

func validSocketTimeout(v string) bool {
	_, err := strconv.ParseInt(v, 10, 64)
	return err == nil
}
// use: if p := params["sockettimeout"]; p != "" && !validSocketTimeout(p) { /* fix before connecting */ }

Try / catch

if _, err := driver.Open(dsn); err != nil {
	var cerr *ConfigError
	if errors.As(err, &cerr) { return fmt.Errorf("bad DSN param: %w", err) }
	return err
}

Prevention

When it happens

Trigger: Passing sockettimeout=30s, sockettimeout=30 seconds, sockettimeout="30,000", or any non-integer value in the Hive DSN / parameter map to the driver's config parser.

Common situations: Copy-pasting a timeout with a unit suffix (Go duration style like '30s' or '500ms') from another driver; locale-formatted numbers with thousands separators; leaving a placeholder value like 'sockettimeout=<seconds>' in a config template.

Understand the failure class

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/49ed97f07fb7011f. Report an issue: GitHub.