lorenwest / monitor-dashboard

Dashboards for the Node.js monitor project
https://lorenwest.github.com/monitor-dashboard
MIT License
204 stars 28 forks source link

(Connection Problem) indicated on screen #3

Closed osher closed 10 years ago

osher commented 10 years ago

after successful installation

osher@ubuntu$ npm install monitor
...
   <very long list skipped here>
...

> ws@0.4.31 install /usr/osher/nm/node_modules/monitor/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/usr/osher/nm/node_modules/monitor/node_modules/socket.io-client/node_modules/ws/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
  COPY Release/validation.node
make: Leaving directory `/usr/osher/nm/node_modules/monitor/node_modules/socket.io-client/node_modules/ws/build'
monitor@0.6.1 node_modules/monitor
├── backbone@0.9.9
├── backbone-callbacks@0.1.5 (underscore@1.4.4)
├── underscore@1.4.3
├── config@0.4.33
├── socket.io@0.9.16 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3)
├── cron@0.1.3 (nodeunit@0.5.2)
└── socket.io-client@0.9.16 (xmlhttprequest@1.4.2, uglify-js@1.2.5, active-x-obfuscator@0.0.1, ws@0.4.31)

osher@ubuntu$ npm install monitor-dashboard
...
   <very long list skipped here>
...

> ws@0.4.31 install /usr/osher/nm/node_modules/monitor-dashboard/node_modules/monitor/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/usr/osher/nm/node_modules/monitor-dashboard/node_modules/monitor/node_modules/socket.io-client/node_modules/ws/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
  COPY Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
  COPY Release/validation.node
make: Leaving directory `/usr/osher/nm/node_modules/monitor-dashboard/node_modules/monitor/node_modules/socket.io-client/node_modules/ws/build'
monitor-dashboard@0.6.1 node_modules/monitor-dashboard
├── config@0.4.33
├── core-monitor@0.6.1
├── connect@1.7.2 (qs@0.6.5, mime@1.2.11)
├── backbone-callbacks@0.1.5 (underscore@1.4.4, backbone@0.9.2)
└── monitor@0.6.1 (underscore@1.4.3, socket.io@0.9.16, cron@0.1.3, backbone@0.9.2, socket.io-client@0.9.16)

running an index that looks like this:

osher@ubuntu$ cat index.js
var monitor = require('monitor').start();

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '127.0.0.1');

console.log('Server running at http://127.0.0.1:1337/\n\n');

osher@ubuntu$ node index.js &
[1] 1975
Server running at http://127.0.0.1:1337/

osher@ubuntu$ 

and running the dashboard - seemingly successfully

osher@ubuntu$ npm start monitor-dashboard
 npm start monitor-dashboard

> monitor-dashboard@0.6.1 start /usr/osher/nm/node_modules/monitor-dashboard
> node monitor

             _________                                  __________
___________________  /____      _______ ___________________(_)_  /______________
__  __ \  __ \  __  /_  _ \     __  __ `__ \  __ \_  __ \_  /_  __/  __ \_  ___/
_  / / / /_/ / /_/ / /  __/     _  / / / / / /_/ /  / / /  / / /_ / /_/ /  /
/_/ /_/\____/\__,_/  \___/      /_/ /_/ /_/\____//_/ /_//_/  \__/ \____//_/

Now showing at http://localhost:4200/

External connections disabled.
See /usr/osher/nm/node_modules/monitor-dashboard/config/external.js for more information.

I get the following on both the browser and the log:

TypeError: Cannot set property 'components' of undefined
    at setAttr (/usr/osher/nm/node_modules/monitor-dashboard/lib/js/UI.js:297:44)
    at Function.UI.containedModel (/usr/osher/nm/node_modules/monitor-dashboard/lib/js/UI.js:324:5)
    at UI.Page.Backbone.Model.extend.initialize (/usr/osher/nm/node_modules/monitor-dashboard/lib/js/Page.js:47:10)
    at Backbone.Model (/usr/osher/nm/node_modules/monitor-dashboard/node_modules/monitor/node_modules/backbone/backbone.js:209:21)
    at new child (/usr/osher/nm/node_modules/monitor-dashboard/node_modules/monitor/node_modules/backbone/backbone.js:1392:34)
    at UI.Server.Backbone.Model.extend._getPage (/usr/osher/nm/node_modules/monitor-dashboard/lib/js/Server.js:271:14)
    at UI.Server.Backbone.Model.extend._monitorPageRoute (/usr/osher/nm/node_modules/monitor-dashboard/lib/js/Server.js:224:9)
    at UI.Server.Backbone.Model.extend.siteRoute (/usr/osher/nm/node_modules/monitor-dashboard/lib/js/Server.js:200:9)
    at next (/usr/osher/nm/node_modules/monitor-dashboard/node_modules/connect/lib/http.js:201:15)
    at HTTPServer.Server.handle (/usr/osher/nm/node_modules/monitor-dashboard/node_modules/connect/lib/http.js:214:3)

After removing node_modules and doing all the process again - I got a crippled dashboard:

I tried to create a page '/home'

got this on the log

2013-11-10T16:15:11.38 [warn] FileSyncProbe.monitorError [{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}]
2013-11-10T16:15:11.38 [error] Router.connectInternal [{"error":{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"},"probeKey":"Sync:className=Page:modelId=/home"}]
2013-11-10T16:15:11.38 [error] Sync.connectInstanceMonitor.monitorConnect [{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}]
2013-11-10T16:15:11.38 [error] Monitor.disconnect [{"error":"Monitor must be connected"}]
2013-11-10T16:15:11.38 [error] Sync._sync.onComplete ["Page",{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}]
2013-11-10T16:15:11.38 [error] Monitor.connect [{"initParams":{"className":"Page","modelId":"/home"},"error":{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}}]
2013-11-10T16:15:35.02 [warn] FileSyncProbe.monitorError [{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}]
2013-11-10T16:15:35.02 [error] Router.connectInternal [{"error":{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"},"probeKey":"Sync:className=Page:modelId=/home"}]
2013-11-10T16:15:35.02 [error] Sync.connectInstanceMonitor.monitorConnect [{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}]
2013-11-10T16:15:35.02 [error] Monitor.disconnect [{"error":"Monitor must be connected"}]
2013-11-10T16:15:35.02 [error] Sync._sync.onComplete ["Page",{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}]
2013-11-10T16:15:35.02 [error] Monitor.connect [{"initParams":{"className":"Page","modelId":"/home"},"error":{"code":"NOTFOUND","msg":"LiveSync requires the file to exist and be readable"}}]

Perhaps I'm missing something?

lorenwest commented 10 years ago

This one is strange. I couldn't reproduce it on my main OSX machine, and I just tried on an ubuntu machine and couldn't reproduce it on that machine either.

The following 2 stack trace lines seem out of place:

at Backbone.Model (/usr/osher/nm/node_modules/monitor-dashboard/node_modules/monitor/node_modules/backbone/backbone.js:209:21)
at new child (/usr/osher/nm/node_modules/monitor-dashboard/node_modules/monitor/node_modules/backbone/backbone.js:1392:34)

Those line numbers (209 and 1392) aren't valid lines in version 0.6.6 of backbone.js that the package.json relies on.

Would you mind editing that backbone.js file, and telling me what version is reported at the top?

The connection problems you're seeing indicate a newer version of backbone.js, and I haven't gotten around to upgrading monitor-dashboard to be compatible with the newer backbone - which is why the package.json specifically calls out 0.6.6.

osher commented 10 years ago

hmm

wierd.

probably I did not install both components (monitor, monitor-dashboard) on the same order. (remember? first time - got the crash, 2nd time - got the wierd behavior) In the time that crashed I probably installed the dashboard first, and then the monitor -what resulted with node_modules/monotir-dashoard/node_modules/monitor - AND - node_modules/monitor

now, that it runs (no strack trace with error, just wierd behavior with the "(connection problems)" stuff) - I tried to cat the file - and it does not exist. inside /usr/osher/nm/node_modules/monitor-dashboard/node_modules/ I can find only config and core-monitor.

However - if it helps - /usr/osher/nm/node_modules/monitor/node_modules/backbone/backbone.js starts with // Backbone.js 0.9.9...

lorenwest commented 10 years ago

Yes, backbone.js is supposed to be 0.9.9 (not 0.6.6 like my earlier comment - note to self: no morning comments before coffee).

I noticed the path, and figured the reason for backbone.js being there was due to the install order, but the install order shouldn't have caused the problem.

So - you're not getting stack traces any longer, but you're still having connection problems, and problems persisting new components?

osher commented 10 years ago

right - like the screenshot http://gyazo.com/74c2f8deed416da34d9fe5b4381b5777 and the log above.

In addition, any dashboard I try to add isn't saved :(

All the installs are local with full OS permissions. could it be that it tries to write somewhere else?

lorenwest commented 10 years ago

Just published version 0.6.3. It's worth a try creating a new directory, npm installing monitor-dashboard and running monitor-dashboard to see if this resolves the issue. No need to add a second application for this test.

If that doesn't solve the problem, try running monitor-dashboard as super user. If it works, then there's a permission issue with accessing tcp/ip ports in the 42000-42010 range.

Let me know how it goes.