Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crashes when trying to display any telemetry source from "Example Spacecraft" #51

Open
jannismain opened this issue Oct 20, 2021 · 4 comments

Comments

@jannismain
Copy link

jannismain commented Oct 20, 2021

Whenever I try to click on any telemetry source for the Example Spacecraft, the server crashes with the following output:

$ npm start

> [email protected] start /Users/mkj/Developer/fobp-openmct/ext/openmct-tutorial
> node example-server/server.js

Example spacecraft launched!
Press Enter to toggle thruster state.
Open MCT hosted at http://localhost:8080
History hosted at http://localhost:8080/history
Realtime hosted at ws://localhost:8080/realtime
events.js:291
      throw er; // Unhandled 'error' event
      ^

RangeError: Invalid WebSocket frame: RSV1 must be clear
    at Receiver.getInfo (./openmct-tutorial/node_modules/express-ws/node_modules/ws/lib/receiver.js:167:14)
    at Receiver.startLoop (./openmct-tutorial/node_modules/express-ws/node_modules/ws/lib/receiver.js:121:22)
    at Receiver._write (./openmct-tutorial/node_modules/express-ws/node_modules/ws/lib/receiver.js:69:10)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)
    at Receiver.Writable.write (_stream_writable.js:318:11)
    at Socket.socketOnData (./openmct-tutorial/node_modules/express-ws/node_modules/ws/lib/websocket.js:795:35)
    at Socket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
Emitted 'error' event on WebSocket instance at:
    at Receiver.receiverOnError (./openmct-tutorial/node_modules/express-ws/node_modules/ws/lib/websocket.js:700:13)
    at Receiver.emit (events.js:314:20)
    at errorOrDestroy (internal/streams/destroy.js:108:12)
    at onwriteError (_stream_writable.js:418:5)
    at onwrite (_stream_writable.js:445:5)
    at Receiver.startLoop (./openmct-tutorial/node_modules/express-ws/node_modules/ws/lib/receiver.js:141:5)
    at Receiver._write (./openmct-tutorial/node_modules/express-ws/node_modules/ws/lib/receiver.js:69:10)
    [... lines matching original stack trace ...]
    at Receiver.Writable.write (_stream_writable.js:318:11) {
  [Symbol(status-code)]: 1002
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node example-server/server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     ./.npm/_logs/2021-10-20T17_07_17_454Z-debug.log

2021-10-20 7 20 43 PM

The issue seems related to the express-ws module. Anything I could have done differently to cause this? I know that the tutorial used to work for me in the past...

I have already tried the following

  • use different node version (v14, v12)
  • clean clone and fresh install

I have attached my package-lock.json in case it is related to some rogue dependency that might need to be pinned (zipped because GitHub won't allow uploading json files).

package-lock.json.zip

/edit: updated package-lock.json file

@akhenry
Copy link
Collaborator

akhenry commented Oct 20, 2021

Thanks for reporting, and for the package-lock! That will help a lot.

This is new behavior, and it's not anything you've done.

Could you tell us which version of Chrome you're using?

@akhenry
Copy link
Collaborator

akhenry commented Oct 20, 2021

@jannismain I am noticing that express-ws does not appear in your package-lock.json. My package-lock.json shows express-ws version 4.0.0. Not quite sure what this means yet, but is it possible you have express-ws installed globally? Or did you remove the express-ws dependency from your package.json before you ran npm install?

@jannismain
Copy link
Author

I have tried it with the following Browsers:

  • Brave: Version 1.30.89 Chromium: 94.0.4606.81 (Official Build) (x86_64)
  • Chromium: Version 89.0.4389.0 (Developer Build) (x86_64)
  • Firefox: 93.0 (64-bit)

The browser console at time of the crash shows the following:

XHR GEThttp://localhost:8080/history/prop.fuel?start=1634803885565&end=1634804785565
Uncaught TypeError: req.getResponseHeader(...) is null
    generateResponse http://localhost:8080/lib/http.js:21
    onreadystatechange http://localhost:8080/lib/http.js:36
    promise http://localhost:8080/lib/http.js:33
    xhr http://localhost:8080/lib/http.js:28
    get http://localhost:8080/lib/http.js:50
    request http://localhost:8080/historical-telemetry-plugin.js:17
    request http://localhost:8080/node_modules/openmct/dist/openmct.js:335
    fetch http://localhost:8080/node_modules/openmct/dist/openmct.js:346
    load http://localhost:8080/node_modules/openmct/dist/openmct.js:346
    loadSeriesData http://localhost:8080/node_modules/openmct/dist/openmct.js:346
    n http://localhost:8080/node_modules/openmct/dist/openmct.js:17
    handleWindowResize http://localhost:8080/node_modules/openmct/dist/openmct.js:346
    n http://localhost:8080/node_modules/openmct/dist/openmct.js:17
    p http://localhost:8080/node_modules/openmct/dist/openmct.js:11
    y http://localhost:8080/node_modules/openmct/dist/openmct.js:11
    g http://localhost:8080/node_modules/openmct/dist/openmct.js:11
http.js:21:13

@jannismain
Copy link
Author

jannismain commented Oct 21, 2021

Regarding the package-lock.json I might have given you the wrong one (from openmct instead of openmct-tutorial). Sorry about that.

Here is the correct one:
package-lock.json.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants