{"record":{"id":"ed546f8c85f1b8bd","repo":"projectdiscovery/katana","slug":"could-not-find-path-to-origin-page","errorCode":null,"errorMessage":"could not find path to origin page","messagePattern":"could not find path to origin page","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/engine/headless/crawler/state.go","lineNumber":307,"sourceCode":"\t\tif errors.Is(err, graphlib.ErrTargetNotReachable) {\n\t\t\tc.logger.Debug(\"Target not reachable, reaching from blank state\",\n\t\t\t\tslog.String(\"action_origin_id\", action.OriginID),\n\t\t\t)\n\n\t\t\tactions, err = c.crawlGraph.ShortestPath(emptyPageHash, action.OriginID)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", errors.Wrap(err, \"could not find path to origin page\")\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"\", errors.Wrap(err, \"failed to find shortest path\")\n\t\t}\n\t}","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/projectdiscovery/katana/blob/e3e742739c3746f085943ce918fb4e2b8daf6fe6/pkg/engine/headless/crawler/state.go#L289-L325","documentation":"tryShortestPathNavigation fails when, after the direct path was found unreachable (graphlib.ErrTargetNotReachable), the retry from the empty/blank page hash also cannot produce a path to the action's origin page in the crawl graph. The crawler cannot reconstruct the sequence of actions needed to return to the origin state.","triggerScenarios":"Thrown at pkg/engine/headless/crawler/state.go:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log action.OriginID and currentPageHash to check whether the origin vertex exists in the graph","Treat as non-navigable and return ErrNoNavigationPossible so the caller can skip the action","Re-add the missing origin vertex/page state if it was pruned from the crawl graph","Reset the page to a known blank state and re-attempt the action from scratch"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}