{"record":{"id":"02c5b81585a2d481","repo":"grafana/k6","slug":"a-tag-name-s-shows-up-more-than-once-in-influxd","errorCode":null,"errorMessage":"a tag name (%s) shows up more than once in InfluxDB field type configurations","messagePattern":"a tag name \\((.+?)\\) shows up more than once in InfluxDB field type configurations","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/influxdb/util.go","lineNumber":56,"sourceCode":"\treturn client.NewHTTPClient(clientHTTPConfig)\n}\n\n// MakeBatchConfig returns a new InfluxDB BatchPointsConfig based on the given\nfunc MakeBatchConfig(conf Config) client.BatchPointsConfig {\n\tif !conf.DB.Valid || conf.DB.String == \"\" {\n\t\tconf.DB = null.StringFrom(\"k6\")\n\t}\n\treturn client.BatchPointsConfig{\n\t\tPrecision:        conf.Precision.String,\n\t\tDatabase:         conf.DB.String,\n\t\tRetentionPolicy:  conf.Retention.String,\n\t\tWriteConsistency: conf.Consistency.String,\n\t}\n}\n\nfunc checkDuplicatedTypeDefinitions(fieldKinds map[string]FieldKind, tag string) error {\n\tif _, found := fieldKinds[tag]; found {\n\t\treturn fmt.Errorf(\"a tag name (%s) shows up more than once in InfluxDB field type configurations\", tag)\n\t}\n\treturn nil\n}\n\n// MakeFieldKinds reads the Config and returns a lookup map of tag names to\n// the field type their values should be converted to.\nfunc MakeFieldKinds(conf Config) (map[string]FieldKind, error) {\n\tfieldKinds := make(map[string]FieldKind)\n\tfor _, tag := range conf.TagsAsFields {\n\t\tfieldName, fieldType, _ := strings.Cut(tag, \":\")\n\t\tif fieldType == \"\" {\n\t\t\tfieldType = \"string\"\n\t\t}\n\n\t\terr := checkDuplicatedTypeDefinitions(fieldKinds, fieldName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/influxdb/util.go#L38-L74","documentation":"The K6_INFLUXDB_TAGS_AS_FIELDS configuration maps the same tag/field name to more than one field type. checkDuplicatedTypeDefinitions is a guard that rejects a field kind map containing duplicate entries for a tag name.","triggerScenarios":"Thrown at internal/output/influxdb/util.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure each tag appears only once in K6_INFLUXDB_TAGS_AS_FIELDS with a single type suffix","Change conflicting entries to use one consistent type, e.g. my_tag:float"],"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-14T00:17:10.932Z"}