{"record":{"id":"0e2e13e32bd76e08","repo":"grafana/k6","slug":"failed-to-derive-shared-array-name-reason-w","errorCode":null,"errorMessage":"failed to derive shared array name; reason: %w","messagePattern":"failed to derive shared array name; reason: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/experimental/csv/module.go","lineNumber":123,"sourceCode":"\t}\n\n\tparserOptions := newDefaultParserOptions()\n\tif options != nil {\n\t\tvar err error\n\t\tparserOptions, err = newParserOptionsFrom(options.ToObject(rt))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to interpret the provided Parser options; reason: %w\", err)\n\t\t}\n\t}\n\n\tr, err := NewReaderFrom(fileObj.ReadSeekStater, parserOptions)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create a new parser; reason: %w\", err)\n\t}\n\n\tunderlyingSharedArrayName, err := buildSharedArrayName(fileObj, parserOptions)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to derive shared array name; reason: %w\", err)\n\t}\n\n\tcallback := mi.vu.RegisterCallback()\n\tpromise, resolve, reject := rt.NewPromise()\n\n\tgo func() {\n\t\t// Because we rely on the data module to create the shared array, we need to\n\t\t// make sure that the data module is initialized before we can proceed, and that we don't instantiate\n\t\t// it multiple times.\n\t\t//\n\t\t// As such we hold a single instance of it in the RootModule, and we use it to create the shared array.\n\t\tfn, err := mi.dataModuleInstance.NewSharedArrayFrom(mi.vu.Runtime(), underlyingSharedArrayName, r)\n\t\tif err != nil {\n\t\t\tcallback(func() error {\n\t\t\t\treturn reject(rt.NewGoError(err))\n\t\t\t})\n\t\t\treturn\n\t\t}","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/experimental/csv/module.go#L105-L141","documentation":"Raised in csv.Parse when buildSharedArrayName fails while deriving the unique SharedArray name from the file identity and parser options — '%w' carries the underlying error (commonly failure to stat/identify the file). The name must be unique per file+options combination because the parsed data is stored once in the shared-arrays registry; if it cannot be derived, the parsed array cannot be registered.","triggerScenarios":"Thrown at internal/js/modules/k6/experimental/csv/module.go:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file handle refers to a real, stat-able file on disk","Retry the parse if the file was temporarily unavailable","Inspect the wrapped error for the stat/derivation failure detail","Report as a bug if a valid opened file consistently fails to yield a name"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}