{"record":{"id":"b2da1c749ac4a75a","repo":"grafana/k6","slug":"unknown-file-prefix-s-for-file-s","errorCode":null,"errorMessage":"unknown file prefix `%s` for file `%s`","messagePattern":"unknown file prefix `(.+?)` for file `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/archive.go","lineNumber":181,"sourceCode":"\t\tcase \"files\", \"scripts\": // old archives\n\t\t\t// in old archives (pre 0.25.0) names without \"_\" at the beginning were  https, the ones with \"_\" are local files\n\t\t\tpfx = \"https\"\n\t\t\tif len(name) >= 2 && name[0:2] == \"/_\" {\n\t\t\t\tpfx = \"file\"\n\t\t\t\tname = name[2:]\n\t\t\t}\n\t\t\tfallthrough\n\t\tcase \"https\", \"file\":\n\t\t\tfileSystem := arc.getFs(pfx)\n\t\t\tname = filepath.FromSlash(name)\n\t\t\tif err = fsext.WriteFile(fileSystem, name, data, fs.FileMode(hdr.Mode)); err != nil { //nolint:gosec\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif err = fileSystem.Chtimes(name, hdr.AccessTime, hdr.ModTime); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown file prefix `%s` for file `%s`\", pfx, normPath)\n\t\t}\n\t}\n\tscheme, pathOnFs := getURLPathOnFs(arc.FilenameURL)\n\tvar err error\n\tpathOnFs, err = url.PathUnescape(pathOnFs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\terr = fsext.WriteFile(arc.getFs(scheme), pathOnFs, arc.Data, 0o644) // TODO fix the mode ?\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn arc, nil\n}\n\nfunc normalizeAndAnonymizeURL(u *url.URL) {\n\tif u.Scheme == \"file\" {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/archive.go#L163-L199","documentation":"ReadArchive encountered a tar entry whose path inside the archive starts with a directory prefix that is neither a known filesystem ('https', 'file') nor a legacy 'files'/'scripts' directory. The archive is malformed or produced by an incompatible k6 version — the entry's prefix cannot be mapped to any filesystem.","triggerScenarios":"Thrown at lib/archive.go:181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate the archive with a compatible k6 version (k6 archive script.js)","Verify the .tar archive was not manually repacked or corrupted"],"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"}