mautrix / whatsapp

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

Failed to connect to homeserver #178

Closed upgradetofreedom closed 3 years ago

upgradetofreedom commented 4 years ago

When I start the bridge I get this output:

[May  7, 2020 23:49:11] [DEBUG] Initializing database
[May  7, 2020 23:49:11] [DEBUG] Initializing state store
[May  7, 2020 23:49:11] [DEBUG] Initializing Matrix event processor
[May  7, 2020 23:49:11] [DEBUG] Initializing Matrix event handler
[May  7, 2020 23:49:11] [INFO] Bridge initialization complete, starting...
[May  7, 2020 23:49:11] [Database/Upgrade/INFO] Database currently on v12, latest: v12
[May  7, 2020 23:49:11] [DEBUG] Checking connection to homeserver
[May  7, 2020 23:49:11] [ERROR] Failed to connect to homeserver: msg=Failed to GET JSON to **/_matrix/client/r0/account/whoami code=401 wrapped=M_UNKNOWN_TOKEN: Invalid macaroon passed.. Retrying in 10 seconds...**
olmari commented 4 years ago

Things that occured to my mind:

upgradetofreedom commented 4 years ago
olmari commented 4 years ago

Not to start wars... Why root? why not proper user and give reading rights to synapses group? Though I don't know does synapse nor bridge software reall care about credentials (like for example SSH will not use file having too broad access rights).

Does the actual file has proper rights? not just folder?

Xoltus commented 4 years ago

I had a similar problem and located a typo in server_name I provided in config.yaml. Hence, whatsappbot@domain.tld was not authorized (code=401) to connect to my homeserver.

sj64 commented 4 years ago

Had very similar issue - [ERROR] Failed to connect to homeserver: failed to ensure registered: unexpected end of JSON input. Retrying in 10 seconds...

Resolved by creating a synapse group, adding matrix-synapse user to group then chowning everything in whatsapp bridge folder to synapse group (from root), checking registration.yaml showed it had no group read permissions - so chmod that and everything started working.

psychopathio commented 4 years ago

@sj64 tried that didn't work for me, cant pass this annoying issue. Any other solutions? EDIT: I found the problem was i the homeserver.yaml

app_service_config_files: