Hi, I have a weird bug to report, but I'm not sure...
# questions
a
Hi, I have a weird bug to report, but I'm not sure how to investigate it/debug. After adding some benign changes to pipeline registry, kedro-viz (9.2.0) started to randomly crash with javascript type error at some pipelines (resulting in whole screen going white-blank and needs to refresh). Those are the changes between commits (before commit all works fine, after commit it consistently crashes on some (seemingly somewhat random - the lower the pipe in the list the higher chance to crash) subset of pipelines with uncaught exception). That's the whole diff of the commit:
Copy code
@@ -79,7 +79,16 @@ def register_pipelines() -> dict[str, Pipeline]:
             group_class, input_schema, pipelines[f"training_{group_class}"], pipelines[f"inference_{group_class}"]
         )
 
-    pipelines = {k: pipelines[k] for k in sorted(pipelines.keys())}  # sorting for kedro-viz selection box
-    pipelines["__default__"] = sum(pipelines[f"training_and_inference_{gc}"] for gc in GROUP_CLASSES)  # type: ignore

+    # pipelines = {k: pipelines[k] for k in sorted(pipelines.keys())}  # sorting for kedro-viz selection box
+    order = ["input", "data", "feature", "fgu", "layer", "pricing", "inference", "training"]
+    pipelines = {
+        k: pipelines[k]
+        for k in sorted(
+            pipelines.keys(),
+            key=lambda x: str(order.index(x.split("_")[0]) if x.split("_")[0] in order else len(order)) + x,
+        )
+    } # reordering pipelines in kedro-viz based on order list
+    pipelines["__default__"] = pipelines["input_na"]
e
Hi Artur, Have you tried to check how your pipelines list looks before and after reordering? In other words, does it contain what you expect?
@Rashida Kanchwala, @Sajid Alam any ideas on what can cause such a behaviour?
a
Yes it's what I expect
Before it was lexical order and now it's order as in the list order, and everything else is at the end
I was also confused about ordering dict, as afaik it does not guarantee keeping order
e
I see, I’m curious whether issue remains if you remove your changes but randomly shuffle the pipelines dict after creation.
This can narrow down the error
r
Can you share traceback of the javascript error ? Thanks
a
I was looking at it but it is minified and not really useful, but I can do that
r
no worries, if u can share what u have on the github bug report. we will try to replicate the error at our end. and reach out if more help is needed. thanks
a
Copy code
Uncaught TypeError: e is undefined
    Ri <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    aA/r[n]< <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    aA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    uA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    p <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    h <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    h <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    h <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    gA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    To <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ss <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Tl <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    xu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    yu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    gu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    ou <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    uu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Vi <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    nu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    No <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ro <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    p <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    o <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    cu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notifyNestedSubs <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    p <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    o <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    cu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notifyNestedSubs <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    o <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    d <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    dispatch <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ze <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Wa <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    exports <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    d <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    dispatch <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Or <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    onUpdateActivePipeline <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    onChanged <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    MA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    il <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    ku <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    wu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    wu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    uu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Vi <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    nu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    rs <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    onOptionSelected <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    u <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Re <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ue <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Nn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Nn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    jn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Hn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    cu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Le <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Hn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Yt <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Gt <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
main.f9e37320.js:2:4292236
    Ri <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    aA/r[n]< <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    map self-hosted:178
    aA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    uA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    p <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    h <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    h <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    h <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    c <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    gA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    To <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ss <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Tl <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    xu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    yu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    gu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    ou <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    uu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Vi <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    (Async: VoidFunction)
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    nu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    No <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ro <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    p <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    o <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    cu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notifyNestedSubs <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    p <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    o <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    cu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notify <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    notifyNestedSubs <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    o <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    d <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    dispatch <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ze <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Wa <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    exports <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    d <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    dispatch <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Or <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    AsyncFunctionNext self-hosted:807
    (Async: async)
    J <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    onUpdateActivePipeline <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    onChanged <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    MA <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    il <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    ku <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    wu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    wu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    uu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Vi <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    (Async: VoidFunction)
    iu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    nu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    rs <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    onOptionSelected <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    u <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Re <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Ue <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Nn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Nn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    jn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Hn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    cu <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Le <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Hn <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Yt <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
    Gt <http://127.0.0.1:4141/static/js/main.f9e37320.js:2>
is this what you asked for?
r
u r right, this is not helpful. we will have to replicate this error at our end to understand better -- let me know once u have opened the bug report on github and we can start to investigate
a
do u have idea how I can provide you a more useful error log?
I'll try to DL kedro viz react from npm maybe its not minified
r
i think we have an idea , it might be related to a bug related to hard coding the '_default_' pipeline so for now, just the above should be fine. and u don't face this issue in kedro-viz 9.1 right ?
a
didn't test it on 9.1
r
also cc - @Ravi Kumar Pilla
a
can test on 9.1
thankyou 1
yup it works on 9.1.0
so I'm not going to report a bug then, since you know better what's wrong
r
it will still require some investigation. if u could we can triage it better. thanks 🙂
k
Hey hey! Coming back to this issue, which is really hard to debug -> Kedro-viz just stops working randomly on some pipelines and just renders a white screen. Doesn't happen at all on 9.1.0 but breaks on 9.2.0 and 10.0.0 unfortunately. Nothing is happening in the terminal, the web console spits out.
Copy code
main.a2a59735.js:2 
 TypeError: Cannot read properties of undefined (reading 'match')
    at Hi (main.a2a59735.js:2:4364976)
    at main.a2a59735.js:2:4848942
    at Array.map (<anonymous>)
    at LI (main.a2a59735.js:2:4848910)
    at main.a2a59735.js:2:4849263
    at main.a2a59735.js:2:4351469
    at c (main.a2a59735.js:2:4350427)
    at main.a2a59735.js:2:4351602
    at c (main.a2a59735.js:2:4350427)
    at main.a2a59735.js:2:4351568
ds	@	main.a2a59735.js:2
r.callback	@	main.a2a59735.js:2
za	@	main.a2a59735.js:2
xl	@	main.a2a59735.js:2
bl	@	main.a2a59735.js:2
ml	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
Eu	@	main.a2a59735.js:2
uu	@	main.a2a59735.js:2
Vi	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
and
Copy code
main.a2a59735.js:2 
 Uncaught TypeError: Cannot read properties of undefined (reading 'match')
    at Hi (main.a2a59735.js:2:4364976)
    at main.a2a59735.js:2:4848942
    at Array.map (<anonymous>)
    at LI (main.a2a59735.js:2:4848910)
    at main.a2a59735.js:2:4849263
    at main.a2a59735.js:2:4351469
    at c (main.a2a59735.js:2:4350427)
    at main.a2a59735.js:2:4351602
    at c (main.a2a59735.js:2:4350427)
    at main.a2a59735.js:2:4351568
Hi	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
LI	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
c	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
c	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
c	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
c	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
wo	@	main.a2a59735.js:2
ks	@	main.a2a59735.js:2
wl	@	main.a2a59735.js:2
bu	@	main.a2a59735.js:2
yu	@	main.a2a59735.js:2
Au	@	main.a2a59735.js:2
ou	@	main.a2a59735.js:2
uu	@	main.a2a59735.js:2
Vi	@	main.a2a59735.js:2
(anonymous)	@	main.a2a59735.js:2
We commented out pipeline sorting and
__default__
pipeline overwriting to pinpoint the problem. Any ideas?
👀 1
j
thanks @Kacper Leśniara and sorry you're having a bumpy ride. it's clear that the traceback isn't useful and also that this is a regression from 9.1.0 we should investigate. can you please open an issue in https://github.com/kedro-org/kedro-viz/issues with the behavior in 9.1.0 vs 9.2.0 ? as well as the output of
kedro registry list
before and after your registry change
a
We think that 10.0 introduced a different error than the previous one
👀 1
k
Is there a way to provide you with a more descriptive error message? Cloned the kedro-viz repo hoping that I can run it in some kind of a dev mode
a
and the crashing behavior is inconsistent
j
Is there a way to provide you with a more descriptive error message? Cloned the kedro-viz repo hoping that I can run it in some kind of a dev mode
@Jitendra Gundaniya?
j
Hey Kacper, We can quickly jump to call to debug this ?
👍 1
s
We replaced
toposort
with
graphlib
between 9.1.0 and 9.2.0 perhaps that might be causing the issue. https://github.com/kedro-org/kedro-viz/pull/1942
💡 1
k
More detailed error log coming from kedro-viz in dev mode:
Copy code
search-utils.js:28  Uncaught TypeError: Cannot read properties of undefined (reading 'match')
    at getHighlightedText (search-utils.js:28:1)
    at node-list-items.js:34:1
    at Array.map (<anonymous>)
    at highlightMatch (node-list-items.js:32:1)
    at node-list-items.js:96:1
    at recomputationWrapper (index.js:67:1)
    at memoized (defaultMemoize.js:123:1)
    at dependenciesChecker (index.js:81:1)
    at memoized (defaultMemoize.js:123:1)
    at dependenciesChecker (index.js:77:1)
Copy code
console.js:288  The above error occurred in the <NodeListProvider> component:

    at NodeListProvider (<http://localhost:4141/static/js/bundle.js:19467:5>)
    at ConnectFunction (<http://localhost:4141/static/js/bundle.js:275443:103>)
    at div
    at div
    at Sidebar (<http://localhost:4141/static/js/bundle.js:25109:5>)
    at ConnectFunction (<http://localhost:4141/static/js/bundle.js:275443:103>)
    at div
    at FlowChartWrapper (<http://localhost:4141/static/js/bundle.js:10030:5>)
    at ConnectFunction (<http://localhost:4141/static/js/bundle.js:275443:103>)
    at Route (<http://localhost:4141/static/js/bundle.js:278265:29>)
    at Switch (<http://localhost:4141/static/js/bundle.js:278434:29>)
    at ApolloProvider (<http://localhost:4141/static/js/bundle.js:318559:19>)
    at GraphQLProvider (<http://localhost:4141/static/js/bundle.js:22600:5>)
    at Router (<http://localhost:4141/static/js/bundle.js:277937:30>)
    at BrowserRouter (<http://localhost:4141/static/js/bundle.js:277451:35>)
    at div
    at Wrapper (<http://localhost:4141/static/js/bundle.js:30203:5>)
    at ConnectFunction (<http://localhost:4141/static/js/bundle.js:275443:103>)
    at Provider (<http://localhost:4141/static/js/bundle.js:275169:5>)
    at App (<http://localhost:4141/static/js/bundle.js:1590:5>)
    at Container

Consider adding an error boundary to your tree to customize error handling behavior.
Visit <https://reactjs.org/link/error-boundaries> to learn more about error boundaries.
Somehow a tag has no name which results in node.text becoming undefined and breaking in match function
👍 1
j
Hey @Kacper Leśniara, Are you still facing same error after running
kedro run
on the problematic pipelines? if no, Is it the same case for both
9.2.0
and
10.0.0
Kedro-Viz version ? Let me know if you are still facing the issue, we can connect tomorrow.
k
I believe it was the same error in 9.2.0 and 10.0.0. As a workaround we just got rid of the tag and it seems to be working, but no idea what's causing it to become undefined