Open fuserke opened 1 year ago
I had the same issue. This issue occurs due to change of items table, column complexity_level from default null to not null default -1. Unfortunately, some items may have already contain the null value and this cause to crash the script.
Such error in apache's errorlog will appear:
PHP Fatal error: Uncaught mysqli_sql_exception: Invalid use of NULL value in /home/www/TeamPass-3.0.0.20/install/upgrade_run_3.0.0.php:1212\nStack trace:\n#0 /home/www/TeamPass-3.0.0.20/install/upgrade_run_3.0.0.php(1212): mysqli_query()\n#1 {main}\n thrown in /home/www/TeamPass-3.0.0.20/install/upgrade_run_3.0.0.php on line 1212, referer: https://teampass.host/install/upgrade.php
Proposed solution To fix this, You have to add to upgrade_run_3.0.0.php file following lines starting at line 1209:
mysqli_query(
$db_link,
"UPDATE " . $pre . "items
SET complexity_level
='-1' WHERE complexity_level
IS NULL;"
);
After this, upgrade will go through smoothly.
Good luck!
@Martinezio I've added the lines in the upgrade_run_3.0.0.php but i still have the same behaviour that i do not go through the first step. Give uid and pw and then the ajax keeps on running. When i rename the tp.config file it goes through but that's not how the upgrade should work
Hi all
Found why it was hanging on the first step. Seems that the tp.config.php was in encoding utf8-BOM instead of utf8. Changed the encoding and it is passing. But now it is stuck in the database updates step: 09:11:33 - upgrade_run_3.0.0.php - Loop #1 is now running ... Already there for a good amount of time. There are not that many items in the database.
gr
Just try on bare V2 database, that wasn't touched by upgrade script. When You re-try on the same database, that was already tried to upgrade, then You will have crashes of upgrade script due to existing keys or columns, that was done with previous attempt.
Restore database from last backup and it should be fine.
Good luck!
pon., 24 paź 2022, 08:07 użytkownik fuserke @.***> napisał:
@Martinezio https://github.com/Martinezio I've added the lines in the upgrade_run_3.0.0.php but i still have the same behaviour that i do not go through the first step. Give uid and pw and then the ajax keeps on running. When i rename the tp.config file it goes through but that's not how the upgrade should work
— Reply to this email directly, view it on GitHub https://github.com/nilsteampassnet/TeamPass/issues/3375#issuecomment-1288464306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR33PNABCI6LFRJYOKTEZ5DWEYRTRANCNFSM6AAAAAARIEQ5DE . You are receiving this because you were mentioned.Message ID: @.***>
@Martinezio Yes i did that and all went through. Now everything is working except that it says: Personal Salt Key is incorrect. Thing is that i still have my V2 running and tried with the same salt key and there it is working like a charm. So i'm trying to find out why it is happening. Seems that there is already an issue logged for that but no solution other then keeping a V2 running next to a V3 and manually migrating. Which i cannot do cause i have a lot of users with a lot of private pw's
I had this same issue going from a 2.1.27xx version. In my case it was getting stuck on the upgrade step in the upgrade script: MODIFY COLUMN pw_len INT(5) NOT NULL DEFAULT 0
Inside the database I queried this column and had half the values as null and half as zero. So I simply updated all the values to zero as the modify column is trying to do and it fixed the error. Just run all of them manually and find out which one yours is bombing out on and fix the null values in it to what the modify column is trying to do. For you non sql people this was the query I ran:
update teampass_items set pw_len=0 where pw_len is null