{"record":{"id":"9ae742c235af950d","repo":"grafana/k6","slug":"109","errorCode":"109","errorMessage":"unexpected k6 panic: %s\n%s","messagePattern":"unexpected k6 panic: (.+?)\n(.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/root.go","lineNumber":193,"sourceCode":"\n\treturn nil\n}\n\nfunc (c *rootCommand) execute() {\n\tctx, cancel := context.WithCancel(c.globalState.Ctx)\n\tc.globalState.Ctx = ctx\n\n\texitCode := -1\n\tdefer func() {\n\t\tcancel()\n\t\tc.stopLoggers()\n\t\tc.globalState.OSExit(exitCode)\n\t}()\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\texitCode = int(exitcodes.GoPanic)\n\t\t\terr := fmt.Errorf(\"unexpected k6 panic: %s\\n%s\", r, debug.Stack())\n\t\t\tif c.loggerIsRemote {\n\t\t\t\tc.globalState.FallbackLogger.Error(err)\n\t\t\t}\n\t\t\tc.globalState.Logger.Error(err)\n\t\t}\n\t}()\n\n\t// Completion requests for unregistered extensions must bypass Execute:\n\t// cobra's __complete writes to stdout as a side-effect, and the\n\t// provisioned binary's output would append to it, producing double output.\n\tvar err error\n\tif ext, ok := detectExtensionCompletion(c.cmd, c.globalState); ok {\n\t\terr = completeExtension(c.globalState, ext, newCacheProvisioner(c.globalState))\n\t} else {\n\t\tvar executed *cobra.Command\n\t\texecuted, err = c.cmd.ExecuteC()\n\t\t// Report subcommand usage after the command runs, regardless of its exit\n\t\t// error, so a failed subcommand is still counted.","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/cmd/root.go#L175-L211","documentation":"Error \"unexpected k6 panic: %s\n%s\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/cmd/root.go:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}