Debugging Issues with Websockets

I’m experiencing the same issue in v5.8.1. There are no logs to identify the issue.

1 Like

Socket for me is not working in version 5.8.1

does this happen to anyone else?

I can’t get out of version 5.6.2 @patrick

Same here.

Server actions with live refresh don’s load on the page (no errors it just doesn’t appear). Any server action that triggers a refresh also won’t run.

Is it possible to get a link to revert to 5.6.2 as it’s not really possible to remove all socket based actions temporarily and then add them back when this is fixed ?

Thanks

@sbecks https://account5.wappler.io/download/Wappler-win64-5.6.2.exe

v5.6.2
Windows:
https://account5.wappler.io/download/Wappler-win64-5.6.2.exe

MacOS:
https://account5.wappler.io/download/Wappler-Mac-5.6.2.dmg

MacOS M1:
https://account5.wappler.io/download/Wappler-Mac-arm64-5.6.2.dmg

Like I said, look like this is the more stable version for now. I’m sure that Wappler Team is working on it.

1 Like

The ioredis errors are related to the wappler-bull-queues extension and in my case is addressed by updating to the most recent release of the extension. New Error in 5.8.0: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379

@Alexander_Paladines, @AdrianoLuiz are you both using the wappler-bull-queues v2 extension (I am)? I wonder if there is a common config…

No, I don’t use external extensions :slight_smile:

1 Like

In my case I’m not using “wappler-bull-queues” extension, even redis by default.

1 Like

Good to know. I guess we’ll wait for an update from the Wappler team.

Hi @patrick I know this didn’t start as a bug thread but it seems like a confirmed issue and I changed the tag. The post doesn’t follow the normal bug format though, lmk if you’d like me to create a formal bug post. Thanks!

There is something wrong with the latest versions.
I’m running into constant socket issues with the current version. Redis is configured correctly, but this happens after a while, and then the app crashes:

SocketClosedUnexpectedlyError: Socket closed unexpectedly
    at TLSSocket.<anonymous> (/opt/node_app/node_modules/@redis/client/dist/lib/client/socket.js:195:118)
    at Object.onceWrapper (node:events:628:26)
    at TLSSocket.emit (node:events:525:35)
    at node:net:322:12
    at TCP.done (node:_tls_wrap:588:7)

This only happens if the app runs inside a container, which did not occur with older Wappler versions.

I tried many things to debug this, but I’m unsure what’s going on. Both self-hosted Redis and managed clusters lead to these issues.

Replace the file lib/setup/config.js with the following file: config.zip (1.2 KB)

It seems that with the new Redis Client (v4) when no error event handler is attached it will crash the server. Let me know if the above update fixes it.

SocketClosedUnexpectedlyError: Socket closed unexpectedly · Issue #2032 · redis/node-redis (github.com)

Hi, Sorry @patrick, the update file makes no difference. When “Live Refresh with Sockets” is enable no data is returning. When “Live Refresh with Sockets” is not enabled everything works as expected.

Do you use the Beta channel or the Stable? Do you get an error in the server logs?

Stable channel, NodeJS, Windows, Docker.
No server logs about sockets.

Are you sure you’re using the stable version and not the beta? Can you open the dmxAppConnect.js file on your server and check the version there?
https://your-url.com/dmxAppConnect/dmxAppConnect.js

Always
image
image

The only that I have always on is experimental features, but in this case is the same on or off.
Verison of file: dmxAppConnect/dmxAppConnect.js

/*!
 App Connect
 Version: 1.14.12
 (c) 2023 Wappler.io
 @build 2023-03-14 12:22:18
 */

Do you also use Redis on the server? Does the live refresh work when Redis is disabled?

In Docker if I stop Redis server the site stop working and on Node server logs show me this:

SocketClosedUnexpectedlyError: Socket closed unexpectedly
    at Socket.<anonymous> (/opt/node_app/node_modules/@redis/client/dist/lib/client/socket.js:195:118)
    at Object.onceWrapper (node:events:628:26)
    at Socket.emit (node:events:513:28)
    at TCP.<anonymous> (node:net:301:12)

After that I disabled Live Refresh, save and I get this on logs:

server-connect:setup:config redis connection failed, Error: getaddrinfo EAI_AGAIN redis     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) { errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'redis' } +10s
Error: getaddrinfo EAI_AGAIN redis
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) {
  errno: -3001,
  code: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'redis'
}

Turn on again Live Refresh and get same message when it’s off.

When I deactivate Redis from Server Connect Setting the Live Refresh works normally. So I understand that the problems comes from redis.
image

Yes, I use Redis on server.