Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

nctalkchatbots TypeError: chat.getActordisplayname is not a function #4

Open
egargale opened this issue Sep 18, 2020 · 0 comments
Open

Comments

@egargale
Copy link

On a Nextcloud (docker) 19.0.3 with Talk App. 9.04 nctalkchatbot is not working and crashes on any message in the chat . The error is the following:

nctalkchatbots | (node:19) UnhandledPromiseRejectionWarning: TypeError: chat.getActordisplayname is not a function
nctalkchatbots | at /app/main.js:232:38
nctalkchatbots | at ClientReadableStreamImpl. (/app/src/nextcloudTalkBot.js:22:45)
nctalkchatbots | at ClientReadableStreamImpl.emit (events.js:314:20)
nctalkchatbots | at addChunk (_stream_readable.js:307:12)
nctalkchatbots | at readableAddChunk (_stream_readable.js:282:9)
nctalkchatbots | at ClientReadableStreamImpl.Readable.push (_stream_readable.js:221:10)
nctalkchatbots | at Object.onReceiveMessage (/app/node_modules/@grpc/grpc-js/build/src/client.js:317:28)
nctalkchatbots | at Object.onReceiveMessage (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:287:182)
nctalkchatbots | at /app/node_modules/@grpc/grpc-js/build/src/call-stream.js:164:74
nctalkchatbots | at processTicksAndRejections (internal/process/task_queues.js:75:11)
nctalkchatbots | (node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)

nctalkproxyd seems to work fine. It joins the chat rooms, read the messages and report to client

{"level":"info","timestamp":"2020-09-18T16:34:47Z","message":"starting server"},
{"level":"info","status":"joined room "admin" ("admin") with ID "9" and token "5wez9a79"","timestamp":"2020-09-18T16:34:51Z","message":"received Nextcloud client status"},
{"level":"info","status":"joined room "Talk updates ✅" ("jitsibot") with ID "14" and token "gd5qgjzr"","timestamp":"2020-09-18T16:34:51Z","message":"received Nextcloud client status"},
{"level":"info","status":"joined room "mytest4444" ("mytest4444") with ID "16" and token "ib5k2mfe"","timestamp":"2020-09-18T16:34:51Z","message":"received Nextcloud client status"},
{"level":"info","timestamp":"2020-09-18T16:34:51Z","message":"new client connected to service"},
{"level":"info","chat":{"id":212,"token":"ib5k2mfe","actorType":"users","actorId":"gargale","actorDisplayName":"Enrico Gargale","isReplyable":true,"message":"Prova di messaggio","messageParamertes":""},"timestamp":"2020-09-18T16:41:07Z","message":"writing chat from Nextcloud Talk to clients"},
{"level":"info","chat":{"id":213,"token":"ib5k2mfe","actorType":"users","actorId":"gargale","actorDisplayName":"Enrico Gargale","isReplyable":true,"message":"#meeting","messageParamertes":""},"timestamp":"2020-09-18T16:41:47Z","message":"writing chat from Nextcloud Talk to clients"},
{"level":"info","chat":{"id":214,"token":"ib5k2mfe","actorType":"users","actorId":"gargale","actorDisplayName":"Enrico Gargale","isReplyable":true,"message":"#chat","messageParamertes":""},"timestamp":"2020-09-18T16:42:25Z","message":"writing chat from Nextcloud Talk to clients"},

Below the docker-compose.yml for the services:

version: '3'
services:
    nctalkproxyd:
        image: pojntfx/nctalkproxyd
        container_name: nctalkproxyd
        restart: unless-stopped
        ports:
            - "1969:1969"
        volumes:
            - nctalkproxyd:/var/lib/nctalkproxyd
        environment:
            NCTALKPROXYD_DBPATH: "/var/lib/nctalkproxyd"
            NCTALKPROXYD_USERNAME: "jitsibot"
            NCTALKPROXYD_PASSWORD: "PASSWORD"
            NCTALKPROXYD_RADDR: "https://NEXTCLOUD.EXAMPLE.COM"
            NCTALKPROXYD_ADDRREMOTE: "https://NEXTCLOUD.EXAMPLE.COM"
        networks:
            - nctalkbots
    nctalkchatbots:
        container_name: nctalkchatbots
        restart: unless-stopped
        image: pojntfx/nextcloud-talk-bot-jitsi
        environment:
            NCTALKBOT_BOT_NAME: "jitsibot"
        networks:
            - nctalkbots
networks:ts 
    nctalkbots:
        external: true
volumes:
    nctalkproxyd:
        driver: local

Unsuccessful attempts for resolving the problem:

  • Downgrade Nextcloud to ver. 18 latest
  • Build the docker containers instead of using the docker hub images

Any hint would be appreciated. And thanks for the code.

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

No branches or pull requests

1 participant