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

Alert after new install #1806

Closed
MajkiIT opened this issue Jul 5, 2017 · 21 comments
Closed

Alert after new install #1806

MajkiIT opened this issue Jul 5, 2017 · 21 comments

Comments

@MajkiIT
Copy link

MajkiIT commented Jul 5, 2017

Steps to reproduce

  1. clone from github
  2. install Teampass
  3. login after instalation

Expected behaviour

No alert

Actual behaviour

After new install, when I log in i see alert Requested JSON parse failed and after that I wall logout.

Server configuration

Operating system: Ubuntu 16.04

Web server: Apache/2.4.18

Database: 10.1.24-MariaDB-1

PHP version: PHP 7.0.18

Teampass version: last from github /2.1.27/

Updated from an older Teampass or fresh install: Fresh install

Client configuration

Browser: FF 54.0.1

Operating system:
Win 10

Logs

Web server error log

[Wed Jul 05 14:36:16.227994 2017] [:error] [pid 30280] [client 10.8.98.41:58956] PHP Fatal error: require_once(): Failed opening required './sources/SecureHandler.php' (include_path='.:/usr/share/php') in /data/teampass/TeamPass/error.php on line 16, referer: http://x.x.x.x:84/index.php?page=manage_roles

Insert your webserver log here

Firebug log (How to?)

Insert the Firebug log here
@jronzon
Copy link

jronzon commented Jul 5, 2017

Same problem
OS : Red Hat Enterprise Linux Server release 7.3 (Maipo)
Apache version : Apache/2.4.6
php : PHP 5.6.30 (cli) (built: Jan 19 2017 07:57:06)
mysql : mysql Ver 15.1 Distrib 10.1.21-MariaDB, for Linux (x86_64) using readline 5.1

logs apache error :
[Wed Jul 05 15:16:10.358385 2017] [:error] [pid 7797] [client 1xxxxx:20056] PHP Warning: require_once(./sources/SecureHandler.php): failed to open stream: No such file or directory in /var/www/html/teampass/error.php on line 16, referer: https://xxxxxxxx/index.php?page=manage_settings
[Wed Jul 05 15:16:10.358421 2017] [:error] [pid 7797] [client 1xxxxxxx:20056] PHP Fatal error: require_once(): Failed opening required './sources/SecureHandler.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/teampass/error.php on line 16, referer: https://xxxxxxx/index.php?page=manage_settings

@byeight
Copy link

byeight commented Jul 5, 2017

Same problem
OS: Windows Server 2012 R2
Latest Winamp install 3.0.6 - 64 bits
Apache: 2.4.23
PHP: 7.0.10
Mysql: 5.7.14

Did a clean install, went all well. After login with admin: Requested JSON parse failed.

I did notice that using PHP 5.6.25 the user table was empty after the clean install, after switching to version 7.0.10 it was filled after a new clean install.

Then after clicking any button it returns to login screen.

@mmalnati
Copy link

mmalnati commented Jul 5, 2017

Same problem
OS : Debian 8.8
Apache version : Apache/2.4.6
php : PHP 7.0.20-1~dotdeb+8.2
mysql : mysql Ver 15.1 Distrib 10.1.21-MariaDB, for Linux (x86_64) using readline 5.1

I did a clean install too, and when i try to log in with admin, it shows the messege: "Requested JSON parse failed."

I leave you the logs:

[Wed Jul 05 11:30:01.390379 2017] [:error] [pid 15596] [client x.x.x.x:43221] PHP Warning: require_once(./sources/SecureHandler.php): failed to open stream: No such file or directory in /var/www/html/teampass/error.php on line 16, referer: http://x.x.x.x/teampass/index.php?page=manage_settings
[Wed Jul 05 11:30:01.390598 2017] [:error] [pid 15596] [client x.x.x.x:43221] PHP Fatal error: require_once(): Failed opening required './sources/SecureHandler.php' (include_path='.:/usr/share/php') in /var/www/html/teampass/error.php on line 16, referer: http://x.x.x.x/teampass/index.php?page=manage_settings

nilsteampassnet added a commit that referenced this issue Jul 5, 2017
Fix for #1806
@nilsteampassnet
Copy link
Owner

In current installation, add a timestamp in field "last_pw_change" for user 'admin'

@MajkiIT
Copy link
Author

MajkiIT commented Jul 6, 2017

@nilsteampassnet On my BD I see timestamp


MariaDB [teampass]> select login,timestamp from teampass_users where login = 'admin';
+-------+------------+
| login | timestamp  |
+-------+------------+
| admin | 1499323932 |
+-------+------------+

@nilsteampassnet
Copy link
Owner

Oh I perhaps not write something enough clear.
What I mean is that you need to add a timestamp value inside field 'last_pw_change' for user admin.

UPDATE teampass_users SET 'last_pw_change' = 1499336944 WHERE login = 'admin'

@MajkiIT
Copy link
Author

MajkiIT commented Jul 6, 2017

@nilsteampassnet Nów it's OK.

working query
UPDATE teampass_users SET last_pw_change = '1499336944' WHERE login = 'admin';

@MajkiIT
Copy link
Author

MajkiIT commented Jul 6, 2017

@nilsteampassnet
Next problem. When I want to save item I see 500 error. On apache log;

PHP Fatal error: Uncaught Defuse\\Crypto\\Exception\\BadFormatException: Encoded data is shorter than expected. in /data/teampass/TeamPass/includes/libraries/Encryption/Encryption/Encoding.php:168\nStack trace:\n#0 /data/teampass/TeamPass/includes/libraries/Encryption/Encryption/Key.php(38): Defuse\\Crypto\\Encoding::loadBytesFromChecksummedAsciiSafeString('\\xDE\\xF0\\x00\\x00', false)\n#1 /data/teampass/TeamPass/sources/main.functions.php(383): Defuse\\Crypto\\Key::loadFromAsciiSafeString(false)\n#2 /data/teampass/TeamPass/sources/items.queries.php(176): cryption('password!', false, 'encrypt')\n#3 {main}\n thrown in /data/teampass/TeamPass/includes/libraries/Encryption/Encryption/Encoding.php on line 168, referer: https://teampass.x.x/index.php?page=items

@mmalnati
Copy link

mmalnati commented Jul 6, 2017

Is this a bug or just bad configuration?
It works now.
Thank you so much fot he help! :)

@MajkiIT
Copy link
Author

MajkiIT commented Jul 6, 2017

@mmalnati Can you check your instalation? Do you have the same problem in adding password ?

@mmalnati
Copy link

mmalnati commented Jul 6, 2017

I follow this guide: https://linoxide.com/tools/setup-teampass-ubuntu-16-04/
The following text is the configuration for mysql:

root@demohost:~# mysql -u root -p
Enter password:

mysql> create database teampass;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on teampass.* to teampassuser@localhost identified by 'somepassword';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

@jronzon
Copy link

jronzon commented Jul 6, 2017 via email

@mmalnati
Copy link

mmalnati commented Jul 6, 2017

@MajkiIT I create another user, and when i log in, it shows the message "Requested JSON parse failed".
I think it has something to do with the configuration in the mysql and the users or databases.
Do you have any ideas?
Thanks!!!

@MajkiIT
Copy link
Author

MajkiIT commented Jul 6, 2017

On mysql run this query on teampass DB
UPDATE teampass_users SET last_pw_change = '1499336944' WHERE login = 'admin';

@MajkiIT
Copy link
Author

MajkiIT commented Jul 10, 2017

Hi,

Any update???

@nilsteampassnet
Copy link
Owner

Didn't the mysql query solved the problem?

@MajkiIT
Copy link
Author

MajkiIT commented Jul 10, 2017

@nilsteampassnet I have next problem.

When I want to save item I see 500 error. On apache log;

PHP Fatal error: Uncaught Defuse\\Crypto\\Exception\\BadFormatException: Encoded data is shorter than expected. in /data/teampass/TeamPass/includes/libraries/Encryption/Encryption/Encoding.php:168\nStack trace:\n#0 /data/teampass/TeamPass/includes/libraries/Encryption/Encryption/Key.php(38): Defuse\\Crypto\\Encoding::loadBytesFromChecksummedAsciiSafeString('\\xDE\\xF0\\x00\\x00', false)\n#1 /data/teampass/TeamPass/sources/main.functions.php(383): Defuse\\Crypto\\Key::loadFromAsciiSafeString(false)\n#2 /data/teampass/TeamPass/sources/items.queries.php(176): cryption('password!', false, 'encrypt')\n#3 {main}\n thrown in /data/teampass/TeamPass/includes/libraries/Encryption/Encryption/Encoding.php on line 168, referer: https://teampass.x.x/index.php?page=items

@MajkiIT
Copy link
Author

MajkiIT commented Jul 11, 2017

I solved my problem.

@MajkiIT MajkiIT closed this as completed Jul 11, 2017
@elvesibeiro
Copy link

elvesibeiro commented Sep 20, 2017

Hi guys I have the same problem
**[Wed Sep 20 13:29:07.000851 2017] [:error] [pid 23811] [client 172.30.200.105:57593] PHP Warning: require_once(./sources/SecureHandler.php): failed to open stream: No such file or directory in /var/www/html/teampass/error.php on line 16, referer: http://srv0502023.fortaleza.ce.gov.br/index.php?page=manage_main
[Wed Sep 20 13:29:07.000904 2017] [:error] [pid 23811] [client 172.30.200.105:57593] PHP Fatal error: require_once(): Failed opening required './sources/SecureHandler.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/teampass/error.php on line 16, referer: http://srv0502023.fortaleza.ce.gov.br/index.php?page=manage_main
**

I also have tried to use this command ( UPDATE teampass_users SET last_pw_change = '1499336944' WHERE login = 'admin';) but didn't works.

I am using the https://github.com/nilsteampassnet/TeamPass/archive/master.zip in my installation.

@MajkiIT
Copy link
Author

MajkiIT commented Sep 20, 2017

@elvesibeiro this file /var/www/html/teampass/error.php is on path?

@elvesibeiro
Copy link

elvesibeiro commented Sep 21, 2017

@MajkiIT Today I updated to newest version and now I have other problem.
I have opened the a issue here #1911.

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

6 participants