TeamPass icon indicating copy to clipboard operation
TeamPass copied to clipboard

Upgrade to 3.0.0.10 - Unable to login to Teampass with any user

Open andyh1493 opened this issue 3 years ago • 6 comments

Steps to reproduce

  1. Upgrade from Upgrading from 2.1.27.36
  2. Upgrade completes
  3. Unable to login to teampass

Expected behaviour

I should be able to login with the admin user at least

Actual behaviour

URL directs to https://{TeampassURL}/index.php?page=admin the redirects back to login page

Server configuration

Ubuntu 18.04.6 LTS:

Web server: Apache/2.4.29

Database: 10.1.48-MariaDB-0ubuntu0.18.04.1

PHP version: PHP 7.2.34-28+ubuntu18.04.1+deb.sury.org+1

Teampass version: 3.0.0.10

Teampass configuration file:

'10', 'enable_favourites' => '1', 'show_last_items' => '1', 'enable_pf_feature' => '1', 'log_connections' => '0', 'log_accessed' => '1', 'time_format' => 'H:i:s', 'date_format' => 'd/m/y', 'duplicate_folder' => '0', 'item_duplicate_in_same_folder' => '0', 'duplicate_item' => '0', 'number_of_used_pw' => '3', 'manager_edit' => '1', 'cpassman_dir' => '/var/www/html/teampass', 'cpassman_url' => 'https://{TeampassURL}', 'favicon' => 'https://{TeampassURL}/favicon.ico', 'path_to_upload_folder' => '/var/www/html/teampass/upload', 'url_to_upload_folder' => 'https://{TeampassURL}/upload', 'path_to_files_folder' => '/var/www/html/teampass/files', 'url_to_files_folder' => 'https://{TeampassURL}/files', 'activate_expiration' => '0', 'pw_life_duration' => '60', 'maintenance_mode' => '0', 'enable_sts' => '0', 'encryptClientServer' => '1', 'cpassman_version' => '3.0.0.10', 'ldap_mode' => '0', 'ldap_type' => '0', 'ldap_suffix' => '0', 'ldap_domain_dn' => '0', 'ldap_domain_controler' => '0', 'ldap_user_attribute' => '0', 'ldap_ssl' => '0', 'ldap_tls' => '0', 'ldap_elusers' => '0', 'ldap_search_base' => '0', 'ldap_port' => '389', 'richtext' => '0', 'allow_print' => '1', 'roles_allowed_to_print' => '["1"]', 'show_description' => '1', 'anyone_can_modify' => '1', 'anyone_can_modify_bydefault' => '1', 'nb_bad_authentication' => '10', 'utf8_enabled' => '1', 'restricted_to' => '1', 'restricted_to_roles' => '1', 'enable_send_email_on_user_login' => '0', 'enable_user_can_create_folders' => '1', 'insert_manual_entry_item_history' => '0', 'enable_kb' => '1', 'enable_email_notification_on_item_shown' => '0', 'enable_email_notification_on_user_pw_change' => '0', 'custom_logo' => '', 'custom_login_text' => '', 'default_language' => 'english', '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' => '1539431342', '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' => '31', 'email_smtp_server' => 'relay.hogarthww.com', 'email_smtp_auth' => '', 'email_auth_username' => '', 'email_auth_pwd' => '', 'email_port' => '25', 'email_security' => '', 'email_server_url' => '', 'email_from' => '[email protected]', 'email_from_name' => 'Teampass', 'pwd_maximum_length' => '256', 'google_authentication' => '0', 'delay_item_edition' => '0', 'allow_import' => '1', 'proxy_ip' => '', 'proxy_port' => '', 'upload_maxfilesize' => '20mb', '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' => '0', 'upload_imageresize_width' => '800', 'upload_imageresize_height' => '600', 'upload_imageresize_quality' => '100', 'use_md5_password_as_salt' => '0', 'ga_website_name' => 'TeamPass for ChangeMe', 'api' => '0', 'subfolder_rights_as_parent' => '1', 'show_only_accessible_folders' => '0', 'enable_suggestion' => '0', 'otv_expiration_period' => '7', 'default_session_expiration_time' => '60', 'duo' => '0', 'enable_server_password_change' => '0', 'ldap_object_class' => '0', 'bck_script_path' => '/var/www/html/teampass/backups', 'bck_script_filename' => 'bck_teampass', 'syslog_enable' => '0', 'syslog_host' => 'localhost', 'syslog_port' => '514', 'manager_move_item' => '1', 'create_item_without_password' => '0', 'otv_is_enabled' => '1', 'agses_authentication_enabled' => '0', 'item_extra_fields' => '0', 'saltkey_ante_2127' => 'none', 'migration_to_2127' => 'done', 'files_with_defuse' => 'done', 'timezone' => 'UTC', 'enable_attachment_encryption' => '1', 'personal_saltkey_security_level' => '50', 'ldap_new_user_is_administrated_by' => '0', 'disable_show_forgot_pwd_link' => '0', 'offline_key_level' => '90', 'enable_http_request_login' => '0', 'ldap_and_local_authentication' => '0', 'secure_display_image' => '0', 'upload_zero_byte_file' => '0', 'upload_all_extensions_file' => '0', 'bck_script_passkey' => 't5KUnckUVFMTRvVwYb3HTPtnYRRvgQ3PW5cTQ7qz', 'admin_2fa_required' => '0', 'can_create_root_folder' => '0', 'copy_to_clipboard_small_icons' => '1', 'teampass_version' => '2.1.27', 'password_overview_delay' => '4', 'roles_allowed_to_print_select' => '', 'clipboard_life_duration' => '30', 'mfa_for_roles' => '', 'tree_counters' => '0', 'settings_offline_mode' => '0', 'settings_tree_counters' => '0', 'enable_massive_move_delete' => '0', ); **Updated from an older Teampass or fresh install:** PLEASE attach to this issue the file `/includes/config/tp.config.php`. ### Client configuration **Browser:** Firefox & Safari **Operating system:** MacOS 12.0.1 ### Logs #### Web server error log ``` Insert your webserver log here [Mon Feb 28 19:05:20.002138 2022] [mpm_prefork:notice] [pid 50977] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1b configured -- resuming normal operations [Mon Feb 28 19:05:20.002517 2022] [core:notice] [pid 50977] AH00094: Command line: '/usr/sbin/apache2' [Mon Feb 28 19:05:26.839641 2022] [php7:warn] [pid 50981] [client 10.252.72.211:54402] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php?page=items [Mon Feb 28 19:05:36.280077 2022] [php7:warn] [pid 50981] [client 10.252.72.211:54402] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php [Mon Feb 28 19:05:39.011661 2022] [php7:warn] [pid 50993] [client 10.252.72.211:54441] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php?page=admin [Mon Feb 28 19:06:55.960253 2022] [mpm_prefork:notice] [pid 50977] AH00169: caught SIGTERM, shutting down [Mon Feb 28 19:06:58.625010 2022] [mpm_prefork:notice] [pid 51084] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1b configured -- resuming normal operations [Mon Feb 28 19:06:58.625069 2022] [core:notice] [pid 51084] AH00094: Command line: '/usr/sbin/apache2' [Mon Feb 28 19:07:05.296645 2022] [php7:notice] [pid 51088] [client 10.252.72.211:54786] PHP Notice: Undefined variable: languagesList in /var/www/html/teampass/index.php on line 183, referer: https://{TeampassURL}/index.php?page=admin [Mon Feb 28 19:07:05.296753 2022] [php7:error] [pid 51088] [client 10.252.72.211:54786] PHP Fatal error: Uncaught TypeError: in_array() expects parameter 2 to be array, null given in /var/www/html/teampass/index.php:183\nStack trace:\n#0 /var/www/html/teampass/index.php(183): in_array()\n#1 {main}\n thrown in /var/www/html/teampass/index.php on line 183, referer: https://{TeampassURL}/index.php?page=admin [Mon Feb 28 19:07:17.113457 2022] [mpm_prefork:notice] [pid 51084] AH00169: caught SIGTERM, shutting down [Mon Feb 28 19:07:19.528772 2022] [mpm_prefork:notice] [pid 51139] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1b configured -- resuming normal operations [Mon Feb 28 19:07:19.529619 2022] [core:notice] [pid 51139] AH00094: Command line: '/usr/sbin/apache2' [Mon Feb 28 19:07:32.915363 2022] [php7:warn] [pid 51144] [client 10.252.72.211:54879] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php?page=admin [Mon Feb 28 19:07:40.358973 2022] [php7:warn] [pid 51146] [client 10.252.72.211:54888] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php [Mon Feb 28 19:07:43.536262 2022] [php7:warn] [pid 51146] [client 10.252.72.211:54888] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php?page=admin [Mon Feb 28 19:13:03.395245 2022] [php7:warn] [pid 51162] [client 10.252.72.211:56015] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php [Mon Feb 28 19:13:06.074099 2022] [php7:warn] [pid 51148] [client 10.252.72.211:56031] PHP Warning: A non-numeric value encountered in /var/www/html/teampass/sources/core.php on line 562, referer: https://{TeampassURL}/index.php?page=admin #### Log from the web-browser developer console (CTRL + SHIFT + i) ``` Insert the log here and especially the answer of the query that failed. ```

andyh1493 avatar Feb 28 '22 19:02 andyh1493

Hi everyone !

Same for us. I also tried to upgrade from 2.1.27.36 to 3.0.0.12 but it doesn't help much

BboivinFOCSS avatar Mar 03 '22 14:03 BboivinFOCSS

@andyh1493 Can you please perform new upgrade with latest version? I don't understand what happen during upgrade as minimum requested PHP version is 7.4, and I can see you are using 7.2.

@BboivinFOCSS, can you share your cinfig file too please?

nilsteampassnet avatar Mar 12 '22 08:03 nilsteampassnet

Hi @nilsteampassnet

I have tried with the latest build and still the same issue occurs. I had PHP 7.2 & 7.4 installed side by side, however php7.4 was being used with apache. I have since removed php 7.2 so that's out of the question now. In regards to config file, is that the settings.php file?

Thanks Andy

andyh1493 avatar Mar 14 '22 12:03 andyh1493

Hi, After the update from 2 to 3, I had to change a couple of lines in core.php to login :

            //$_SESSION['numDaysBeforePwExpiration'] = $SETTINGS['pw_life_duration'] - round(
            //    (mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')) - $_SESSION['last_pw_change']) / (24 * 60 * 60)
            $_SESSION['numDaysBeforePwExpiration'] = 10;
            //);

I know it's not the fine way to do it, but i'm not a php dev. php-fpm 7.4.29 here on almalinux. Cheers Mathieu

migirp avatar May 02 '22 12:05 migirp

Hi, Mathieu. I can confirm Your change works - I wasn't able to login as well after upgrade from v2 to latest v3. Changing this line allows me to login as admin. Thank You! OS: Debian Buster (10.12) PHP: 7.4.29 from Sury's repo

Martinezio avatar May 12 '22 08:05 Martinezio

Thanks Mathieu, That fix also allowed me to login successfully after upgrading

Thanks Andy

AndyH010493 avatar Jun 04 '22 09:06 AndyH010493

@Martinezio this resolved the logins for me as well! thanks! @nilsteampassnet can this be looked into?

zieba88 avatar Dec 19 '22 16:12 zieba88

This only happens when "Logon passwords expire after xx days (0 to disable)" is not 0/disabled

alarido avatar Jan 15 '23 20:01 alarido