I think I might have f’d up, but I’m not 100% sure yet and have some questions hopefully that can provide me some clarity. Here is what happened: I logged in to my self hosted version of invoice ninja and was met with an upgrade available prompt, to version 5.10.27 but after entering my password things stopped working. After enabling debugging in my .env and checking my logs. It appeared that I needed to install php 8.2 and the supporting requirements for invoice ninja. Things looked to be working ok, until I tried to login.
On login I’m met with: “500: Internal Server Error • The MAC is invalid.”
On finding: Migration - Invalid MAC I’ve read that its most likely due to the app_key changing. I don’t think it did… but as I mentioned earlier, I go into the .env to enable debugging… so maybe? I’m hoping somone has an alternative rational.
I had migrated this server earlier this year, and I thought the backup i had created would have the .env but i found that my new .env has a base64 value, were the previous version had only a string value. Does this happen to change during the migration? and am i f’d because i don’t think i have a backup of this base64 version?
Hopefully there is a path to recovery here. Please let me know! Your help is very much appreciated.
Yes, PHP 8.2 (or higher) had been required since version 5.8.x. Did you upgrade your PHP version and all required modules?
The first place to start is by looking in your logs file, found in storage/logs and see what errors are showing there. What did you find when you looked in there?
As long as you still have access to your database, your instance shouldn’t be a complete loss. But don’t panic yet.
Have you tried logging in using either the mobile or one of the desktop apps?
Have you tried adding the following to the end of your URL /update?secret=<string>? You will need to replace <string> with your secret from your .env file.
Yes I did upgrade my php to 8.2, and made sure that the required modules were installed.
The storage/logs maybe provide more detail…
[2024-10-01 01:50:53] production.ERROR: The MAC is invalid. {"userId":1,"exception":"[object] (Illuminate\\Contracts\\Encryption\\DecryptException(code: 0): The MAC is invalid. at /var/www/mydomain.com/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:189)
[stacktrace]
...
I do still have access to the database, initially i thought it might be my 2fa nonce that was messing up so I removed the 2fa token from the user database… but that wasn’t the issue.
I had not tried logging in with the android mobile app, but upon trying just got a spinning loader.
I had not tried to goto the update url, I did try, but got redirected to the login page. Q: as the current app_key=base64: — some value ---- should the url parameter just get some value? or the decoded base64? everything ive tried so far hasn’t worked.