nilsteampassnet / TeamPass

Collaborative Passwords Manager
https://www.teampass.net
1.66k stars 542 forks source link

Failed to upgrade branch2 (2.1.27.36) to branch3 (3.0.0.21) #3465

Open c-le opened 1 year ago

c-le commented 1 year ago

Hello, I'm trying to upgrade branch2 (2.1.27.36) to branch3 (3.0.0.21) with the documentation I'm stuck in the first step with admin login with a loop wheel.

Server configuration

Operating system: Debian 11

Web server: apache2

Database: mariadb

PHP version: php8.2

Teampass version: 3.0.0.21

Teampass configuration file:

<?php
// DATABASE connexion parameters
define("DB_HOST", "localhost");
define("DB_USER", "user_teampass");
define("DB_PASSWD", "user_password");
define("DB_NAME", "db_teampass");
define("DB_PREFIX", "teampass_");
define("DB_PORT", "3306");
define("DB_ENCODING", "");
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/html/teampass/includes");
define("IKEY", "");
define("SKEY", "");
define("HOST", "");

if (isset($_SESSION['settings']['timezone']) === true) {
    date_default_timezone_set($_SESSION['settings']['timezone']);
}

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

<?php
global $SETTINGS;
$SETTINGS = array (
    'max_latest_items' => '10',
    'enable_favourites' => '1',
    'show_last_items' => '1',
    'enable_pf_feature' => '1',
    'log_connections' => '1',
    'log_accessed' => '1',
    'time_format' => 'H:i:s',
    'date_format' => 'd/m/Y',
    'duplicate_folder' => '1',
    'item_duplicate_in_same_folder' => '0',
    'duplicate_item' => '1',
    'number_of_used_pw' => '3',
    'manager_edit' => '1',
    'cpassman_dir' => '/var/www/html/teampass',
    'cpassman_url' => 'https://fqdn.fr',
    'favicon' => 'https://fqdn.fr/favicon.ico',
    'path_to_upload_folder' => '/var/www/html/teampass/upload',
    'url_to_upload_folder' => 'https://fqdn.fr/upload',
    'path_to_files_folder' => '/var/www/html/teampass/files',
    'url_to_files_folder' => 'https://fqdn.fr/files',
    'activate_expiration' => '0',
    'pw_life_duration' => '0',
    'maintenance_mode' => '0',
    'enable_sts' => '1',
    'encryptClientServer' => '1',
    'cpassman_version' => '2.1.27',
    'ldap_mode' => '1',
    'ldap_type' => 'posix-search',
    'ldap_suffix' => 'dc=granderegion,dc=fr',
    'ldap_domain_dn' => 'domain_dn',
    'ldap_domain_controler' => 'ip_address',
    'ldap_user_attribute' => 'suer_login',
    'ldap_ssl' => '0',
    'ldap_tls' => '0',
    'ldap_elusers' => '0',
    'ldap_search_base' => 'search_base,
    'ldap_port' => '389',
    'richtext' => '0',
    'allow_print' => '1',
    'roles_allowed_to_print' => '4',
    'show_description' => '1',
    'anyone_can_modify' => '0',
    'anyone_can_modify_bydefault' => '0',
    'nb_bad_authentication' => '0',
    'utf8_enabled' => '1',
    'restricted_to' => '0',
    'restricted_to_roles' => '0',
    'enable_send_email_on_user_login' => '0',
    'enable_user_can_create_folders' => '1',
    'insert_manual_entry_item_history' => '0',
    'enable_kb' => '0',
    'enable_email_notification_on_item_shown' => '0',
    'enable_email_notification_on_user_pw_change' => '0',
    'custom_logo' => '',
    'custom_login_text' => '',
    'default_language' => 'french',
    'send_stats' => '0',
    'send_statistics_items' => 'stat_country;stat_users;stat_items;stat_items_shared;stat_folders;stat_folders_shared;stat_admins;stat_managers;stat_ro;stat_mysqlversion;stat_phpversion;stat_teampassversion;stat_languages;stat_kb;stat_suggestion;stat_customfields;stat_api;stat_2fa;stat_agses;stat_duo;stat_ldap;stat_syslog;stat_stricthttps;stat_fav;stat_pf;',
    'send_stats_time' => '1529337454',
    'get_tp_info' => '1',
    'send_mail_on_user_login' => '0',
    'nb_items_by_query' => 'auto',
    'enable_delete_after_consultation' => '0',
    'enable_personal_saltkey_cookie' => '0',
    'personal_saltkey_cookie_duration' => '31G',
    'email_smtp_server' => 'mx01.fqdn.fr',
    'email_smtp_auth' => '0',
    'email_auth_username' => '',
    'email_auth_pwd' => '',
    'email_port' => '25',
    'email_security' => 'none',
    'email_server_url' => '',
    'email_from' => 'teampass@fqdn.fr',
    'email_from_name' => 'TeamPass',
    'pwd_maximum_length' => '40',
    'google_authentication' => '0',
    'delay_item_edition' => '0',
    'allow_import' => '1',
    'proxy_ip' => '',
    'proxy_port' => '',
    'upload_maxfilesize' => '2mb',
    'upload_docext' => 'doc,docx,dotx,xls,xlsx,xltx,rtf,csv,txt,pdf,ppt,pptx,pot,dotx,xltx',
    'upload_imagesext' => 'jpg,jpeg,gif,png',
    'upload_pkgext' => '7z,rar,tar,zip',
    'upload_otherext' => 'sql,xml',
    'upload_imageresize_options' => '1',
    'upload_imageresize_width' => '800',
    'upload_imageresize_height' => '600',
    'upload_imageresize_quality' => '90',
    'use_md5_password_as_salt' => '0',
    'ga_website_name' => 'TeamPass',
    'api' => '1',
    'subfolder_rights_as_parent' => '1',
    'show_only_accessible_folders' => '1',
    'enable_suggestion' => '0',
    'otv_expiration_period' => '7',
    'default_session_expiration_time' => '30',
    'duo' => '0',
    'enable_server_password_change' => '0',
    'ldap_object_class' => 'person',
    'bck_script_path' => '/var/www/html/teampass/backups',
    'bck_script_filename' => 'bck_teampass',
    'syslog_enable' => '1',
    'syslog_host' => 'localhost',
    'syslog_port' => '514',
    'manager_move_item' => '0',
    'create_item_without_password' => '1',
    'otv_is_enabled' => '0',
    'agses_authentication_enabled' => '0',
    'item_extra_fields' => '0',
    'saltkey_ante_2127' => 'none',
    'migration_to_2127' => 'done',
    'files_with_defuse' => 'done',
    'timezone' => 'Europe/Paris',
    'enable_attachment_encryption' => '1',
    'personal_saltkey_security_level' => '25',
    'ldap_new_user_is_administrated_by' => '0',
    'disable_show_forgot_pwd_link' => '1',
    'offline_key_level' => '0',
    'enable_http_request_login' => '0',
    'ldap_and_local_authentication' => '1',
    'secure_display_image' => '1',
    'upload_zero_byte_file' => '0',
    'upload_all_extensions_file' => '0',
    'bck_script_passkey' => 'script_passkey'',
    'bck_script_key' => '',
    'yubico_authentication' => '0',
    'ga_reset_by_user' => '1',
    'ldap_bind_passwd' => 'bind_password',
    'ldap_bind_dn' => 'bin_dn',
    'ldap_usergroup' => '0',
    'ldap_new_user_role' => '',
    'tree_counters' => '1',
    'teampass_version' => '2.1.27',
    'settings_offline_mode' => '0',
    'admin_2fa_required' => '1',

Client configuration

Browser: Chrome

Operating system: MacOS Ventura

Logs

Web server error log

[Fri Jan 06 14:45:26.645912 2023] [php:error] [pid 80325] [client 10.0.190.2:51879] PHP Fatal error:  Uncaught Defuse\\Crypto\\Exception\\BadFormatException: Encoded data is shorter than expected. in /var/www/html/teampass/includes/libraries/Encryption/Encryption/Encoding.php:225\nStack trace:\n#0 /var/www/html/teampass/includes/libraries/Encryption/Encryption/Key.php(49): Defuse\\Crypto\\Encoding::loadBytesFromChecksummedAsciiSafeString()\n#1 /var/www/html/teampass/install/tp.functions.php(44): Defuse\\Crypto\\Key::loadFromAsciiSafeString()\n#2 /var/www/html/teampass/install/tp.functions.php(81): defuseCryption()\n#3 /var/www/html/teampass/install/upgrade_ajax.php(225): defuse_return_decrypted()\n#4 {main}\n  thrown in /var/www/html/teampass/includes/libraries/Encryption/Encryption/Encoding.php on line 225, referer: https://fqdn.fr/install/upgrade.php

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

jquery.min.js:2          Failed to load resource: the server responded with a status of 500 (Internal Server Error)
send @ jquery.min.js:2
upgrade.php:1 Uncaught SyntaxError: Unexpected end of JSON input
    at Function.parse [as parseJSON] (<anonymous>)
    at Object.complete (upgrade.php:216:26)
    at c (jquery.min.js:2:28327)
    at Object.fireWith (jquery.min.js:2:29072)
    at l (jquery.min.js:2:80029)
    at XMLHttpRequest.<anonymous> (jquery.min.js:2:82355)
    at Object.send (jquery.min.js:2:82714)
    at Function.ajax (jquery.min.js:2:78291)
    at HTMLInputElement.<anonymous> (upgrade.php:208:18)
    at HTMLInputElement.dispatch (jquery.min.js:2:43064)
jquery.min.js:2          POST https://fqdn.fr/install/upgrade_ajax.php 500 (Internal Server Error)
send @ jquery.min.js:2
ajax @ jquery.min.js:2
(anonymous) @ upgrade.php:208
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
VM17:1 Uncaught SyntaxError: Unexpected end of JSON input
    at Function.parse [as parseJSON] (<anonymous>)
    at Object.complete (upgrade.php:216:26)
    at c (jquery.min.js:2:28327)
    at Object.fireWith (jquery.min.js:2:29072)
    at l (jquery.min.js:2:80029)
    at XMLHttpRequest.<anonymous> (jquery.min.js:2:82355)
    at Object.send (jquery.min.js:2:82714)
    at Function.ajax (jquery.min.js:2:78291)
    at HTMLInputElement.<anonymous> (upgrade.php:208:18)
    at HTMLInputElement.dispatch (jquery.min.js:2:43064)
eerimias commented 1 year ago

Hi

I have had exactly the same error. Something happens that ajax returns an empty response, but I can't detect why.

My workaround:

Don't waste time because seems a server problem (any unknown weird change...)

I hope I help you.

Regards

marekzima commented 1 year ago

The file 'teampass-seckey.txt' from ./includes has to be copied to new 3.0 folder as well! Otherwise the upgrade will not run. (You see turning wheel but nothing is really done.)

antoweb commented 1 year ago

same problem here