{"record":{"id":"35a77af963c54110","repo":"projectdiscovery/katana","slug":"unknown-action-type-v","errorCode":null,"errorMessage":"unknown action type: %v","messagePattern":"unknown action type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/engine/headless/crawler/crawler.go","lineNumber":551,"sourceCode":"\t\tif err != nil {\n\t\t\tvar ce *rod.CoveredError\n\t\t\tif errors.As(err, &ce) {\n\t\t\t\treturn ErrElementNotVisible\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tif interactable == nil {\n\t\t\treturn ErrElementNotVisible\n\t\t}\n\n\t\tif err := element.Click(proto.InputMouseButtonLeft, 1); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = page.WaitPageLoadHeurisitics(); err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown action type: %v\", action.Type)\n\t}\n\n\treturn nil\n}\n\nfunc (c *Crawler) tryAutoLogin(page *browser.BrowserPage, html string) bool {\n\tpageResult, err := c.options.DitClassifier.ExtractPageType(html)\n\tif err != nil || pageResult == nil {\n\t\treturn false\n\t}\n\n\tfor _, form := range pageResult.Forms {\n\t\tif form.Type != \"login\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tpageURL := \"\"\n\t\tif info, err := page.Info(); err == nil {","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/engine/headless/crawler/crawler.go#L533-L569","documentation":"dispatchCrawlAction switches on action.Type to execute the requested crawl action (click, navigate, wait, etc.). If an action's Type is not one of the handled constants, the default branch returns this error naming the raw type value. It means the crawler encountered an action definition it does not know how to execute.","triggerScenarios":"An action record carries a Type outside the known enum — e.g. from a custom action list, an outdated/renamed enum value, or a caller constructing actions programmatically with an invalid/zero Type.","commonSituations":"Custom crawl-action configuration referencing a type unsupported by this katana version; schema evolution where a new action type was added in config before the engine was upgraded; a typo'd action type string/constant.","solutions":["Log action.Type and compare with the supported action constants in the headless crawler package","Fix the action definition in your crawl config (typo/renamed type)","Upgrade katana to a version that supports the action type you need","Filter or skip unknown actions before dispatching if you build action lists dynamically"],"exampleFix":"// before\nactions := []{ {Type: \"hover\"} } // not supported by this version\n\n// after\nactions := []{ {Type: \"click\"} } // use a supported action type","handlingStrategy":"validation","validationCode":"supportedActions := map[ActionType]bool{ActionClick: true, ActionNavigate: true, ActionWait: true /* ...supported set */}\nfor _, a := range actions {\n\tif !supportedActions[a.Type] {\n\t\treturn fmt.Errorf(\"dropping unsupported crawl action %v\", a.Type)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate action lists against supported types before crawling","Keep action definitions and katana version in sync","Use named constants, not raw strings/ints, when building actions programmatically","Log and skip unknown actions instead of failing the whole crawl"],"tags":["crawler","headless","unknown-value","dispatch"],"backgroundTag":"invalid-enum-value","analyzedSha":"e3e742739c3746f085943ce918fb4e2b8daf6fe6","analyzedAt":"2026-09-03T14:55:13.248Z","contentChangedAt":"2026-09-03T14:55:13.248Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}