Closed xavier8854 closed 2 months ago
Ended with a clean reinstall
Hello Xavier, I have the same problem. How did you reinstall keeping all configuration and DB?
Thanks
Hi, Unfortunately, I didn't, reinstalled from scratch 3.0.10, and reimported CSV
How did you export all the passwords?
In version 2.X, there were afaik, no export function, so I copy/pasted them from Teampass 2.X to a CSV.
I just solved the problem.
searching in Teampass/install/upgrade_operations.php.
function populateItemsTable_CreatedAt($pre, $post_nb)
{
global $db_link;
// loop on items - created_at
$items = mysqli_query(
$db_link,
"select i.id as id, ls.date as datetime
from " . $pre . "items
as i
inner join " . $pre . "log_items
as ls on ls.id_item = i.id
WHERE ls.action = 'at_creation' AND i.created_at IS NULL
LIMIT " . $post_nb.";"
);
while ($item = mysqli_fetch_assoc($items)) {
if (empty((string) $item['datetime']) === false && is_null($item['datetime']) === false) {
// update created_at field
mysqli_query(
$db_link,
"UPDATE " . $pre . "items
SET created_at = '".$item['datetime']."' WHERE id = ".$item['id']
);
}
}
// Is it finished?
$remainingItems = mysqli_num_rows(
mysqli_query(
$db_link,
"SELECT * FROM `" . $pre . "items` WHERE created_at IS NULL"
)
);
return $remainingItems > 0 ? 0 : 1;
This function looks for elements that do not have a creation date in the teampass_items table to paste the data from the log_items table.
After modifying them, checks that there are no objects in the "items" table that have "created_at" as Null.
But no query checks for "ls.date" in "log_items".
Manually updating all the dates in my database on the "items" table, and launching that last query "SELECT * FROM " . $pre . "items
WHERE created_at IS NULL".
I have seen that I still found 2 items created which did not have a date, but at the same time, the first script that joins the values of both tables, did NOT find these items.
I don't know why but I had two passwords created with no creation date set.
The problem is that the script does not consider that this could happen, since in the first query it does not look for NULL values in ls.date in the "log_items" table.
I hope to help @nilsteampassnet in future versions or someone who needs it.
Steps to reproduce
Expected behaviour
Smooth upgrade
Actual behaviour
Stuck in "Performing operation populateitems Table_CreatedAt Loop # 8950" and counting
Server configuration
Operating system: RHEL 9 Web server: Apache 2.4.57 Database: MariaDB 10.11.7 PHP version: 8.1.27 Teampass version: 3.0.10 -> 3.1.1 Teampass configuration file:
Updated from an older Teampass or fresh install: Update from 3.0.10 to 3.1.1
Client configuration
Browser: Fierfox or CHrome Operating system: Ubuntu 23.10
Logs
Web server error log