{"record":{"id":"6a60e7b2a16b406b","repo":"a-b-street/abstreet","slug":"can-t-start-a-trip-from","errorCode":null,"errorMessage":"can't start a {} trip from {}","messagePattern":"can't start a (.+?) trip from (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"sim/src/make/spawner.rs","lineNumber":251,"sourceCode":"                                car: use_vehicle.unwrap(),\n                            }\n                        } else {\n                            TripSpec::UsingBike {\n                                start: start_bldg,\n                                goal,\n                                bike: use_vehicle.unwrap(),\n                            }\n                        }\n                    }\n                    TripEndpoint::Border(i) => {\n                        let start_lane = map\n                            .get_i(i)\n                            .some_outgoing_road(map)\n                            // TODO Since we're now doing this right when the trip is starting,\n                            // pick the least loaded lane or similar.\n                            .and_then(|dr| dr.lanes(constraints, map).pop())\n                            .ok_or_else(|| {\n                                anyhow!(\"can't start a {} trip from {}\", mode.ongoing_verb(), i)\n                            })?;\n                        TripSpec::VehicleAppearing {\n                            start_pos: Position::new(start_lane, SPAWN_DIST),\n                            goal,\n                            use_vehicle: use_vehicle.unwrap(),\n                            retry_if_no_room,\n                        }\n                    }\n                    TripEndpoint::SuddenlyAppear(start_pos) => TripSpec::VehicleAppearing {\n                        start_pos,\n                        goal,\n                        use_vehicle: use_vehicle.unwrap(),\n                        retry_if_no_room,\n                    },\n                }\n            }\n            TripMode::Walk => TripSpec::JustWalking {\n                start: start_sidewalk_spot(from, map)?,","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/sim/src/make/spawner.rs#L233-L269","documentation":"When a trip begins from a TripEndpoint that isn't a building or sidewalk position, maybe_new must find a driving lane the vehicle can appear on: it takes some outgoing road of the endpoint intersection and pops a lane matching the constraints. If none exists, this error naming the trip mode and endpoint index is thrown — the trip cannot physically start at that location.","triggerScenarios":"Calling Spawner::maybe_new (e.g. via ScheduledTrips / endless events) where the TripEndpoint's intersection has no outgoing road with a drivable lane matching `constraints` — the and_then chain yields None for a VehicleAppearing TripSpec.","commonSituations":"Spawning car trips at border intersections with only incoming lanes; maps where drivable lanes were filtered by constraints (e.g. bus-only); trip seeds generated for a different map version than the one loaded; endpoints on pedestrian-only roads.","solutions":["Verify the spawn endpoint intersection has outgoing driving lanes matching the trip's constraints in the loaded map","Regenerate trip seeds against the same map version used at simulation time","Change the endpoint to a nearby intersection/building with drivable access","Fall back to a walking or transit trip when no driving lane exists"],"exampleFix":"// before\n.and_then(|dr| dr.lanes(constraints, map).pop())\n.ok_or_else(|| anyhow!(\"can't start a {} trip from {}\", mode.ongoing_verb(), i))?;\n// after\n.and_then(|dr| dr.lanes(constraints, map).pop())\n.with_context(|| format!(\"can't start a {} trip from {}; endpoint has no outgoing drivable lane\", mode.ongoing_verb(), i))\n.and_then(|lane| Ok(lane)); // or skip this trip and warn instead of failing the batch\nlet start_lane = match start_lane {\n    Some(l) => l,\n    None => { warn!(\"skipping {}: no drivable lane at {}\", mode.ongoing_verb(), i); continue; }\n};","handlingStrategy":"fallback","validationCode":"// before spawning\nif let TripEndpoint::Border(i) = endpoint {\n    let ok = map.get_i(i).some_outgoing_road(map)\n        .and_then(|dr| dr.lanes(constraints, map).pop()).is_some();\n    if !ok { /* relocate endpoint or change mode */ }\n}","typeGuard":null,"tryCatchPattern":"match spawner.maybe_new(...) { Err(e) if e.to_string().starts_with(\"can't start a\") => { warn!(\"{}; skipping trip\", e); continue; }, r => r }","preventionTips":["Generate trip endpoints from the same map version used for the simulation","Confirm border intersections have outgoing drivable lanes before seeding car trips","Reduce constraint strictness for spawn-lane selection","Count and report skipped trips instead of failing the batch"],"tags":["simulation","spawning","trips","routing"],"backgroundTag":"invalid-state-transition","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}