nilsteampassnet / TeamPass

Collaborative Passwords Manager
https://www.teampass.net
1.63k stars 532 forks source link

Can't upgrade, can't get past first screen #4107

Open Cheechy opened 3 months ago

Cheechy commented 3 months ago

Any help, most welcomed.

Steps to reproduce

  1. Install Debian Bookworm, mysql Ver 8.0.36, php PHP 8.1.2-1ubuntu2.14 + required modules
  2. Grab latest copy (or previous ones) of teampass
  3. Follow upgrade procedure, ie copying over a few files like settings.php, tp.conf + others.
  4. create a db, then mysqldump teampass.sql into new db

Expected behaviour

Go to the upgrade.php page, enter admin user + pass, go to next screen of checks.

Actual behaviour

A yellow bar appears and nothing else. It doesn't matter what password is typed, there seems to be an issue checking it/reporting an error. ie: image

Server configuration

Operating system: Debian bookworm/sid Web server: Server version: Apache/2.4.52 (Ubuntu) Server built: 2023-10-26T13:44:44

Database: Ver 8.0.36 for Linux on x86_64 (MySQL Community Server - GPL) PHP version: PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2-1ubuntu2.14, Copyright (c), by Zend Technologies

Teampass version: This is running with the latest 3.1.2. This is the same for 3.1.1. 3.1.0 and earlier versions Teampass configuration file:

Updated from an older Teampass or fresh install: PLEASE attach to this issue the file /includes/config/tp.config.php. tp.txt

Client configuration

Browser:

Operating system:

Logs

Web server error log

Nothing is inserted on this occasion into the error.log

Log from the web-browser developer console (CTRL + SHIFT + i)

{ "error": "Impossible to get connected to server. Ensure that file includes/config/settings.php exists and is correct.", "index": "" }

my settings.php (Which should have correct rights and have tried chmod 777)

<?php
// DATABASE connexion parameters
define("DB_HOST", "localhost");
define("DB_USER", "teampass_admin");
define("DB_PASSWD", "xxxx");
define("DB_NAME", "teampass_old");
define("DB_PREFIX", "teampass_");
define("DB_PORT", "3306");
define("DB_ENCODING", "utf8");
define("DB_SSL", array(
    "key" => "",
    "cert" => "",
    "ca_cert" => "",
    "ca_path" => "",
    "cipher" => ""
));
define("DB_CONNECT_OPTIONS", array(
    MYSQLI_OPT_CONNECT_TIMEOUT => 10
));
define("SECUREPATH", "/var/www/teampass/includes");
define("SECUREFILE", "teampass-seckey.txt");
define("IKEY", "");
define("SKEY", "");
define("HOST", "");

if (isset($session) === true && $session->has('system-timezone') && null !== $session->get('system-timezone')) {
            date_default_timezone_set($session->get('system-timezone'));
}
nilsteampassnet commented 3 months ago

@Cheechy THis error occurs when connection to DB fails. Check with a shell and command mysql -u USERNAME -h HOSTNAMEORIP DATABASENAME -p if you can connect to DB

Cheechy commented 3 months ago

@Cheechy THis error occurs when connection to DB fails. Check with a shell and command mysql -u USERNAME -h HOSTNAMEORIP DATABASENAME -p if you can connect to DB

root@xxxx02:/var/www/teampass/includes/config# mysql -uroot -p -hlocalhost teampass_old
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 437
Server version: 8.0.36 MySQL Community Server - GPL

Can you please advise a bit more on the lack of DB availability ? ie, This is very repeatable for myself. How do we progress past this ?

Is there a specific user that is being used? If said user is only the teampass_admin user (with details from settings.php), is it possible to set a new password if the old one is not known? (Ie, do we set a new password in mysql for teampass_admin and can we write the new password in plain text in the settings.php or how do we do this ?)

*This DB has been dumped from mysql 5.6 server and imported to a new mysql 8.1 server

Cheechy commented 3 months ago

Did not mean to mark as closed

Cheechy commented 3 months ago

Any tips to resolve this issue ?

nilsteampassnet commented 3 months ago

@Cheechy

My proposal was : Check with a shell and command mysql -u USERNAME -h HOSTNAMEORIP DATABASENAME -p if you can connect to DB

In your settings.php file, I can read define("DB_USER", "teampass_admin"); and in your command root@xxxx02:/var/www/teampass/includes/config# mysql -uroot -p -hlocalhost teampass_old

users are not the same