Skip to content
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

Fresh Install failing. #4479

Closed
hitenmandalia opened this issue Nov 21, 2024 · 10 comments
Closed

Fresh Install failing. #4479

hitenmandalia opened this issue Nov 21, 2024 · 10 comments

Comments

@hitenmandalia
Copy link

hitenmandalia commented Nov 21, 2024

Steps to reproduce

  1. Attempt to install fresh

Expected behaviour

Should be able to pass the check screen

Actual behaviour

Nothing happens on screen. Errors shown

Server configuration

Operating system: Alpine Linux

Web server: Nginx

Database: MySQL 8

PHP version: 8.1

Teampass version:

Teampass configuration file:

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

Install never goes past the Checks screen:

image
image

2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "NOTICE: PHP message: PHP Notice: file_get_contents(): Read of 12288 bytes failed with errno=21 Is a directory in /var/www/html/vendor/teampassclasses/sessionmanager/src/SessionManager.php on line 44" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "NOTICE: PHP message: PHP Stack trace:" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "NOTICE: PHP message: PHP 1. {main}() /var/www/html/install/install.queries.php:0" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "NOTICE: PHP message: PHP 2. require_once() /var/www/html/install/install.queries.php:57" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "NOTICE: PHP message: PHP 3. TeampassClasses\SessionManager\SessionManager::getSession() /var/www/html/sources/main.functions.php:62" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "NOTICE: PHP message: PHP 4. file_get_contents($filename = '/') /var/www/html/vendor/teampassclasses/sessionmanager/src/SessionManager.php:44" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught Defuse\Crypto\Exception\BadFormatException: Encoded data is shorter than expected. in /var/www/html/vendor/defuse/php-encryption/src/Encoding.php:233" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "Stack trace:" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "#0 /var/www/html/vendor/defuse/php-encryption/src/Key.php(53): Defuse\Crypto\Encoding::loadBytesFromChecksummedAsciiSafeString('\xDE\xF0\x00\x00', Object(SensitiveParameterValue))" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "#1 /var/www/html/vendor/teampassclasses/sessionmanager/src/SessionManager.php(44): Defuse\Crypto\Key::loadFromAsciiSafeString(Object(SensitiveParameterValue))" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "#2 /var/www/html/sources/main.functions.php(62): TeampassClasses\SessionManager\SessionManager::getSession()" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "#3 /var/www/html/install/install.queries.php(57): require_once('/var/www/html/s...')" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: "#4 {main}" 2024-11-21 15:53:18 [21-Nov-2024 15:53:18] WARNING: [pool www] child 61 said into stderr: " thrown in /var/www/html/vendor/defuse/php-encryption/src/Encoding.php on line 233" 2024-11-21 15:53:18 172.17.0.1 - - [21/Nov/2024:15:53:18 +0000] "POST /install/install.queries.php HTTP/1.1" 500 5 "https://xxx.xxx.xxx/install/install.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"


@corentin-soriano
Copy link
Contributor

Can you give us the result of (where teampass_ is your table prefix):

SHOW CREATE TABLE teampass_misc;

This will probably fix your issue (can give you sql error if duplicate column):

ALTER TABLE teampass_misc ADD COLUMN created_at VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE teampass_misc ADD COLUMN updated_at VARCHAR(255) NULL DEFAULT NULL;

Can you restart the update process first (install/upgrade.php)? It should add all missing columns.

@hitenmandalia
Copy link
Author

Hi @corentin-soriano
I dont get to the DB population stage of the install. It is a fresh DB and fresh container with the latest teampass from the master branch.

I cannot press next at this stage to enter the DB details.

@corentin-soriano
Copy link
Contributor

Sorry, I was wrong, this post was for another issue.

@nilsteampassnet I think this is related to the session encryption because SECUREPATH and SECUREFILE are not defined at this point of install process.
I think we should disable encryption during initial installation or create these files earlier (and declare the constants).

@hitenmandalia
Copy link
Author

thank you @corentin-soriano

@stanislavefremov
Copy link

Agree with @corentin-soriano. I also had to manually create SECUREFILE, populate it with a key string and set up SECUREPATH and SECUREFILE variables in the config. Then the installation went through.

@hitenmandalia
Copy link
Author

@stanislavefremov could you possibly guide me on how you did this? Where did you create the files, how did you determine what variables to user etc?

@stanislavefremov
Copy link

@hitenmandalia I am not sure it's a best way to solve the issue, it's rather a workaround for me and at least it worked. The issue I noticed that even during the fresh install the system is using Sessions and Sessions in turn require secure folder and secure key to exist, though they normally are created later by the install process. So:

  1. Generate a seckey. It should look something like this: def00000e7753e0d155cc5a7d5979b09d6f3f68f499b401abf42c9006dca7da82d62e46331803c7bc253f11fa3632f5fa7172766203fb172f6d759780bd683b5bc68b16d
    I used the same packed which is used in Teampass, it's https://packagist.org/packages/defuse/php-encryption. Something like this:
    use Defuse\Crypto\Key;
    $key = Key::createNewRandomKey();
    $new_salt = $key->saveToAsciiSafeString();
    But you can use other generators, even find something online.
  2. Create the secure folder and secure file. In my case I created 'sk' directory in the project root of /var/www/html and a file called teampass-seckey.txt inside the sk folder.
  3. Put the generated seckey to the teampass-seckey.txt file.
  4. Open includes/config/settings.php config file or just copy it from settings.sample.php, and change 2 constants like that:
    define("SECUREPATH", "/var/www/html/sk");
    define("SECUREFILE", "teampass-seckey.txt");
  5. Go back to the installation process and restart it.
    After that the installation should proceed further.
    Just in case, save the seckey. Though the installer will generate another key and replace your settings.php file with new data. At this point you should backup your sk folder and maybe settings.php.

@hitenmandalia
Copy link
Author

@stanislavefremov thank you for taking the time to write this up. I will give it a go.

@nilsteampassnet
Copy link
Owner

@hitenmandalia
Please update using branch master.
A fiw has been committed.

@hitenmandalia
Copy link
Author

Hi @nilsteampassnet

Thank you. I am now able to complete the full install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants