wechaty / matrix-appservice

Wechaty [Matrix] Application Services Bridge
https://matrix.org/docs/projects/bridge/matrix-appservice-wechaty
Apache License 2.0
133 stars 16 forks source link

ERR MatrixHandler onEvent() rejection: no matrix user id found) #59

Open zhangchunsheng opened 4 years ago

zhangchunsheng commented 4 years ago

cat config.yaml

domain: xxx.com
homeserverUrl: https://matrix.xxx.com
registration: wechaty-registration.yaml

cat wechaty-registration.yaml

id: wechaty
hs_token: xxx
as_token: xxx
url: 'http://xxx:8788'
sender_localpart: wechaty
protocols:
  - wechaty
namespaces:
  aliases:
    - exclusive: true
      regex: '#wechaty_.*'
  users:
    - exclusive: true
      regex: '@wechaty_.*'
rate_limited: false

cat docker-compose.yml

version: '2'
services:
  matrix-appservice-wechaty:
      container_name: matrix-appservice-wechaty
      image: wechaty/matrix-appservice
      volumes:
        - ./config:/data
      networks:
        - default
      environment:
        - WECHATY_PUPPET_PADPLUS_TOKEN=xxx
        - WECHATY_PUPPET=wechaty-puppet-padplus
      command: ["--config", "/data/config.yaml", "--file", "/data/wechaty-registration.yaml"]
      ports:
        - 8788:8788

!login

matrix-appservice-wechaty    | 16:06:34 ERR MatrixHandler onEvent() rejection: no matrix user id found)
matrix-appservice-wechaty    | Error: no matrix user id found)
matrix-appservice-wechaty    |     at MiddleManager.<anonymous> (/matrix-appservice-wechaty/dist/src/middle-manager.js:294:23)
matrix-appservice-wechaty    |     at Generator.next (<anonymous>)
matrix-appservice-wechaty    |     at /matrix-appservice-wechaty/dist/src/middle-manager.js:8:71
matrix-appservice-wechaty    |     at new Promise (<anonymous>)
matrix-appservice-wechaty    |     at __awaiter (/matrix-appservice-wechaty/dist/src/middle-manager.js:4:12)
matrix-appservice-wechaty    |     at MiddleManager.directMessageUserPair (/matrix-appservice-wechaty/dist/src/middle-manager.js:290:16)
matrix-appservice-wechaty    |     at MatrixHandler.<anonymous> (/matrix-appservice-wechaty/dist/src/matrix-handler.js:169:64)
matrix-appservice-wechaty    |     at Generator.next (<anonymous>)
matrix-appservice-wechaty    |     at /matrix-appservice-wechaty/dist/src/matrix-handler.js:8:71
matrix-appservice-wechaty    |     at new Promise (<anonymous>)
matrix-appservice-wechaty    |     at __awaiter (/matrix-appservice-wechaty/dist/src/matrix-handler.js:4:12)
matrix-appservice-wechaty    |     at MatrixHandler.processDirectMessage (/matrix-appservice-wechaty/dist/src/matrix-handler.js:166:16)
matrix-appservice-wechaty    |     at MatrixHandler.<anonymous> (/matrix-appservice-wechaty/dist/src/matrix-handler.js:158:28)
matrix-appservice-wechaty    |     at Generator.next (<anonymous>)
matrix-appservice-wechaty    |     at fulfilled (/matrix-appservice-wechaty/dist/src/matrix-handler.js:5:58)

image

huan commented 4 years ago

It seems that your appservice system can not get the matrixId when you sending messages to the bot.

I'd like to suggest that you can delete all the saved cache db files then try again.

https://github.com/wechaty/matrix-appservice-wechaty/blob/6a069605be0bc07fd46adfef40e800bc6aff6376/src/middle-manager.ts#L438-L447

If this issue still exists, please help yourself by reading the related source code above, it might be a bug from our source code

zhangchunsheng commented 4 years ago

It seems that your appservice system can not get the matrixId when you sending messages to the bot.

I'd like to suggest that you can delete all the saved cache db files then try again.

https://github.com/wechaty/matrix-appservice-wechaty/blob/6a069605be0bc07fd46adfef40e800bc6aff6376/src/middle-manager.ts#L438-L447

If this issue still exists, please help yourself by reading the related source code above, it might be a bug from our source code

The issue still exists after I delete the store file.