OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
443 stars 40 forks source link

stdcm: null pointer exception in an empty timetable #7871

Closed bloussou closed 3 months ago

bloussou commented 3 months ago

What happened?

The error:

{"status":500,"type":"core:unknown_error","context":{"stack_trace":["RawInfraImpl.kt:609","BlockAvailability.kt:145","BlockAvailability.kt:106","STDCMEndpointV2.kt:79","FkRegex.java:153","FkRegex.java:217","FkChain.java:72","TkFork.java:98","TkDataDog.kt:27","TkDataDog.kt:16","TkDataDog.kt:15","TkWrap.java:58","TkFallback.java:84","TkFallback.java:66","TkWrap.java:58","TkSlf4j.java:110","BkBasic.java:123","BkBasic.java:99","BkSafe.java:46","BkWrap.java:51","BkParallel.java:81","ThreadPoolExecutor.java:1144","ThreadPoolExecutor.java:642","Thread.java:1583"],"url":"http://osrd-rec-core.osd-rec01.svc.cluster.local/v2/stdcm","exception_type":"class java.lang.NullPointerException"},"message":"An unknown exception was thrown"}

What did you expect to happen?

No error

How can we reproduce it (as minimally and precisely as possible)?

  1. create an empty scenario with TSv2
  2. try a STDCM path like : image

What operating system, browser and environment are you using?

OSRD version (top right corner Account button > Informations)

d9655c0

eckter commented 3 months ago

Error context is

    override fun getTrackChunkZone(chunk: TrackChunkId): ZoneId {
        return chunkToZoneMap[chunk]!!
    }

Meaning that a chunk does not have a zone. That is weird.

eckter commented 3 months ago

I can't reproduce locally, with the exact same parameter on the exact same commit :thinking:

Was the infra edited in any way?

bloussou commented 3 months ago

Nope the infra is not edited

eckter commented 3 months ago

Can easily be reproduced by just iterating over the chunks and checking whether they have a matching zone

            for (track in infra.rawInfra.trackSections) {
                for (chunk in infra.rawInfra.getTrackSectionChunks(track)) {
                    val tmp = infra.rawInfra.getTrackChunkZone(chunk)
                    println(tmp)
                }
            }
Erashin commented 3 months ago

Sur l'infra France, on a 2465 chunks sans zones :D Je vais essayer de voir pk, mais c'est drôle en tout cas.