Glimpse / Home

Project Glimpse: Node Edition - Spend less time debugging and more time developing.
http://node.getglimpse.com
Other
252 stars 9 forks source link

Glimpse crashes acquiring mac address #128

Open fubz opened 7 years ago

fubz commented 7 years ago

Node Version: v6.11.0 OS: CentOS Linux release 7.2.1511 (Core) - Kernel 3.10.0-327.36.2.el7.x86_64

Stack Trace:

Server listening on:  3090
=========================================================
Running Project Glimpse v0.22.11
--------------------------------
 - Open Glimpse at:  http://localhost:3090/glimpse/client
 - More info at:     http://node.getglimpse.com
=========================================================
TypeError: Data must be a string or a buffer
    at TypeError (native)
    at Hash.update (crypto.js:74:16)
    at /home/node/project/source/node_modules/@glimpse/glimpse-common/release/src/telemetry/TelemetryAppInstanceData.js:56:18
    at /home/node/project/source/node_modules/@glimpse/glimpse-common/release/src/telemetry/TelemetryAppInstanceData.js:72:13
    at /home/node/project/source/node_modules/getmac/es5/lib/getmac.js:45:16
    at ChildProcess.exithandler (child_process.js:211:5)
    at ChildProcess.wrappedCallback (/home/node/project/source/node_modules/@glimpse/glimpse-agent-node/release/async-track/async-track.js:346:33)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:891:16)

I tried disabling telemetry, but the function still runs. I ended up modifying the source for now to send an empty string in place of data.

fubz commented 7 years ago

I also go around the issue by adding a value for the telemetry.identity.salt entry in glimpse.conf.json

avanderhoorn commented 7 years ago

Thanks for the report. We are currently looking into it and seeing what we can do to fix. You mentioned that you ended up modifying the source. Any chance you can log out what error the callback in the getMacAddress function is getting back?

fubz commented 7 years ago
getmac.getMac(function (err, macAddress) {
  console.log('Github Debug Request: ' + JSON.stringify( err) )
  cb(macAddress);
});

Github Debug Request: {"killed":false,"code":127,"signal":null,"cmd":"ifconfig -a || ip link"}

Github Debug Request:  { Error: Command failed: ifconfig -a || ip link
/bin/sh: ifconfig: command not found
/bin/sh: ip: command not found
    at ChildProcess.exithandler (child_process.js:204:12)
    at ChildProcess.wrappedCallback (/home/node/project/source/node_modules/@glimpse/glimpse-agent-node/release/async-track/async-track.js:346:33)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:891:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at Socket.wrappedCallback (/home/node/project/source/node_modules/@glimpse/glimpse-agent-node/release/async-track/async-track.js:346:33)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:497:12)
  killed: false,
  code: 127,
  signal: null,
  cmd: 'ifconfig -a || ip link' }

My user has access to both of those commands on the system.

[node@vm1 ~]$ ip
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |
                   tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |
                   netns | l2tp | tcp_metrics | token }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -h[uman-readable] | -iec |
                    -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |
                    -4 | -6 | -I | -D | -B | -0 |
                    -l[oops] { maximum-addr-flush-attempts } |
                    -o[neline] | -t[imestamp] | -b[atch] [filename] |
                    -rc[vbuf] [size] | -n[etns] name | -a[ll] }

[node@vm1 ~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.49.161.27  netmask 255.255.252.0  broadcast 10.49.163.255
        inet6 fe80::5054:ff:fe5c:21e3  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:5c:21:e3  txqueuelen 1000  (Ethernet)
        RX packets 37143188  bytes 5079402382 (4.7 GiB)
        RX errors 0  dropped 2660641  overruns 0  frame 0
        TX packets 1192505  bytes 442964341 (422.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 137181  bytes 171133166 (163.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 137181  bytes 171133166 (163.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
avanderhoorn commented 7 years ago

This is great. Thanks for that. Investigating now.

mike-kaufman commented 7 years ago

@fubz - the error indicates that the process running glimpse doesn't have access to ip and ifconfig commands on the path, or doesn't have perms to execute those commands. Two questions:

  1. In output above, did you run all those commands (ifconfig, ip & node <your-getmac-script>) from the same shell?
  2. Can you run ifconfig -a and ip link from your shell?