{"record":{"id":"c0568f2334b5c777","repo":"grafana/k6","slug":"emulating-timezone-q-w","errorCode":null,"errorMessage":"emulating timezone %q: %w","messagePattern":"emulating timezone %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/frame_session.go","lineNumber":242,"sourceCode":"\nfunc (fs *FrameSession) emulateLocale() error {\n\taction := emulation.SetLocaleOverride().WithLocale(fs.page.browserCtx.opts.Locale)\n\tif err := action.Do(cdp.WithExecutor(fs.ctx, fs.session)); err != nil {\n\t\tif strings.Contains(err.Error(), \"Another locale override is already in effect\") {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"emulating locale %q: %w\", fs.page.browserCtx.opts.Locale, err)\n\t}\n\treturn nil\n}\n\nfunc (fs *FrameSession) emulateTimezone() error {\n\taction := emulation.SetTimezoneOverride(fs.page.browserCtx.opts.TimezoneID)\n\tif err := action.Do(cdp.WithExecutor(fs.ctx, fs.session)); err != nil {\n\t\tif strings.Contains(err.Error(), \"Timezone override is already in effect\") {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"emulating timezone %q: %w\", fs.page.browserCtx.opts.TimezoneID, err)\n\t}\n\treturn nil\n}\n\nfunc (fs *FrameSession) getNetworkManager() *NetworkManager {\n\treturn fs.networkManager\n}\n\nfunc (fs *FrameSession) initDomains() error {\n\tactions := []Action{\n\t\t// TODO: can we get rid of the following by doing DOM related stuff in JS instead?\n\t\tdom.Enable(),\n\t\tcdplog.Enable(),\n\t\tcdpruntime.Enable(),\n\t\ttarget.SetAutoAttach(true, true).WithFlatten(true),\n\t}\n\tfor _, action := range actions {\n\t\tif err := action.Do(cdp.WithExecutor(fs.ctx, fs.session)); err != nil {","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/grafana/k6/blob/3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee/internal/js/modules/k6/browser/common/frame_session.go#L224-L260","documentation":"During initOptions, the Emulation.setTimezoneOverride CDP call failed while applying the browser context's configured timezone ID. Chromium rejected the timezone (invalid identifier) or the session was in a bad state; the error is wrapped with the timezone string.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/frame_session.go:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid IANA timezone ID, e.g. 'America/New_York' or 'Europe/Berlin' (K6_BROWSER_TIMEZONE)","Check the wrapped CDP error for Chromium's reason","Remove the timezone option if not needed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3fcf5388d78cb382f0c0d42ec556a06bfd1b8dee","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}