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

Errors when upgrading to version 3.x .. #2990

Open
michaldejmek opened this issue Dec 14, 2021 · 21 comments
Open

Errors when upgrading to version 3.x .. #2990

michaldejmek opened this issue Dec 14, 2021 · 21 comments

Comments

@michaldejmek
Copy link

Only the wheel spins and nothing happens version 3.0.0.9.

20:44:20 - Now sending new users password by email ...
20:44:20 - All keys have been generated for users
Show/Hide list of users
20:44:20 - User xxx fully treated
20:44:19 - User xxx - All FILES keys generated
20:44:19 - User xxx - All SUGGESTIONS keys generated

@nilsteampassnet
Copy link
Owner

Could be nice to have a context ...

Is it during installation? upgrade?

@michaldejmek
Copy link
Author

It was version 3.0.0.8 and it was a running update .. so far version 3.0.0.9 is behaving the same way.

@michaldejmek
Copy link
Author

@nilsteampassnet The bug was posted x days ago ..too bad the bug hasn't been fixed - the same problem exists in version 3.0.0.10.

"POST /teampass/install/upgrade_run_3.0.0_users.php HTTP/1.1" 200 107 "http://192.168.10.10/teampass/install/upgrade.php"

Is there a DEBUG mod in the application?

@nilsteampassnet
Copy link
Owner

You can imagine that this has tested.
So if you are facing a problem then it can come from your environment that is not similar to mine
Please report the error from the console
See https://teampass.readthedocs.io/en/latest/faq/ paragraph How to capture query error from the browser console

@michaldejmek
Copy link
Author

Thank you for your response - I believe you are testing, but I would like to try to solve the problem somehow.

  • Is it possible to somehow turn off email sending ?
  • The application does not contact the smpt server at all! Log is clean :(

tp.config.php:
'email_smtp_server' => '192.168.10.12',
'email_smtp_auth' => '',
'email_auth_username' => '',
'email_auth_pwd' => '',
'email_port' => '25',
'email_security' => '',
'email_server_url' => '',
'email_from' => 'xxx@xx.xx',
'email_from_name' => 'TeamPass',

Browser:
image

@michaldejmek
Copy link
Author

@nilsteampassnet - Hopefully more information will help. If I then start the „upgrade" process again, it runs
without a problem, but users cannot log in.

php -v | PHP 7.4.26 (cli) (built: Nov 16 2021 15:31:30) ( NTS )
CentOS 8 Stream

PHP Fatal error: Uncaught TypeError: json_decode() expects parameter 1 to be string, null given in /var/www/html/teampass/sources/main.queries.php:886
Stack trace:
#0 /var/www/html/teampass/sources/main.queries.php(886): json_decode(NULL, true)
#1 /var/www/html/teampass/sources/main.queries.php(191): sendEmailsNotSent(Array)
#2 /var/www/html/teampass/sources/main.queries.php(74): mainQuery(Array)
#3 {main}
thrown in /var/www/html/teampass/sources/main.queries.php on line 886

PHP Notice: Undefined index: roles_allowed_to_print_select in /var/www/html/teampass/pages/options.php on line 711
PHP Stack trace:
[PHP 1. {main}() /var/www/html/teampass/index.php:0
PHP 2. include() /var/www/html/teampass/index.php:986
PHP Fatal error: Uncaught TypeError: json_decode() expects parameter 1 to be string, null given in /var/www/html/teampass/pages/options.php:711
Stack trace:
#0 /var/www/html/teampass/pages/options.php(711): json_decode(NULL, true)
#1 /var/www/html/teampass/index.php(986): include('/var/www/html/t...')
#2 {main}
thrown in /var/www/html/teampass/pages/options.php on line 711


If teampass only supports english, a change should also be made in the DB.

UPDATE teampass_users SET user_language = 0

If I change the "Full URL to TeamPass" it will not overwrite the DB or the file.

teampass/includes/config/tp.config.php and select * from teampass_misc

@michaldejmek
Copy link
Author

michaldejmek commented Jan 10, 2022

The second run:

12:26:48 - All steps have been successfully performed
12:26:48 - Users public / private keys were generated if needed
12:26:48 - upgrade_run_3.0.0_files.php - Loop
12:26:48 - upgrade_run_3.0.0_suggestions.php - Loop
12:26:48 - upgrade_run_3.0.0_fields.php - Loop
12:26:48 - upgrade_run_3.0.0_logs.php - Loop
12:26:43 - upgrade_run_3.0.0_logs.php - Loop
12:26:37 - upgrade_run_3.0.0_logs.php - Loop
12:26:32 - upgrade_run_3.0.0_logs.php - Loop
12:26:26 - upgrade_run_3.0.0_logs.php - Loop
12:26:21 - upgrade_run_3.0.0_logs.php - Loop
12:26:16 - upgrade_run_3.0.0_logs.php - Loop
12:26:10 - upgrade_run_3.0.0_logs.php - Loop
12:26:05 - upgrade_run_3.0.0_logs.php - Loop
12:26:00 - upgrade_run_3.0.0_logs.php - Loop
12:25:54 - upgrade_run_3.0.0_logs.php - Loop
12:25:49 - upgrade_run_3.0.0_logs.php - Loop
12:25:43 - upgrade_run_3.0.0_logs.php - Loop
12:25:38 - upgrade_run_3.0.0_logs.php - Loop
12:25:33 - upgrade_run_3.0.0_logs.php - Loop
12:25:27 - upgrade_run_3.0.0_logs.php - Loop
12:25:22 - upgrade_run_3.0.0_logs.php - Loop
12:25:22 - upgrade_run_3.0.0_passwords.php - Loop
12:25:22 - upgrade_run_3.0.0_passwords.php - Loop
12:25:22 - upgrade_run_3.0.0_passwords.php - Loop
12:25:22 - upgrade_run_3.0.0_passwords.php - Loop
12:25:22 - upgrade_run_3.0.0_passwords.php - Loo
12:25:22 - upgrade_run_3.0.0.php - Loop

@michaldejmek
Copy link
Author

@nilsteampassnet - Do you have an estimate of when it will be fixed? - Thank you ..

@michaldejmek
Copy link
Author

@nilsteampassnet - If there are special characters "š", "ž" and "ď" etc... in poly name and lastname .. then it ends on error " Now sending new users password by email ..."

@michaldejmek
Copy link
Author

An error appears after the update:

[13-Jan-2022 21:04:14 Europe/Prague] PHP Notice: Undefined index: user_id in /var/www/html/teampass/error.php on line 106
[13-Jan-2022 21:04:14 Europe/Prague] PHP Stack trace:
[13-Jan-2022 21:04:14 Europe/Prague] PHP 1. {main}() /var/www/html/teampass/sources/main.queries.php:0
[13-Jan-2022 21:04:14 Europe/Prague] PHP 2. include() /var/www/html/teampass/sources/main.queries.php:77
[13-Jan-2022 21:04:14 Europe/Prague] PHP Notice: Undefined index: user_id in /var/www/html/teampass/error.php on line 106
[13-Jan-2022 21:04:14 Europe/Prague] PHP Stack trace:
[13-Jan-2022 21:04:14 Europe/Prague] PHP 1. {main}() /var/www/html/teampass/sources/main.queries.php:0
[13-Jan-2022 21:04:14 Europe/Prague] PHP 2. include() /var/www/html/teampass/sources/main.queries.php:77

image

When logging in, an error occurs in the log and the site says "In progress".

error log
[13-Jan-2022 20:09:42 UTC] PHP Fatal error: Uncaught TypeError: base64_encode() expects parameter 1 to be string, bool given in /var/www/html/teampass/sources/main.functions.php:2539
Stack trace:
#0 /var/www/html/teampass/sources/main.functions.php(2539): base64_encode(false)
#1 /var/www/html/teampass/sources/identify.php(654): decryptPrivateKey('the user's password is displayed here', 'xJevXRAHzxgkvST...')
#2 /var/www/html/teampass/sources/identify.php(218): identifyUser('KwLI4AaH4GEVV+6...', Array)
#3 {main}
thrown in /var/www/html/teampass/sources/main.functions.php on line 2539

@michaldejmek michaldejmek changed the title Now sending new users password by email ... Errors when upgrading to version 3.x .. Jan 13, 2022
nilsteampassnet added a commit that referenced this issue Jan 14, 2022
Several fixes
#2998 - normal users could not auth after upgrade
#2990 - emails were not sent during upgrade process
@michaldejmek
Copy link
Author

I have tried the latest version 3.0.0.10 dated 14.1.2022 .. Everything is working fine now. In the tp.config.php file the parameter "'roles_allowed_to_print_select' => '0'," is missing. Without that, the settings -> options page doesn't work.

[14-Jan-2022 21:29:06 Europe/Prague] PHP Notice: Undefined index: roles_allowed_to_print_select in /var/www/html/teampass/pages/options.php on line 711
[14-Jan-2022 21:29:06 Europe/Prague] PHP Stack trace:
[14-Jan-2022 21:29:06 Europe/Prague] PHP 1. {main}() /var/www/html/teampass/index.php:0
[14-Jan-2022 21:29:06 Europe/Prague] PHP 2. include() /var/www/html/teampass/index.php:976
[14-Jan-2022 21:29:06 Europe/Prague] PHP Fatal error: Uncaught TypeError: json_decode() expects parameter 1 to be string, null given in /var/www/html/teampass/pages/options.php:711

@nilsteampassnet
Copy link
Owner

Thank you for the feedback 👍

Regarding the option not set, I must say that I don't understand why have this.
Indeed, after code review, I can see that
1- this option is added to DB if missing at step4 off upgrade
2- rebuild tp.options.php file at step5 of upgrade
I'm a bit confused here 😲

I will continue investigating

@michaldejmek
Copy link
Author

I have now reconnected to teampass and the entry is missing :( in the tp.config.php file. How can I check if the given value is really in the DB ..?

@michaldejmek
Copy link
Author

After the upgrade, the teampass_misc table is not modified correctly, a couple of entries are missing. Why do the new records have id = 0 ..? The fault is here: #3002

@michaldejmek
Copy link
Author

Please update the issue. Thank you.

@nilsteampassnet
Copy link
Owner

I'm totally lost in all those messages, sorry, nothing is clear for me.
Certainly my english.

@michaldejmek
Copy link
Author

The upgrade went fine :) After the upgrade, the teampass_misc table does not insert the paremters that the new version requires. If the values are missing, the settings in the app don't work at all.

The following values do not work in the settings.

  • Offline mode HTML export enabled
  • Show more counters in folder tree
  • Enable copy password icon on item list
  • Allow user to perform massive move and delete operations

There is no "roles_allowed_to_print_select" entry in the teampass_misc table. Without it, the settings -> options page doesn't work.

@nilsteampassnet
Copy link
Owner

Thank you, it is more clear now.
I have fixed the case of roles_allowed_to_print_select.

Regarding Offline mode HTML export enabled
Normal it is not implemented. I will disable it.

Regarding Show more counters in folder tree
if not set
image
If set
image

Regarding Enable copy password icon on item list
If not set
image
If set
image

Regarding Allow user to perform massive move and delete operations
if set
image

nilsteampassnet added a commit that referenced this issue Jan 25, 2022
Add buttons to quickly navigate between items of same folder in 'item view mode'
Fix for #2990, #3011
@michaldejmek
Copy link
Author

In the latest version, which is on GITU, the "roles_allowed_to_print_select" is still not fixed - if I go from 2.7 to 3.

@3gmgithub
Copy link

I had an issue. My 2.7 was only running PHP 7.3 you will need 7.4 for the upgrade to work.

@arnaud-asp
Copy link

arnaud-asp commented Jul 19, 2023

Also having this issue I think, after upgrade from 2.7 to 3.0.0.9.
When I want to get the option page /teampass/index.php?page=options, I get an error 500 which leads to this apache log :
PHP Fatal error: Uncaught TypeError: json_decode() expects parameter 1 to be string, null given in /var/www/html/teampass/pages/options.php:711\nStack trace:\n#0 /var/www/html/teampass/pages/options.php(711): json_decode()\n#1 /var/www/html/teampass/index.php(964): include('/var/www/html/t...')\n#2 {main}\n thrown in /var/www/html/teampass/pages/options.php on line 711, referer: https://teampass/teampass/index.php?page=admin

My system is ubuntu 20.04, php 7.4, Apache/2.4.41.

Other pages seems to work fine. Let me know if I can help fixing this.

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

No branches or pull requests

4 participants