[pgrouting-dev] Postgres AssertFailedException Exception

Hi Team,

We are receiving following AssertFailedException exception while executing pgrouting query listed below. Anyone have idea about this exception? Is this known bug? Possible fix? Is this something hangs the whole process?

Server details -

Postgresql 9.3.25 ( we are in process of upgrading to 11)

Ubuntu 16.04.6 LTS

Pgrouting 2.6.0

2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w…er.com/ViewEngine (forking…) [41329-3] postgres@odw ERROR: AssertFailedException: p1.tot_cost() == p2.tot_cost() at /build/pgrouting-Prt6v2/pgrouting-2.6.0/include/yen/pgr_ksp.hpp:63

*** Execution path***

[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(_Z13get_backtraceB5cxx11v+0x3c) [0x7ff5fd368b7c]

[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(ZNK7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS3_4vecSES5_NS3_11undirectedSENS0_12Basic_vertexENS0_10Basic_edgeENS3_11no_propertyENS3_5listSEEES7_S8_EEE9compPathsclERK4PathSH+0x2dd) [0x7ff5fd3d2bbd]

[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(ZNSt8_Rb_treeI4PathS0_St9_IdentityIS0_EN7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS7_4vecSES9_NS7_11undirectedSENS4_12Basic_vertexENS4_10Basic_edgeENS7_11no_propertyENS7_5listSEEESB_SC_EEE9compPathsESaIS0_EE16_M_insert_uniqueIRKS0_EESt4pairISt17_Rb_tree_iteratorIS0_EbEOT+0x4e) [0x7ff5fd3d2dae]

[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(ZN7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS3_4vecSES5_NS3_11undirectedSENS0_12Basic_vertexENS0_10Basic_edgeENS3_11no_propertyENS3_5listSEEES7_S8_EEE11doNextCycleERSC+0x641) [0x7ff5fd3e2251]

[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(_ZN7Pgr_kspIN9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS3_4vecSES5_NS3_11undirectedSENS0_12Basic_vertexENS0_10Basic_edgeENS3_11no_propertyENS3_5listSEEES7_S8_EEE3YenERSC_llib+0x2fb) [0x7ff5fd3e288b]

[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(do_pgr_ksp+0xbd4) [0x7ff5fd3e5f84]

[bt]/usr/lib/postgresql/9.3/lib/libpgrouting-2.6.so(kshortest_path+0x40e) [0x7ff5fd3ced4e]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(ExecMakeTableFunctionResult+0x19c) [0x55625ab1dcbc]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(+0x1dc116) [0x55625ab31116]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(ExecScan+0x2c9) [0x55625ab1feb9]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(ExecProcNode+0x1a8) [0x55625ab187e8]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(standard_ExecutorRun+0x10e) [0x55625ab15c6e]

[bt]/usr/lib/postgresql/9.3/lib/pg_stat_statements.so(+0x24a5) [0x7ffa2048a4a5]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(+0x2a8717) [0x55625abfd717]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(PortalRunFetch+0x180) [0x55625abff0a0]

[bt]postgres: postgres odw 10.76.0.185(44748) SELECT(+0x1e423d) [0x55625ab3923d]

2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w…er.com/ViewEngine (forking…) [41329-4] postgres@odw HINT:

2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w…er.com/ViewEngine (forking…) [41329-5] postgres@odw CONTEXT: PL/pgSQL function pgr_ksp(text,bigint,bigint,integer,boolean,boolean) line 4 at RETURN QUERY

PL/pgSQL function nn_candidate_routes_from_and_to_latlon(geometry,geometry) line 75 at RETURN QUERY

2019-12-16 19:31:55 EST Passenger AppPreloader: /var/w…er.com/ViewEngine (forking…) [41329-6] postgres@odw STATEMENT:

select st_multi(st_union(geom)) as geom,return_target_seq,path_id,st_length(st_union(st_transform(geom,2163))) as distance

from nn_candidate_routes_from_and_to_latlon(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326), ARRAY(

select geom from (

select geom, st_distance(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326),geom)

from (

select

(st_dumppoints((st_transform(st_segmentize(st_transform(wkt_geometry,2163),75),4326)))).geom

from (select * from staging_dw_cables where upper(owner) ~ ‘OWNED’ and start_ne_dw_enclosure_id is not null and end_ne_dw_enclosure_id is not null and pop_cable_tf = true

and wkt_geometry && st_transform(st_buffer(st_transform(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326),2163),50000),4326)

order by st_distance(st_setsrid(st_makepoint(-117.99466873924484,33.92814775576908),4326),wkt_geometry) limit 15) cables) sq order by 2 asc limit 15) sq

)) where geom is not null group by return_target_seq,path_id order by distance asc limit 25

Regards,

Prashant

Hi Prashant,

As you say your version of PostgreSQL is one that is not supported anymore and also your pgRouting version has seen a few bugfix releases already.
It could be a data problem like here: https://github.com/pgRouting/pgrouting/issues/1152
But it would be really best if you could first upgrade to newer versions and try again.

Best regards,
Daniel

···

Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: https://georepublic.info

Thanks for your reply. Due to this exception is it possible whole process that runs the query got stuck or hung as we are experiencing the same and logs shows this error message.

Regards,
Prashant

···

Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: https://georepublic.info