projectdiscovery/katana · error
could not find path to origin page
Error message
could not find path to origin page
What it means
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.
Source
Thrown at pkg/engine/headless/crawler/state.go:307
if errors.Is(err, graphlib.ErrTargetNotReachable) {
c.logger.Debug("Target not reachable, reaching from blank state",
slog.String("action_origin_id", action.OriginID),
)
actions, err = c.crawlGraph.ShortestPath(emptyPageHash, action.OriginID)
if err != nil {
return "", errors.Wrap(err, "could not find path to origin page")
}
} else {
return "", errors.Wrap(err, "failed to find shortest path")
}
}View on GitHub (pinned to e3e742739c)
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
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at pkg/engine/headless/crawler/state.go:307 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of projectdiscovery/katana@e3e742739c (2026-09-03).
Data as JSON: /api/errors/ed546f8c85f1b8bd.
Report an issue: GitHub.