mautrix / whatsapp

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

FOREIGN KEY constraint failed #165

Closed rajil closed 4 years ago

rajil commented 4 years ago

Hello, Mautrix-Whatsapp bot stopped responding to help command and I see this in the log


[Apr  7, 2020 09:57:16] [DEBUG] Initializing database
[Apr  7, 2020 09:57:16] [DEBUG] Initializing state store
[Apr  7, 2020 09:57:16] [DEBUG] Initializing Matrix event processor
[Apr  7, 2020 09:57:16] [DEBUG] Initializing Matrix event handler
[Apr  7, 2020 09:57:16] [INFO] Bridge initialization complete, starting...
[Apr  7, 2020 09:57:16] [Database/Upgrade/INFO] Database currently on v12, latest: v12
[Apr  7, 2020 09:57:16] [DEBUG] Checking connection to homeserver
[Apr  7, 2020 09:57:16] [DEBUG] Starting application service HTTP server
[Apr  7, 2020 09:57:16] [DEBUG] Starting event processor
[Apr  7, 2020 09:57:16] [INFO] Bridge started!
[Apr  7, 2020 09:57:16] [DEBUG] Starting users
[Apr  7, 2020 09:57:16] [DEBUG] Updating bot profile
[Apr  7, 2020 09:57:16] [DEBUG] Starting custom puppets
[Apr  7, 2020 09:57:16] [Matrix/INFO] Listening on 0.0.0.0:29318
[Apr  7, 2020 09:58:42] [Database/User/WARN] Failed to update @user:mydomain.com: FOREIGN KEY constraint failed
[Apr  7, 2020 09:58:42] [Matrix/DEBUG] !bleep:mydomain.com registered as a management room with @user:mydomain.com
[Apr  7, 2020 09:58:44] [Command handler/DEBUG] @user:mydomain.com sent 'help' in !blahblah:mydomain.com
[Apr  7, 2020 09:58:52] [Command handler/DEBUG] @user:mydomain.com sent 'help' in !blahblah:mydomain.com
[Apr  7, 2020 09:58:54] [Command handler/DEBUG] @user:mydomain.com sent 'login' in !blahblah:mydomain.com
[Apr  7, 2020 09:58:54] [User/@user:mydomain.com/DEBUG] Connecting to WhatsApp
[Apr  7, 2020 09:58:55] [User/@user:mydomain.com/DEBUG] WhatsApp connection successful
~             
rajil commented 4 years ago

I renamed the mautrix-whatsapp.db to mautrix-whatsapp.db.old. Generated the registration.yaml file again, and restarted matrix and bridge server. Unfortunately, still the bot is not responding to commands in Riot-Desktop.


Apr 07 10:30:41 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:30:41] [DEBUG] Starting event processor
Apr 07 10:30:41 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:30:41] [INFO] Bridge started!
Apr 07 10:30:41 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:30:41] [DEBUG] Updating bot profile
Apr 07 10:30:41 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:30:41] [DEBUG] Starting users
Apr 07 10:30:41 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:30:41] [DEBUG] Starting custom puppets
Apr 07 10:30:41 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:30:41] [Matrix/INFO] Listening on 0.0.0.0:29318
Apr 07 10:31:21 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:31:21] [Matrix/DEBUG] !GjoaVntyRBABxLVbrQ:mydomain.com registered as a management room with @user:mydomain.com
Apr 07 10:31:28 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:31:28] [Command handler/DEBUG] @user:mydomain.com sent 'help' in !blah:mydomain.com
Apr 07 10:31:44 matrix1 mautrix-whatsapp[29059]: [Apr  7, 2020 10:31:44] [Command handler/DEBUG] @user:mydomain.com sent 'ping' in !blah:mydomain.com
rajil commented 4 years ago

Ok, figured out. The whatsappbot was in my 'ignored' list in Riot Web settings. Once, i removed it from there, the messages started coming through.