{"record":{"id":"a993711120232eec","repo":"golang-migrate/migrate","slug":"invalid-value-for-x-connect-insecure-w","errorCode":null,"errorMessage":"invalid value for x-connect-insecure: %w","messagePattern":"invalid value for x-connect-insecure: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"database/rqlite/rqlite.go","lineNumber":322,"sourceCode":"func parseConfigFromQuery(queryVals nurl.Values) (*Config, error) {\n\tc := Config{\n\t\tConnectInsecure: DefaultConnectInsecure,\n\t\tMigrationsTable: DefaultMigrationsTable,\n\t}\n\n\tmigrationsTable := queryVals.Get(\"x-migrations-table\")\n\tif migrationsTable != \"\" {\n\t\tif strings.HasPrefix(migrationsTable, \"sqlite_\") {\n\t\t\treturn nil, fmt.Errorf(\"invalid value for x-migrations-table: %w\", ErrBadConfig)\n\t\t}\n\t\tc.MigrationsTable = migrationsTable\n\t}\n\n\tconnectInsecureStr := queryVals.Get(\"x-connect-insecure\")\n\tif connectInsecureStr != \"\" {\n\t\tconnectInsecure, err := strconv.ParseBool(connectInsecureStr)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid value for x-connect-insecure: %w\", ErrBadConfig)\n\t\t}\n\t\tc.ConnectInsecure = connectInsecure\n\t}\n\n\treturn &c, nil\n}\n","sourceCodeStart":304,"sourceCodeEnd":329,"githubUrl":"https://github.com/golang-migrate/migrate/blob/01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a/database/rqlite/rqlite.go#L304-L329","documentation":"\"invalid value for x-connect-insecure: %w\" is raised in rqlite's parseConfigFromQuery (rqlite.go:322) when the x-connect-insecure query parameter cannot be parsed by strconv.ParseBool, wrapping ErrBadConfig. The parameter controls whether the connection is downgraded to plain http and therefore must be a Go-parseable boolean. Accepted values are 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False — not \"yes\", \"no\", or \"on\".","triggerScenarios":"URLs like ...?x-connect-insecure=yes, x-connect-insecure=on, x-connect-insecure=enabled, or with stray whitespace/quotes.","commonSituations":"Using SQL-style or CLI-style boolean conventions (yes/no/on/off) in the DSN; shell quoting or env-var interpolation injecting whitespace or empty quotes into the URL.","solutions":["Use a ParseBool-compatible value: x-connect-insecure=true or x-connect-insecure=false","Use 1/0 if you prefer a short form","Check the env vars interpolated into the DSN for stray whitespace or quotes before the URL is built"],"exampleFix":"// before\nurl := \"rqlite://localhost:4001/db?x-connect-insecure=yes\"\n// after\nurl := \"rqlite://localhost:4001/db?x-connect-insecure=true\"","handlingStrategy":"validation","validationCode":"v := q.Get(\"x-connect-insecure\")\nif v != \"\" {\n    if _, err := strconv.ParseBool(v); err != nil {\n        return fmt.Errorf(\"x-connect-insecure %q is not a valid bool\", v)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use 1/0/true/false (and Go's t/T/TRUE variants) for boolean query params","Never use yes/no/on/off in DSN query strings","Check for whitespace/quotes in env vars interpolated into URLs"],"tags":["go","golang-migrate","rqlite","config","query-params","boolean-parsing"],"backgroundTag":"invalid-dsn-parameter","analyzedSha":"01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a","analyzedAt":"2026-09-02T19:38:29.671Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}