mautrix / whatsapp

A Matrix-WhatsApp puppeting bridge
https://maunium.net/go/mautrix-whatsapp
GNU Affero General Public License v3.0
1.28k stars 173 forks source link

Application service has not registered this user #251

Closed Toromino closed 3 years ago

Toromino commented 3 years ago

I have followed the set-up instructions, configured the bridge and appended my registration.yaml to my homeserver.yaml. Yet I get this error message: GET /_matrix/client/r0/account/whoami: M_FORBIDDEN (HTTP 403): Application service has not registered this user. Retrying in 10 seconds...

Both Mautrix and Synapse are running on the same server, I am not using Docker.

My config.yaml:

homeserver:
  address: https://sigsegv.cc
  domain: sigsegv.cc
  asmux: false
appservice:
  address: http://localhost:29318
  hostname: 0.0.0.0
  port: 29318
  database:
    type: sqlite3
    uri: mautrix-whatsapp.db
    max_open_conns: 20
    max_idle_conns: 2
  provisioning:
    prefix: /_matrix/provision/v1
    shared_secret: disable
  id: whatsapp
  bot:
    username: whatsappbot
    displayname: WhatsApp bridge bot
    avatar: mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr
  as_token: Redacted
  hs_token: Redacted

My registration.yaml:

  id: whatsapp
url: http://localhost:29318
as_token: <redacted>
hs_token: <redacted>
sender_localpart: <redacted>
rate_limited: false
namespaces:
  users:
  - regex: ^@whatsapp_[0-9]+:sigsegv.cc$
    exclusive: true
  - regex: ^@whatsappbot:sigsegv.cc$
    exclusive: true

Interesting enough, whenever I start synapse my ApplicationService confirms that the service has been loaded:


2021-01-11 10:06:50,462 - synapse.config.appservice - 87 - INFO - None - Loaded application service: ApplicationService: {'token': '<redacted>', 'url': 'http://localhost:29318', 'hs_token': '<redacted>', 'sender': '@<redacted>:sigsegv.cc', 'server_name': 'sigsegv.cc', 'namespaces': {'users': [{'regex': re.compile('^@whatsapp_[0-9]+:sigsegv.cc$'), 'exclusive': True}, {'regex': re.compile('^@whatsappbot:sigsegv.cc$'), 'exclusive': True}], 'aliases': [], 'rooms': []}, 'id': 'whatsapp', 'ip_range_whitelist': None, 'protocols': set(), 'rate_limited': False}
sackett commented 3 years ago

Same problem. If you'll find solution please write here.

GeorgeGhost commented 3 years ago

I also had this issue, I have changed these parameters to get it working (not sure which one made it work as I changed them at the same time):

sackett commented 3 years ago

this helps me: https://github.com/tulir/mautrix-whatsapp/issues/238#issuecomment-736208590

Toromino commented 3 years ago

Deleting the database mautrix-whatsapp.db helped me for some reason. It generated a new database and then it just worked.

Edit: It seems that I have discovered the same solution as in https://github.com/tulir/mautrix-whatsapp/issues/238#issuecomment-736208590

NZLostboy commented 3 years ago

I also had this issue, I have changed these parameters to get it working (not sure which one made it work as I changed them at the same time):

  • id : whatsappbot
  • bot: username: whatsapp_bot

I had the same issue, changing the username to whatsapp_bot resolved it

XayOn commented 3 years ago

Same here, for some reason could not register whatsappbot...

Ezwen commented 11 months ago

Encountering this issue with version v0.10.4.

I'm using a Postgres database, and I tried recreating it from scratch as suggested in this thread, but when I do that my bridge does not react anymore.

I haven't tried changing id and bot.username values, as I fear this would break my existing bridged rooms?