Repository: dask/distributed

Issue:
Scheduler Dashboard Workers Link not working - distrbuted 2.5.2
Trying to upgrade distributed 1.25.3 to latest 2.5.2. On doing so the workers link is not working for dashboard - http://localhost:8787/workers. Have the following versions - 

dask - 2.5.2
distributed  - 2.5.2
bokeh - 1.3.4
tornado - 6.0.3

Also if cl = Client() is started, the Bytes Stored on Status page keeps incrementing. We are running this on windows machines.


Discussion:
Hi @ameetshah1983 .  Unfortunately this works well for me, and on our test systems, so there must be something else going on.  

Do you have any other ideas for what might be going wrong?  maybe there are some errors in logs, either in Python or in your browser?
Doesn't work for me either.
I'm also on dask 2.5.2, distributed 2.5.2 and bokeh 1.3.4
I'm on linux and using python 3.7
It was working yesterday before I upgraded.
Great.  If either of you could help by providing logs or error messages that would be very welcome.  There isn't much that can be done without more information about what is going on.
Looks like its working for 2.5.1 distributed version. Its only an issue with 2.5.2 distributed. There are no errors but the workers link appears blank i.e. it simply gives a blank page. On scheduler running in console mode, we see no errors. 

Are there logs for dashboard elsewhere which can be checked.
Can you try the web developer console in your browser?  In Google Chrome this is Ctrl/Option-F12
No errors recorded in chrome developer console. All statuses show 200 except for ws?bokeh-protocol-version which is 101 same as 2.5.1 version. 

However main difference between the two is that for 2.5.1 it has additional 2 data links / enteries for the data:image/gif which are not present for 2.5.2.
You could also try using `git bisect` to find the bad commit.  That would
be helpful to narrow down what introduced the bug for you.

On Tue, Oct 8, 2019 at 10:37 AM ameetshah1983 <notifications@github.com>
wrote:

> No errors recorded in chrome developer console. All statuses show 200
> except for ws?bokeh-protocol-version which is 101 same as 2.5.1 version.
>
> However main difference between the two is that for 2.5.1 it has
> additional 2 data links / enteries for the data:image/gif which are not
> present for 2.5.2.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/dask/distributed/issues/3120?email_source=notifications&email_token=AACKZTBUNSC62Z6RNZUKFU3QNSSKRA5CNFSM4I6KL2R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAUTTNI#issuecomment-539572661>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AACKZTCSZXYBXFDSCUZMPWTQNSSKRANCNFSM4I6KL2RQ>
> .
>

Diffing the code between 2.5.1 and 2.5.2, the code that directly impacts the page looks like the bandwidth calculation for the workers that seems to be updated. Will try and narrow it down more and get back.
Thanks for your efforts here @ameetshah1983 
Looks like if commit 52d3e057721802ee725d71448b6f7ef17a8e515a is reverted from master or v2.5.2, it then works fine.
Commit Title - Collect worker-worker and type bandwidth information (#3094) 
https://github.com/dask/distributed/commit/52d3e057721802ee725d71448b6f7ef17a8e515a

Hope this helps.
Can you run the following command and verify that it does not produce an error:

```python
client.get_versions(check=True)
```
The command spit out a json and had no errors when running. Also both scheduler and workers are on the same machine and the cluster was created using command - 

`cl = Client()`
I am having the same issue using 

dask 2.5.2, 
distributed 2.5.2 
bokeh 1.3.4
python 3.7
on windows 10

I see there is an error being reported in the browser, which I've enclosed here. 

![image](https://user-images.githubusercontent.com/3588158/66660742-9d9a5780-ebfa-11e9-8d65-8254c38ceef4.png)


I can reproduce.  I'm looking into it.

Resolving patch:
diff --git a/distributed/dashboard/scheduler.py b/distributed/dashboard/scheduler.py
--- a/distributed/dashboard/scheduler.py
+++ b/distributed/dashboard/scheduler.py
@@ -1380,7 +1380,12 @@ def __init__(self, scheduler, width=800, **kwargs):
         ]
         workers = self.scheduler.workers.values()
         self.extra_names = sorted(
-            {m for ws in workers for m in ws.metrics if m not in self.names}
+            {
+                m
+                for ws in workers
+                for m, v in ws.metrics.items()
+                if m not in self.names and isinstance(v, (str, int, float))
+            }
             - self.excluded_names
         )
 


Test patch:
diff --git a/distributed/dashboard/tests/test_scheduler_bokeh.py b/distributed/dashboard/tests/test_scheduler_bokeh.py
--- a/distributed/dashboard/tests/test_scheduler_bokeh.py
+++ b/distributed/dashboard/tests/test_scheduler_bokeh.py
@@ -305,6 +305,11 @@ def test_WorkerTable(c, s, a, b):
     wt = WorkerTable(s)
     wt.update()
     assert all(wt.source.data.values())
+    assert all(
+        not v or isinstance(v, (str, int, float))
+        for L in wt.source.data.values()
+        for v in L
+    ), {type(v).__name__ for L in wt.source.data.values() for v in L}
     assert all(len(v) == 2 for v in wt.source.data.values())
 
     nthreads = wt.source.data["nthreads"]