Migration - Invalid MAC

Hello, I’m trying to migrate from Invoice Ninja V4 to V5 however when I try migrating I keep getting an Invalid MAC error. Additionally on my V4 install (which I restored from a SQL DB backup) I can view my data and archive clients however when I try creating a new one or doing anything with new information I keep getting a “whoops something went wrong error”

I also had to manually disable 2FA in phpmyadmin because I was getting thrown the server error even when entering the proper token.

I went into my error log for Lavavel and got this - it’s from the fresh V4 install.

[2021-07-24 17:52:21] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“validate_two_factor/SaVg85dFle4R8yGsfxCR8yTvoNQGxKwi”} []
[2021-07-24 17:52:26] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/[redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:2,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“validate_two_factor/SaVg85dFle4R8yGsfxCR8yTvoNQGxKwi”} []
[2021-07-24 17:52:41] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/[redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:3,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“validate_two_factor/SaVg85dFle4R8yGsfxCR8yTvoNQGxKwi”} []
[2021-07-24 17:52:56] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/[redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:4,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“validate_two_factor/SaVg85dFle4R8yGsfxCR8yTvoNQGxKwi”} []
[2021-07-24 17:54:56] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/[redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Charles Costa”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:5,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“login”} []
[2021-07-24 18:20:19] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/[redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Charles Costa”,“method”:“GET”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:6,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“settings/online_payments”} []
[2021-07-24 18:21:29] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/[redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Charles Costa”,“method”:“GET”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:7,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“settings/online_payments”} []
[2021-07-24 18:28:45] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/[redacted]/public_html/[redacted]/vendor/turbo124/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Charles Costa”,“method”:“GET”,“user_agent”:“Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36”,“locale”:“en”,“ip”:“3.101.55.212”,“count”:8,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“clients/34”} []

Thanks in advance for any assistnace,

Charles

Hi,

The most common cause for the mac error is the value of APP_KEY changing in the .env file

Are you able to view/edit the payment gateways in the app? You may be able to manually clear the gateway configs in the database to avoid the error.

Hello thanks for the prompt response. I just went in and cleared the tables with gateway entries and the migration went through. Very much appreciate the help.