{"record":{"id":"92b2104da2c45f00","repo":"cilium/cilium","slug":"route-s-not-found","errorCode":null,"errorMessage":"route %s not found","messagePattern":"route (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/datapath/linux/route/reconciler/manager.go","lineNumber":201,"sourceCode":"\tif err := m.selectRoutes(txn, route.GetOwnerlessKey()); err != nil {\n\t\treturn err\n\t}\n\n\ttxn.Commit()\n\treturn nil\n}\n\nconst reconciliationTimeout = 1 * time.Second\n\nfunc (m *DesiredRouteManager) waitForReconciliation(routeKey DesiredRouteKey) error {\n\tt := time.NewTimer(reconciliationTimeout)\n\tdefer t.Stop()\n\n\tvar err error\n\tfor {\n\t\tobj, _, watch, found := m.tbl.GetWatch(m.db.ReadTxn(), DesiredRouteIndex.Query(routeKey))\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"route %s not found\", routeKey)\n\t\t}\n\n\t\tif obj.status.Kind == reconciler.StatusKindDone {\n\t\t\t// already reconciled\n\t\t\treturn nil\n\t\t}\n\n\t\tselect {\n\t\tcase <-t.C:\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"timeout waiting for parameter %s reconciliation: %w\", routeKey, err)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"timeout waiting for parameter %s reconciliation\", routeKey)\n\t\tcase <-watch:\n\t\t\tif obj.status.Kind == reconciler.StatusKindDone {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif obj.status.Kind == reconciler.StatusKindError {","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/datapath/linux/route/reconciler/manager.go#L183-L219","documentation":"waitForReconciliation (used by UpsertRouteWait) queries the statedb DesiredRouteIndex for the requested route key. If no desired route object exists in the table, it immediately returns 'route %s not found' instead of waiting for reconciliation.","triggerScenarios":"Calling UpsertRouteWait with a route key that was never inserted (or already deleted) into the route reconciler's statedb table.","commonSituations":"Caller builds a route key that doesn't match the stored DesiredRoute (index mismatch); a concurrent Delete removed the route before the wait; route upsert skipped due to earlier validation failure.","solutions":["Upsert the DesiredRoute before calling UpsertRouteWait","Verify the route key matches the DesiredRouteIndex key format","Check whether another component deleted the route concurrently","Inspect the statedb table to confirm the route exists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure the desired route exists before waiting\ntxn := db.WriteTxn(obj)\n_, _, err := tbl.Insert(txn, obj)\ntxn.Commit()\nif err != nil { return err }\nreturn mgr.UpsertRouteWait(ctx, routeKey, timeout)","typeGuard":"if _, _, found := tbl.GetWatch(db.ReadTxn(), DesiredRouteIndex.Query(routeKey)); !found { return fmt.Errorf(\"no desired route for %s\", routeKey) }","tryCatchPattern":"if err := mgr.UpsertRouteWait(ctx, route, timeout); err != nil {\n    if strings.HasPrefix(err.Error(), \"route \") && strings.HasSuffix(err.Error(), \" not found\") { /* upsert first */ }\n    return err\n}","preventionTips":["Always upsert the DesiredRoute before calling UpsertRouteWait","Use the exact index key format of DesiredRouteIndex","Guard against concurrent deletes of the same route"],"tags":["routing","reconciler","statedb"],"backgroundTag":"route-not-found","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}