linkerd2 icon indicating copy to clipboard operation
linkerd2 copied to clipboard

Viz dashboard Routes tab fails with no HttpRoutes

Open kflynn opened this issue 1 year ago • 4 comments

What is the issue?

When running edge-22.8.2, if you open the linkerd viz dashboard and click on the Routes tab in the left sidebar, you'll get a blank white window. The JavaScript console shows this:

main.82c8da3a2c82d46049d2.js:2 TypeError: Cannot read properties of undefined (reading 'search')
    at main.82c8da3a2c82d46049d2.js:2:788239
    at n (main.82c8da3a2c82d46049d2.js:2:789521)
    at Ko (main.82c8da3a2c82d46049d2.js:2:245602)
    at xs (main.82c8da3a2c82d46049d2.js:2:291507)
    at pl (main.82c8da3a2c82d46049d2.js:2:284283)
    at dl (main.82c8da3a2c82d46049d2.js:2:284208)
    at rl (main.82c8da3a2c82d46049d2.js:2:281238)
    at main.82c8da3a2c82d46049d2.js:2:233011
    at t.unstable_runWithPriority (main.82c8da3a2c82d46049d2.js:2:321171)
    at Va (main.82c8da3a2c82d46049d2.js:2:232720)
ns @ main.82c8da3a2c82d46049d2.js:2
main.82c8da3a2c82d46049d2.js:2 Uncaught TypeError: Cannot read properties of undefined (reading 'search')
    at main.82c8da3a2c82d46049d2.js:2:788239
    at n (main.82c8da3a2c82d46049d2.js:2:789521)
    at Ko (main.82c8da3a2c82d46049d2.js:2:245602)
    at xs (main.82c8da3a2c82d46049d2.js:2:291507)
    at pl (main.82c8da3a2c82d46049d2.js:2:284283)
    at dl (main.82c8da3a2c82d46049d2.js:2:284208)
    at rl (main.82c8da3a2c82d46049d2.js:2:281238)
    at main.82c8da3a2c82d46049d2.js:2:233011
    at t.unstable_runWithPriority (main.82c8da3a2c82d46049d2.js:2:321171)
    at Va (main.82c8da3a2c82d46049d2.js:2:232720)

which might be relevant. Reloading the page doesn't accomplish anything.

Once in this state, hitting the browser's back button changes the URL in the nav bar, but doesn't actually do anything. Refreshing the page once the nav bar isn't showing https://...host.../routes restores functionality.

(If it matters, I'm not actually using the linkerd viz dashboard command -- instead, I'm going through an ingress so that I can do host-based routing.)

This happens in, at least, Brave and Safari. I'm on MacOS Monterey.

How can it be reproduced?

See above.

Logs, error output, etc

JavaScript console output above. Here's the log from the viz web deployment's proxy:

Defaulted container "linkerd-proxy" out of: linkerd-proxy, web, linkerd-init (init)
[     0.003070s]  INFO ThreadId(01) linkerd2_proxy::rt: Using single-threaded proxy runtime
[     0.004229s]  INFO ThreadId(01) linkerd2_proxy: Admin interface on 0.0.0.0:4191
[     0.004282s]  INFO ThreadId(01) linkerd2_proxy: Inbound interface on 0.0.0.0:4143
[     0.004284s]  INFO ThreadId(01) linkerd2_proxy: Outbound interface on 127.0.0.1:4140
[     0.004285s]  INFO ThreadId(01) linkerd2_proxy: Tap interface on 0.0.0.0:4190
[     0.004286s]  INFO ThreadId(01) linkerd2_proxy: Local identity is web.linkerd-viz.serviceaccount.identity.linkerd.cluster.local
[     0.004288s]  INFO ThreadId(01) linkerd2_proxy: Identity verified via linkerd-identity-headless.linkerd.svc.cluster.local:8080 (linkerd-identity.linkerd.serviceaccount.identity.linkerd.cluster.local)
[     0.004289s]  INFO ThreadId(01) linkerd2_proxy: Destinations resolved via linkerd-dst-headless.linkerd.svc.cluster.local:8086 (linkerd-destination.linkerd.serviceaccount.identity.linkerd.cluster.local)
[     0.023520s]  INFO ThreadId(02) daemon:identity: linkerd_app: Certified identity id=web.linkerd-viz.serviceaccount.identity.linkerd.cluster.local

and the web container itself:

time="2022-08-12T18:30:01Z" level=info msg="running version edge-22.8.2"
time="2022-08-12T18:30:01Z" level=info msg="starting admin server on :9994"
time="2022-08-12T18:30:01Z" level=info msg="starting HTTP server on :8084"
time="2022-08-12T18:31:49Z" level=error msg="Unexpected websocket error: websocket: close sent"
time="2022-08-12T18:34:15Z" level=error msg="Unexpected websocket error: websocket: close sent"
time="2022-08-12T18:34:35Z" level=error msg="Unexpected websocket error: websocket: close sent"
time="2022-08-12T18:34:56Z" level=error msg="Get \"https://10.43.0.1:443/api/v1/namespaces?labelSelector=linkerd.io%2Fextension\": context canceled"
time="2022-08-12T18:35:15Z" level=error msg="cannot find Kubernetes canonical name from friendly name [trafficsplit]"
time="2022-08-12T18:35:17Z" level=error msg="cannot find Kubernetes canonical name from friendly name [trafficsplit]"
time="2022-08-12T18:35:19Z" level=error msg="cannot find Kubernetes canonical name from friendly name [trafficsplit]"
time="2022-08-12T18:35:56Z" level=error msg="rpc error: code = Canceled desc = context canceled"
time="2022-08-12T18:39:20Z" level=error msg="rpc error: code = Canceled desc = context canceled"

output of linkerd check -o short

Status check results are √

Environment

I'm running Kubernetes in k3d on an M1 Pro MacBook Pro running MacOS Monterey (12.5).

Client Version: v1.24.1 Kustomize Version: v4.5.4 Server Version: v1.23.8+k3s1 Linkerd version: edge-22.8.2

Possible solution

No response

Additional context

No response

Would you like to work on fixing this bug?

No response

kflynn avatar Aug 12 '22 21:08 kflynn

Does this issue also occur if you use linkerd viz dashboard instead of going through an ingress? We've had difficulty in the past configuring ingresses to properly handle the websockets traffic which the dashboard uses. The Unexpected websocket error log messages suggest that this might be related.

adleong avatar Aug 12 '22 22:08 adleong

Yup, same result. Other websocket stuff works fine through the ingress, too (the trick seems to be to not let the ingress rewrite only one of Host and Origin – they both have to match).

kflynn avatar Aug 12 '22 22:08 kflynn

cannot find Kubernetes canonical name from friendly name [trafficsplit]

Ah, this may be a consequence of moving the TrafficSplit CRD out of Linkerd core and into linkerd-smi. We should probably need to cut the dashboard's dependency on TrafficSplit or at least make it fail more gracefully when the CRD isn't installed.

Nice find.

adleong avatar Aug 12 '22 22:08 adleong

Same problem here with linkerd 2.12.0 stable, but based on the previous comment it seems as if installing TrafficSplit via the instructions at https://linkerd.io/2.12/tasks/linkerd-smi/ should work around the problem. For me, it does not.

I no longer see the error "cannot find Kubernetes canonical name from friendly name [trafficsplit]", or any other errors, in my linkerd-viz web pod logs, but I have the same problem on the client/browser side.

rocketraman avatar Aug 31 '22 17:08 rocketraman

Judging by the error log, this should be fixed by #9451

MoSattler avatar Sep 26 '22 14:09 MoSattler

This is a duplicate of https://github.com/linkerd/linkerd2/issues/9306

jeremychase avatar Oct 03 '22 20:10 jeremychase