{"record":{"id":"06a149d5cd5fd394","repo":"grafana/k6","slug":"parsing-q-needs","errorCode":null,"errorMessage":"parsing %q, needs =","messagePattern":"parsing %q, needs =","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/secretsource/file/file.go","lineNumber":32,"sourceCode":"\tsecretsource.RegisterExtension(\"file\", func(params secretsource.Params) (secretsource.Source, error) {\n\t\tfss := &fileSecretSource{}\n\t\terr := fss.parseArg(params.ConfigArgument)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tf, err := params.FS.Open(fss.filename)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tscanner := bufio.NewScanner(f)\n\n\t\tfss.internal = make(map[string]string)\n\t\tfor scanner.Scan() {\n\t\t\tline := scanner.Text()\n\t\t\tk, v, ok := strings.Cut(line, \"=\")\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"parsing %q, needs =\", line)\n\t\t\t}\n\n\t\t\tfss.internal[k] = v\n\t\t}\n\t\treturn fss, nil\n\t})\n}\n\nfunc (fss *fileSecretSource) parseArg(config string) error {\n\tlist := strings.Split(config, \",\")\n\tif len(list) >= 1 {\n\t\tfor _, kv := range list {\n\t\t\tk, v, ok := strings.Cut(kv, \"=\")\n\t\t\tif !ok {\n\t\t\t\tfss.filename = kv\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tswitch k {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/secretsource/file/file.go#L14-L50","documentation":"A line in the secrets file passed to the 'file' secret source (K6_SECRET_SOURCE=file:<path>) does not contain an '=' separator, so key and value cannot be split. The whole extension initialization aborts on the first malformed line.","triggerScenarios":"Thrown at internal/secretsource/file/file.go:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add '=' to every line, e.g. MY_SECRET=value","Remove blank or malformed lines from the secrets file"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}