Stale NCP source route is never invalidated after SOURCE_ROUTE_FAILURE; end device unreachable until re-pair

Aperta
#772 15 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@puddly ci sta già lavorando.

Dal 19/11/2026.

  • #778 di @puddly — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
networking

Direzione di ricerca

Start by reading handle_route_error() and the EZSP route error handling paths in bellows; the report says the handler currently only logs SOURCE_ROUTE_FAILURE. Check how the NCP exposes source-route invalidation or refresh, and how route discovery interacts with its concentrator table. Done means repeated failures stop using the stale route and the device becomes reachable without re-pairing; the issue does not identify a test file.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

An end device changed parents. After that, the coordinator kept sending to it through the old source route. Every unicast came back with ROUTE_ERROR_SOURCE_ROUTE_FAILURE for the device's NWK. Uplink from the device kept working, but every downlink command timed out. Retries with FORCE_ROUTE_DISCOVERY failed the same way. Several many-to-one route refreshes (MTORRs) happened, and other routers answered them with route records, yet the stale entry stayed. The only thing that recovers the device is re-pairing it.

bellows receives the route errors, but handle_route_error() only logs them. Nothing invalidates the NCP's source-route entry, triggers a refresh for that destination, or falls back to plain AODV.

Environment
  • Home Assistant 2026.10.4, ZHA 2.3.1, bellows 1.1.0, zigpy 2.3.0
  • Home Assistant Connect ZBT-1, firmware 7.5.1.0 build 0 (20260224005823)
  • zigpy source_routing at its default (off). The host never calls setSourceRoute or xncp_set_manual_source_route (0 occurrences in the debug log), so the stale route comes from the NCP's own concentrator table.
Device
  • Aqara H1 no-neutral switch lumi.switch.b1laus01, EndDevice, NWK 0x8F55
  • Old parent: 0xFB91 (IKEA VINDSTYRKA, router). New parent: 0xD34C (IKEA TOFSMYGGA outdoor plug), according to the neighbor tables.
  • zigbee.db, relays_v15 for this device: 0191FB. That is the last route record, still via 0xFB91.
What the logs show
  1. A read of OnOff from the host results in a sendUnicast to 0x8F55. The messageSentHandler to the first hop reports SUCCESS or NO_APS_ACK.
  2. About 0.3 s later:
incomingNetworkStatusHandler [ROUTE_ERROR_SOURCE_ROUTE_FAILURE: 11, 0x8F55]
incomingRouteErrorHandler  {'status': SOURCE_ROUTE_FAILURE: 169, 'target': 0x8F55}
Processing route error: status=sl_Status.ZIGBEE_SOURCE_ROUTE_FAILURE, nwk=0x8F55
  1. zigpy retries with APS_OPTION_RETRY|APS_OPTION_FORCE_ROUTE_DISCOVERY. The same route error comes back each time, and the request times out after 44 s. 10 of 11 reads failed this way over roughly 15 minutes, with 18 route errors logged for 0x8F55.
  2. MTORRs did go out. Route records arrived from other routers (0xFB91, 0x7C5A, 0xD14F, 0xF65E and others) within seconds.
  3. The device was then physically operated twice. Its reports arrived as INCOMING_UNICAST from 0x8F55 (last hop LQI 100 to 104, RSSI -85), once about 10 s after a refresh burst. No route record for 0x8F55 arrived either time, so the stale entry was never replaced.
Expected

Once a source route to a destination keeps failing with SOURCE_ROUTE_FAILURE, it should stop being used. The stack or bellows should drop the entry, or let AODV route discovery take over, so the device becomes reachable through its new parent without re-pairing.

Notes
  • The new parent apparently never sending a route record for its child (step 5) is what triggers this. That may be specific to the router or the device. But the coordinator has no recovery path once that happens.
  • #719 (route discovery on source-routed unicasts) only applies when source_routing is enabled, so it doesn't cover this case. Here route discovery was already requested, and was even forced, but the NCP's source-route table still took precedence.
  • A sanitized debug log excerpt is in the first comment. Device IEEE addresses are masked as <ieee>.
Lingua principale
Python
Stelle
221
Fork
104
Merge medio
3h 50m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di zigpy/bellows

Tutte le issue di zigpy/bellows

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.