mirror of
https://github.com/anonaddy/anonaddy.git
synced 2026-04-25 06:05:55 +03:00
[GH-ISSUE #333] 500 Server error after update "The MAC is invalid." #838
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/anonaddy#838
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @returntoreality on GitHub (Sep 8, 2022).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/333
I'm running a self-hosted anonaddy instance and tried updating from 0.11.1 to 0.13.7. I looked through the release notes and followed the instructions there and the general update instrutions in the self hosting guide. I now get a 500 Server Error after logging in (login screen is shown) and I get the following backtrace in the laravel log:
When googling for this error, I found this could be caused by changing the APP_KEY, but I definitely did not do that.
@willbrowningme commented on GitHub (Sep 8, 2022):
That looks like it is the
two_factor_secretcolumn on the users table that has the invalid MAC. Do you have TOTP 2FA enabled?Are you sure you didn't accidentally run
php artisan key:generatewhen upgrading?@returntoreality commented on GitHub (Sep 8, 2022):
Yes, this account uses TOTP
Yes, I am sure I did not run that command.
@willbrowningme commented on GitHub (Sep 8, 2022):
If you run
php artisan tinkerand then runRecipient::first()?->emaildoes it give the same error?No changes have been made to the code that could have resulted in the app key being changed as can be seen when comparing https://github.com/anonaddy/anonaddy/compare/v0.11.1...v0.13.7.
@returntoreality commented on GitHub (Sep 8, 2022):
Yes, gives the same error. Could this possibly be caused by some update to a dependency?
@willbrowningme commented on GitHub (Sep 9, 2022):
I don't see any way that it could have been. Do you have a backup of your old
.envandAPP_KEYso that you can use the old one again?@returntoreality commented on GitHub (Sep 10, 2022):
Unfortunately not, I backed up other paths on the server and the database but not the anonaddy installation directory. What do you think is the best approach to get the instance running again (I'd like to keep the aliases)? Is the encryption used on other database fields? Can I reset the user accounts (e.g. setting new credentials)?
@willbrowningme commented on GitHub (Sep 12, 2022):
Well the bad news is that if you do not have any backup of the old
APP_KEYthen all the encrypted values will be lost.You can see which fields are encrypted in the database by viewing each file in the Models directory and seeing what fields they have in the
encryptedarray e.g. for the Recipient model:You may have to temporarily comment out this line in the
HasEncryptedAttributes.phptrait so that you can at least usephp artisan tinkerwithout errors.Then you will have to go through all the encrypted fields and either set them as NULL (if nullable) or re-save them using the new
APP_KEY.I'd recommend backing up the new
APP_KEYin a password manager just to make sure this cannot happen again.@willbrowningme commented on GitHub (Sep 13, 2022):
Did you manage to get it back up and running with the new
APP_KEY?Closing this issue as I cannot see a way that the
APP_KEYcould have been changed during the update process.@returntoreality commented on GitHub (Sep 13, 2022):
Somewhat, the frontend does not work yet, but no Invalid MAC or other php errors and the forwarding works. Thanks for your help!
@AdrianColaianni commented on GitHub (Mar 13, 2024):
I am having the same issue updating from v0.13.4 to v1.0.9. However, my
.envfile hasn't changed since Feb 2023 so it is not possible that theAPP_KEYchanged. I followed the instructions as they were outlined inSELF_HOSTING.mdand did not accidentally runphp artisan key:generate.