a-b-street/abstreet · error

no path found

Error message

no path found

What it means

When deciding the commute mode for a synthetic person, create_prole measures the pedestrian path length between home and work. If the pedestrian pathfinder cannot find any path, the generation of that person fails with 'no path found'.

Solutions

  1. Fix map connectivity (sidewalk/crossing data in the OSM import) so home and work are walkable-connected
  2. Fall back to another mode or skip the individual instead of failing
  3. Rebuild the pathfinder after map edits so it reflects current connectivity

Example fix

// before
let path = map.pathfind(req).ok()?;
// after
let path = match map.pathfind(req) {
    Some(p) => p,
    None => { warn!("skipping prole with no walkable path"); return Ok(None); }
};
Defensive patterns

Strategy: fallback

Validate before calling

let connected = map.pathfind(PathRequest::find_req(map, home, work, PathConstraints::Pedestrian)).is_some();
if !connected { eprintln!("home and work not walkable-connected"); }

Try / catch

match create_prole(map, rng, home, work, ...) {
    Ok(p) => Some(p),
    Err(e) if e.to_string() == "no path found" => { skipped += 1; None }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: map.pathfind on a pedestrian PathRequest between the home and work endpoints returns no route, e.g. endpoints on disconnected road/sidewalk networks or inaccessible buildings.

Common situations: OSM imports with severed sidewalks or missing pedestrian connections, buildings not attached to the walkable network, maps split by highways without crossings.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13). Data as JSON: /api/errors/5f3997000944d728. Report an issue: GitHub.

Appendix: source

Thrown at synthpop/src/make/activity_model.rs:230

        bail!("TODO: handle working and living in the same building");
    }

    let mode = match (&home, &work) {
        // commuting entirely within map
        (TripEndpoint::Building(home_bldg), TripEndpoint::Building(work_bldg)) => {
            // Decide mode based on walking distance. If the buildings aren't connected,
            // probably a bug in importing; just skip this person.
            let dist = if let Some(path) = PathRequest::between_buildings(
                map,
                *home_bldg,
                *work_bldg,
                PathConstraints::Pedestrian,
            )
            .and_then(|req| map.pathfind(req).ok())
            {
                path.total_length()
            } else {
                bail!("no path found");
            };

            // TODO If home or work is in an access-restricted zone (like a living street),
            // then probably don't drive there. Actually, it depends on the specific tagging;
            // access=no in the US usually means a gated community.
            select_trip_mode(dist, rng)
        }
        // if you exit or leave the map, we assume driving
        _ => TripMode::Drive,
    };

    // TODO This will cause a single morning and afternoon rush. Outside of these times,
    // it'll be really quiet. Probably want a normal distribution centered around these
    // peak times, but with a long tail.
    let mut depart_am = rand_time(
        rng,
        Time::START_OF_DAY + Duration::hours(7),
        Time::START_OF_DAY + Duration::hours(10),

View on GitHub (pinned to 0964f29315)