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

Failed Upgrade from Git:Master (2017-01-17) to 2.1.27.7 #1816

Closed
tiredofit opened this issue Jul 17, 2017 · 4 comments
Closed

Failed Upgrade from Git:Master (2017-01-17) to 2.1.27.7 #1816

tiredofit opened this issue Jul 17, 2017 · 4 comments

Comments

@tiredofit
Copy link

Steps to reproduce

  1. Update source files to latest revision
  2. Select I have used only Teampass 2.1.27x

Expected behaviour

Upgrade to latest revision

Actual behaviour

DB Upgrade hangs at 2 phases:
Cust_fields.php (can restart and it goes to next)

[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught Defuse\Crypto\Exception\BadFormatException: Encoding::hexToBin() input is not a hex string. in /www/teampass/includes/libraries/Encryption/Encryption/Encoding.php:65"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "Stack trace:"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#0 /www/teampass/includes/libraries/Encryption/Encryption/Encoding.php(164): Defuse\Crypto\Encoding::hexToBin('def00000b37f3b1...')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#1 /www/teampass/includes/libraries/Encryption/Encryption/Key.php(38): Defuse\Crypto\Encoding::loadBytesFromChecksummedAsciiSafeString('\xDE\xF0\x00\x00', 'def00000b37f3b1...')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#2 /www/teampass/sources/main.functions.php(383): Defuse\Crypto\Key::loadFromAsciiSafeString('def00000b37f3b1...')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#3 /www/teampass/sources/items.queries.php(2420): cryption('def502008d3fc1c...', 'def00000b37f3b1...', 'decrypt')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#4 {main}"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: " thrown in /www/teampass/includes/libraries/Encryption/Encryption/Encoding.php on line 65"

  • Then it hangs forever on files_step2

Server configuration

Docker / Alpine:edge

Nginx 1.13 / PHP-FPM 7.0

MariaDB 10.2.27

**Teampass version: 2.1.27.7

Upgrade from git master branch

Client configuration

Browser:
Firefox
Operating system:
Linux

Logs

Web server error log

[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Uncaught Defuse\Crypto\Exception\BadFormatException: Encoding::hexToBin() input is not a hex string. in /www/teampass/includes/libraries/Encryption/Encryption/Encoding.php:65"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "Stack trace:"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#0 /www/teampass/includes/libraries/Encryption/Encryption/Encoding.php(164): Defuse\Crypto\Encoding::hexToBin('def00000b37f3b1...')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#1 /www/teampass/includes/libraries/Encryption/Encryption/Key.php(38): Defuse\Crypto\Encoding::loadBytesFromChecksummedAsciiSafeString('\xDE\xF0\x00\x00', 'def00000b37f3b1...')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#2 /www/teampass/sources/main.functions.php(383): Defuse\Crypto\Key::loadFromAsciiSafeString('def00000b37f3b1...')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#3 /www/teampass/sources/items.queries.php(2420): cryption('def502008d3fc1c...', 'def00000b37f3b1...', 'decrypt')"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "#4 {main}"
[17-Jul-2017 08:13:24] WARNING: [pool www] child 298 said into stderr: "  thrown in /www/teampass/includes/libraries/Encryption/Encryption/Encoding.php on line 65"

and so on.

Firebug log (How to?)

Insert the Firebug log here
@nilsteampassnet
Copy link
Owner

Do you have something inside teampass-seckey.txt file?

@zpol
Copy link

zpol commented Jan 10, 2019

SOLVED: ok for those having exactly this issue: "PHP Fatal error: Uncaught Defuse\Crypto\Exception\BadFormatException: Encoding::hexToBin() input is not a hex string.", NOT "file not found" or "string is shorter than expected".

Probably some of you like me just copied the key from the original server and paste it into a new file in the other server, because of migrating between versions or whatever,...

The point is: When you copy & paste the secret key into the file teampass-seckey.txt you're adding probably more characters into the file than you should. Specificly a non HEX character (0A). I wasn't able to see it even with vim by using ":set list" command. So I ended up checking the md5sum of both files and having different results I decided to use a HEX editor to compare the files.

The first one had the key, and the second one had the key and a ASCI: ' ' at the end (HEX:'0A')

seckey

Now everything is working again.

@nilsteampassnet
Copy link
Owner

This is really interesting and I didn't thought about it.
It could indeed explain a lot of issues.

@zpol Many thanks for sharing this return of experience!

@tiredofit
Copy link
Author

@zpol Thanks. I actually just had one of my team members move the data manually (!) on an internship from one server to the other as this was quite some time ago, but this issue should be useful for others. Since that issue was posted we've been running 1 year without issues.

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

3 participants