Websocket error

I’m having some trouble starting Matrix on the Raspberry Pi. It was working and now it’s suddenly not. Is there an issue with the engine?

Dependencies up to date.
socket error { Error: websocket error
    at WS.Transport.onError (/home/pi/matrix-os/node_modules/engine.io-client/lib/transport.js:64:13)
    at WebSocket.ws.onerror (/home/pi/matrix-os/node_modules/engine.io-client/lib/transports/websocket.js:149:10)
    at WebSocket.onError (/home/pi/matrix-os/node_modules/ws/lib/WebSocket.js:452:14)
    at emitOne (events.js:96:13)
    at WebSocket.emit (events.js:188:7)
    at ClientRequest.onerror (/home/pi/matrix-os/node_modules/ws/lib/WebSocket.js:711:10)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketOnEnd (_http_client.js:344:9)
    at emitNone (events.js:91:20)
  type: 'TransportError',
  description:
   { Error: socket hang up
       at createHangUpError (_http_client.js:252:15)
       at TLSSocket.socketOnEnd (_http_client.js:344:23)
       at emitNone (events.js:91:20)
       at TLSSocket.emit (events.js:185:7)
       at endReadableNT (_stream_readable.js:974:12)
       at _combinedTickCallback (internal/process/next_tick.js:74:11)
       at process._tickCallback (internal/process/next_tick.js:98:9)
     code: 'ECONNRESET',
     type: 'error',
     target:
      WebSocket {
        domain: null,
        _events: [Object],
        _eventsCount: 4,
        _maxListeners: undefined,
        _socket: null,
        _ultron: null,
        _closeReceived: false,
        bytesReceived: 0,
        readyState: 0,
        supports: [Object],
        extensions: {},
        _binaryType: 'nodebuffer',
        _isServer: false,
        url: 'wss://stage-mxss.admobilize.com/engine.io/?deviceToken=<removed token>=3&transport=websocket',
        protocolVersion: 13 } } } Error: websocket error
    at WS.Transport.onError (/home/pi/matrix-os/node_modules/engine.io-client/lib/transport.js:64:13)
    at WebSocket.ws.onerror (/home/pi/matrix-os/node_modules/engine.io-client/lib/transports/websocket.js:149:10)
    at WebSocket.onError (/home/pi/matrix-os/node_modules/ws/lib/WebSocket.js:452:14)
    at emitOne (events.js:96:13)
    at WebSocket.emit (events.js:188:7)
    at ClientRequest.onerror (/home/pi/matrix-os/node_modules/ws/lib/WebSocket.js:711:10)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketOnEnd (_http_client.js:344:9)
    at emitNone (events.js:91:20)
[]

This happens to me quite frequently. Currently I just keep restarting the matrix-os on the Raspberry Pi until I get the ASCII Matrix logo again and the start up LEDs disappear.

I would like to know how to fix this as well.

Sorry, this is a known issue we’re going through with our connections. Once a device connects, it should be solid, but sometimes it takes a few tries to make it happen. This will be resolved quickly.

1 Like

@architek1 @gvjonjones can you try again please? we’ve redeployed some new server code.

@CreatorSean seems to be working now.

Will it be possible to deploy directly from my linux VM to the Matrix without having to go via your web app? There’s some use cases I can think of for myself where there would not be internet connectivity.

I started it up around 10 times and I’m happy to report I had zero web socket errors. Thanks guys!

Right now, online capability is required to install or deploy applications. We want to support purely offline use, but that will come down the road.

Thanks for letting us know @architek1! Glad it’s working for you.

Hey everyone.

I just installed Matrix OS and started up and I am too getting this websocket error :frowning:

@russianator have you tried a fresh install? we’ve been upgrading our servers.

did a full reinstall and it’s up and running now.

cheers

hey @russianator , how did you do the full reinstall? For me installing another matrix-os in a different location didn’t fix the problem.

I am also experiencing this error. Is the Matrix OS still down/ is that why I am getting this error?

@ntpincus Are you using Matrix OS 0.17.0? I just tested that and it works.

@CreatorSean
The Matrix cli is v1.7.0 on my dev machine
The Matrix OS on the pi is v0.7.0.
I am using the dev branch on both.

On the pi I also see a socket error, when I run NODE_ENV=dev DEBUG=* node index.js
Immediately after “stream Init Streaming Server: wss://dev-mxss.admobilize.com/…“
I see:
engine.io-client:socket creating transport “websocket” +2s
engine.io-client:socket setting transport websocket +57ms
engine.io-client:socket socket error {“type”:“TransportError”,“description”:{“code”:“ECONNRESET”,“type”:“error”,“target”:{“domain”:null,”_events”:{},"_eventsCount":4,"_socket":null,"_ultron":null,"_closeReceived":false,“bytesReceived”:0,“readyState”:0,“supports”:{“binary”:true},“extensions”:{},"_binaryType":“nodebuffer”,"_isServer":false,“url”:“wss://dev-mxss.admobilize.com/engine.io/?deviceToken={removed}&deviceId={removed}=3&transport=websocket”,“protocolVersion”:13}}} +70ms
socket error: websocket error
engine.io-client:socket socket close with reason: “transport error” +7ms
stream socket close: null +141ms
stream Start Socket Watch +1ms
stream Socket Watch 4000 +1ms
stream Stop Socket Watch +2ms

0.7.0? Are you sure? You should upgrade.

Our dev environment and production environment use discrete ids and tokens. When you use NODE_ENV=dev it switches to the dev cloud environment.

When you registered your device, were you using dev in the CLI tool?

You can switch with matrix set env dev.

This is the only thing I can think of, previously it did send back an unauthorized error, but this might have changed.

@CreatorSean
Sorry, typo. The matrix-os on the pi is version 0.17.0.
I have verified that I am on dev in the CLI tool using the command you provided. The repo is up to date with the github dev branch as well. Should I use a different branch?
After I login (via CLI), I see the device/device ID listed when I type
matrix list devices
The device ID from the CLI matches the device ID on the Pi when I run
NODE_ENV=dev node index.js

When you type matrix does it say ‘Env: production’ or ‘Env: dev’ at the end?

@CreatorSean
Unfortunately both are dev.
The CLI definitely says Env: dev at the very bottom of the output of matrix
User: my_uname Device: doe5… Locale: en Env: dev
The RPi also prints out that dev was selected in the first line of output.
Environment Selected: dev

@ntpincus Can you try DEBUG=* matrix ping from your local computer?

Then we can see if you’re experiencing the same issue from your computer. This would only confirm it’s an external issue.