Hi there,
Since speedy nodes are deprecated, I’m currently using LiveQuery to listen to new events (performed smart contract event syncs before). However, sometimes I’m facing this issue when starting:
Error: Unexpected server response: 503
at ClientRequest.<anonymous> (/root/project/node_modules/ws/lib/websocket.js:604:7)
at ClientRequest.emit (events.js:314:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:601:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:122:17)
at TLSSocket.socketOnData (_http_client.js:474:22)
at TLSSocket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at TLSSocket.Readable.push (_stream_readable.js:213:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
Emitted 'error' event on WebSocket instance at:
at abortHandshake (/root/project/node_modules/ws/lib/websocket.js:731:15)
at ClientRequest.<anonymous> (/root/project/node_modules/ws/lib/websocket.js:604:7)
[... lines matching original stack trace ...]
at TLSSocket.Readable.push (_stream_readable.js:213:10)
(node:11285) UnhandledPromiseRejectionWarning: Error: Received an error with invalid JSON from Parse: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.18.0 (Ubuntu)</center>
</body>
</html>
Can you please tell me how to fix? Thank you
FYI, I use Moralis Node with serverUrl
, appId
and masterKey
opts.