Dashing.io Does Not Load Data on Centos


I needed to setup a quick dashboard a couple months back so I turned to Dashing.io. Everything worked great, then one day none of the dashboard widgets displayed any data. Given the nature of the dashboard and its users this was incredibly annoying.

The symptoms of this problem (which I can only replicate on Centos) are:

  • Dashboard widgets appear in the right order/layout when you load the page
  • Widgets do not contain any data until you Ctrl-C or kill the dashing process


References


Symptoms

When you first load your dashboard, you see that your widgets don't display any data:

When you stop your dashing process, you see console output that looks like this:

[root@ip-172-16-27-190 test]# dashing start
Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on 0.0.0.0:3030, CTRL+C to stop
For the twitter widget to work, you need to put in your twitter API keys in the jobs/twitter.rb file.
172.16.27.1 - - [09/Dec/2016 21:06:29] "GET /sample HTTP/1.1" 200 2332 0.0028
172.16.27.1 - - [09/Dec/2016 21:06:29] "GET /views/text.html HTTP/1.1" 200 175 0.0009
172.16.27.1 - - [09/Dec/2016 21:06:29] "GET /views/meter.html HTTP/1.1" 200 442 0.0005
172.16.27.1 - - [09/Dec/2016 21:06:29] "GET /views/list.html HTTP/1.1" 200 493 0.0004
172.16.27.1 - - [09/Dec/2016 21:06:29] "GET /views/number.html HTTP/1.1" 200 343 0.0006
172.16.27.1 - - [09/Dec/2016 21:06:29] "GET /views/graph.html HTTP/1.1" 200 183 0.0010
^C/usr/local/share/gems/gems/dashing-1.3.7/lib/dashing/cli.rb:89:in `system': Interrupt
    from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing/cli.rb:89:in `run_command'
    from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing/cli.rb:64:in `start'
    from /usr/local/share/gems/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    from /usr/local/share/gems/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/share/gems/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    from /usr/local/share/gems/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
    from /usr/local/share/gems/gems/dashing-1.3.7/bin/dashing:9:in `<top (required)>'
    from /usr/local/bin/dashing:23:in `load'
    from /usr/local/bin/dashing:23:in `<main>'

[root@ip-172-16-27-190 test]# Stopping ...
172.16.27.1 - - [09/Dec/2016 21:10:32] "GET /events HTTP/1.1" 200 - 242.5523

(Nothing particularly helpful in there)

After the dashing server is stopped, all of the sudden you see an influx of data:


Solution

I had to dig a bit to figure out what was going on. In the end I discovered that the Thin webserver that Dashing uses out of the box failed. The alternative is to use puma to run Dashing (or Smashing if you want something that is more supported). Here's how I got puma working with my Dashboard on Centos 7:

  • cd /path/to/dashboard-directory
  • Update the project Gemfile with puma
  • bundle install
  • bundle exec puma -e production -p 9292 --pidfile tmp/pids/puma.pid -d

If I had time I would dig into this further- as it stands now, puma works (even if it is a little more sluggish than Thin [when thin was working])