Socket-IO Redis error

Solved Technical Support
  • New problem! Again, getting everything up to v1.17.0. We run clustered, so now we need redis (we run a postgresql DB for a DB). For background, in production we have docker images and blah blah blah...I've not been able to get that environment duplicated, so I'm just running stuff outside of docker.

    In my dev VM I'm running Kubuntu 18.04. The "setting up redis" documentation was light on details like specific versions so I just installed the redis from my repo:

    redis/bionic-updates,bionic-updates,bionic-security,bionic-security,now 5:4.0.9-1ubuntu0.2

    Stuff mostly seems to work. However, when we're up and running if I click on an unread topic link this happens:

    2021-05-12T23:25:07.092Z [4567/106387] - verbose: [plugins/fireHook] filter:topic.getFields
    2021-05-12T23:25:07.092Z [4567/106387] - verbose: [plugins/fireHook] filter:privileges:isAllowedTo
    2021-05-12T23:25:07.093Z [4567/106387] - verbose: [plugins/fireHook] filter:privileges:isAllowedTo
    2021-05-12T23:25:07.093Z [4567/106387] - verbose: [plugins/fireHook] filter:privileges:isAllowedTo
    2021-05-12T23:25:07.093Z [4567/106387] - verbose: [plugins/fireHook] filter:category.getFields
    2021-05-12T23:25:07.093Z [4567/106387] - verbose: [plugins/fireHook] filter:privileges.topics.filter
    2021-05-12T23:25:07.094Z [4567/106387] - verbose: [plugins/fireHook] filter:topic.getFields
    2021-05-12T23:25:07.096Z [4567/106387] - verbose: [plugins/fireHook] filter:user.getSettings
    2021-05-12T23:25:07.096Z [4567/106387] - verbose: [plugins/fireHook] filter:user.notificationTypes
    2021-05-12T23:25:07.096Z [4567/106387] - verbose: [plugins/fireHook] filter:topics.getUnreadTids
    2021-05-12T23:25:07.096Z [4567/106387] - verbose: [plugins/fireHook] filter:error.handle
    2021-05-12T23:25:07.097Z [4567/106387] - error: /wtf/api/topic/13289/song-of-the-day/4062
    TypeError: socket.client.writeToEngine is not a function
        at /home/boomzilla/nodebb/node_modules/socket.io-redis/node_modules/socket.io-adapter/dist/index.js:110:27
        at RedisAdapter.apply (/home/boomzilla/nodebb/node_modules/socket.io-redis/node_modules/socket.io-adapter/dist/index.js:194:25)
        at RedisAdapter.broadcast (/home/boomzilla/nodebb/node_modules/socket.io-redis/node_modules/socket.io-adapter/dist/index.js:109:14)
        at RedisAdapter.broadcast (/home/boomzilla/nodebb/node_modules/socket.io-redis/dist/index.js:321:15)
        at BroadcastOperator.emit (/home/boomzilla/nodebb/node_modules/socket.io/dist/broadcast-operator.js:109:22)
        at Topics.pushUnreadCount (/home/boomzilla/nodebb/src/topics/unread.js:254:44)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
        at async Promise.all (index 1)
        at async markAsRead (/home/boomzilla/nodebb/src/controllers/topics.js:161:3)
    

    Any idea what might be going on?

    EDIT: If I refresh or hit enter from the address bar the page loads as expected.

  • Since you are running locally can you try with these dependencies.

    [email protected]
    [email protected]
    [email protected]
    

    This forum is running latest master which is 1.17.1

  • Can you check the versions of the dependencies?

    npm ls socket.io
    npm ls socket.io-redis
    npm ls socket.io-client

  • @baris

    [email protected] /home/boomzilla/nodebb
    └── socket.io@4.0.1
    └── [email protected]
    └── [email protected]

  • I've been working through my custom plugins. I think I have all the breaking changes fixed but am still having this issue. So I deactivated them. Here's what I'm running now:

    nodebb-plugin-composer-default
    Installed 6.5.27 | Latest 6.5.27

    nodebb-plugin-dbsearch
    Installed 4.2.0 | Latest 4.2.0

    nodebb-plugin-desktop-notifications
    Installed 0.3.3 | Latest 0.3.3

    nodebb-plugin-emoji
    Installed 3.5.3 | Latest 3.5.3

    nodebb-plugin-emoji-one
    Installed 2.0.5 | Latest 2.0.5

    nodebb-plugin-google-analytics
    Installed 0.5.11 | Latest 0.6.0

    nodebb-plugin-gravatar
    Installed 2.3.0 | Latest 2.3.0

    nodebb-plugin-iframely
    Installed 0.7.14 | Latest 0.7.14

    nodebb-plugin-imagemagick
    Installed 2.1.1 | Latest 2.1.1

    nodebb-plugin-markdown
    Installed 8.12.7 | Latest 8.12.7

    nodebb-plugin-mentions
    Installed 2.13.9 | Latest 2.13.9

    nodebb-plugin-shortcuts
    Installed 1.1.2 | Latest 1.1.2

    nodebb-plugin-spam-be-gone
    Installed 0.7.9 | Latest 0.7.9

    nodebb-plugin-sso-facebook
    Installed 3.6.3 | Latest 3.6.3

    nodebb-plugin-sso-github
    Installed 2.3.1 | Latest 2.3.1

    nodebb-plugin-sso-google
    Installed 2.5.4 | Latest 2.5.4

    nodebb-plugin-sso-twitter
    Installed 2.5.11 | Latest 2.5.11

    nodebb-rewards-essentials
    Installed 0.1.4 | Latest 0.1.4

    nodebb-theme-persona
    Installed 11.0.17 | Latest 11.0.17

    nodebb-widget-essentials
    Installed 5.0.3 | Latest 5.0.3

  • Since you are running locally can you try with these dependencies.

    [email protected]
    [email protected]
    [email protected]
    

    This forum is running latest master which is 1.17.1

  • @baris I'm really trying to stick to actual releases (looking at github it doesn't look like 1.17.1 has been officially blessed yet). However, staying on v1.17.0 and bumping the socket.io and socket.io-client versions seems to have done the trick!


Suggested Topics