projectdiscovery/katana · error
could not get vertex
Error message
could not get vertex
What it means
CrawlGraph.GetPageState fails when graph.Vertex(id) cannot find or return the vertex for the given page-state hash — i.e. the requested state was never added to the crawl graph or the ID is wrong. Callers isCorrectNavigation and navigateBackToStateOrigin rely on this lookup to validate or plan navigation.
Solutions
- Check the wrapped error for graph.ErrVertexNotFound and treat the state as unknown
- Confirm the hash ID passed in was produced by the same crawl run (sha256 of stripped DOM)
- Ensure AddPageState was called for the state before looking it up
- Return a typed not-found error so callers can distinguish missing states from graph failures
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at pkg/engine/headless/graph/graph.go:108 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/cd982cab2c5a3011.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/engine/headless/graph/graph.go:108
func (g *CrawlGraph) GetPageState(id string) (*types.PageState, error) {
pageVertex, err := g.graph.Vertex(id)
if err != nil {
return nil, errors.Wrap(err, "could not get vertex")
}
return &pageVertex, nil
}View on GitHub (pinned to e3e742739c)