{"record":{"id":"b134c522bf5ef61e","repo":"grafana/k6","slug":"couldn-t-make-a-batch-w","errorCode":null,"errorMessage":"couldn't make a batch: %w","messagePattern":"couldn't make a batch: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/influxdb/output.go","lineNumber":115,"sourceCode":"\t\t\t\tv, err = strconv.ParseFloat(val, 64)\n\t\t\tcase Int:\n\t\t\t\tv, err = strconv.ParseInt(val, 10, 64)\n\t\t\t}\n\t\t\tif err == nil {\n\t\t\t\tvalues[tag] = v\n\t\t\t} else {\n\t\t\t\tvalues[tag] = val\n\t\t\t}\n\t\t\tdelete(tags, tag)\n\t\t}\n\t}\n\treturn values\n}\n\nfunc (o *Output) batchFromSamples(containers []metrics.SampleContainer) (client.BatchPoints, error) {\n\tbatch, err := client.NewBatchPoints(o.BatchConf)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"couldn't make a batch: %w\", err)\n\t}\n\n\ttype cacheItem struct {\n\t\ttags   map[string]string\n\t\tvalues map[string]any\n\t}\n\tcache := map[*metrics.TagSet]cacheItem{}\n\tfor _, container := range containers {\n\t\tsamples := container.GetSamples()\n\t\tfor _, sample := range samples {\n\t\t\tvar tags map[string]string\n\t\t\tvalues := make(map[string]any)\n\t\t\tif cached, ok := cache[sample.Tags]; ok {\n\t\t\t\ttags = cached.tags\n\t\t\t\tmaps.Copy(values, cached.values)\n\t\t\t} else {\n\t\t\t\ttags = sample.Tags.Map()\n\t\t\t\to.extractTagsToValues(tags, values)","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/influxdb/output.go#L97-L133","documentation":"The InfluxDB output failed to initialize the batch points container via client.NewBatchPoints with the configured BatchPointsConfig (precision, database, retention policy, write consistency). This wraps the underlying influxdb client error before any samples are converted.","triggerScenarios":"Thrown at internal/output/influxdb/output.go:115 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the exact cause (e.g. invalid precision or database name)","Verify K6_INFLUXDB_PRECISION, K6_INFLUXDB_DB, retention and consistency settings","Ensure the target database exists on the InfluxDB server"],"exampleFix":null,"handlingStrategy":"fallback","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"}