-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"The Payload is Invalid" on Dashboard after adding 2nd factor / f2a #2761
Comments
Had to remove the google2fa_secret to gain access again. |
Had to do the same over on mine. |
This is still an issue when the docker image is built from latest master. |
I have found what causes this problem: your mysql instance must be > 5.7 So it is not related to monica, or docker, only the version of mysql you will use. |
Isn't it problem with database schema then? Sounds like something that Monica should set during install. |
Yes it is the case. |
It's not clear for me now if you're going to set it in an upcoming migration or we should do this manually in the DB. |
Okay, so I was impatient, and here is my solution. Step 1 - Upgrade to MariaDB 10.4 (Ubuntu has only 10.1.41 ~ equivalent to MySQL 5.6) sudo su
apt install -y software-properties-common
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.lstn.net/mariadb/repo/10.4/ubuntu bionic main'
apt update
apt upgrade -y
apt install -y mariadb-plugin-connect mariadb-server
# these 2 got kept back on the above upgrade, so we need to gently force
mysql_upgrade
# there are warnings but eventually, it will work without any probs:
# your_monica_db.accounts
# Warning : Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
# Warning : Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
# status : OK
systemctl restart mariadb.service
# just to make sure :)
mysqld --version
# mysqld Ver 10.4.8-MariaDB-1:10.4.8+maria~bionic for debian-linux-gnu on x86_64 (mariadb.org binary distribution) Step 2 - Update the DB to have a longer column for 2FA: USE your_monica_db;
SHOW CREATE TABLE users;
-- `google2fa_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
ALTER TABLE users MODIFY google2fa_secret VARCHAR(256);
SHOW CREATE TABLE users;
-- `google2fa_secret` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, Step 3 - Enable 2FA, now it works fine, enjoy :) |
Well actually I think you could update the column to have a VARCHAR(256) with mysql 5.6 ... I have to inspect it. |
I think you're right but I've also wanted to update for a long time, it just gave me the push to do it finally 😀 |
Migration should really be handled by the application using the database, in this case Monica. The database doesn't know what you want from it, you have to tell it. Which is better because you know and set the changes you need as the application evolves. I don't think this issue should be closed as Monica should be the one handling this. |
Just installed this fresh from Github and experienced this error as soon as I enabled 2FA. Tried emptying the field contents and setting to 256 varchar but still can't log in, any ideas? Not sure if there's a cache that needs clearing? |
Ah, figured it out I think, was running locally without a secure connection, just read the tiny print after wiping my instance and starting again! |
Sorry, it was a really quick fix, it should have been done soon ;) |
This issue has been automatically locked since there |
(Note: you don't need to follow this template, nor to keep headlines or bold sentences - they are just there to guide you. Feel free to delete everything. We review every issue even if we don't immediately respond.)
Thanks for filing an issue and for your interest in the project.
Describe the bug
A clear and concise description of what the bug is. If your comment is
it doesn't work
, we won't know what to do with it.Screenshots
Which version are you using:
Additional context
The text was updated successfully, but these errors were encountered: