Bad greeting error with php 7.1
Sulverus opened this issue · 7 comments
Using php 7.0 - it works correctly, but with php 7.1 and the same tarantool instance it fails with Bad greetings exception. (https://github.com/tarantool/tarantool-php/blob/php7-v2/src/tarantool.c#L296)
Tarantool version: 1.6.9-45-gceb3003
Driver branch: https://github.com/tarantool/tarantool-php/tree/php7-v2
Upd:
string(134) "Tarantool 1.6 (nutcracker 0.4.0)
L0waf+gp5cw82gjbHravmHFYFxcy3b0AK7glFnOaQVA=
�@qk�"
greeting= string(134) "Tarantool 1.6 (nutcracker 0.4.0)
L0waf+gp5cw82gjbHravmHFYFxcy3b0AK7glFnOaQVA=
�@qk�"
thanks
the problem is solved
the problem was in nutcracker
normal hello message
"Tarantool 1.7.4 (Binary) c5e729dd-e80d-45db-9002-2ea54a8ff9f2
sO6VgUNJox6rHXQvy2/x1/qVfgrZX6R2+GxtnwVrbjo=
"
and with nutcracker
"Tarantool 1.7 (nutcracker 0.4.0)
L0waf+gp5cw82gjbHravmHFYFxcy3b0AK7glFnOaQVA=
�@qk�"
the patch is something like
Index: src/tarantool_proto.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/tarantool_proto.c (revision de17ac9a1002e54b622cdcebe4a7504499a7a381)
+++ src/tarantool_proto.c (revision )
@@ -457,7 +457,6 @@
/* Parse a version string - 1.6.6-83-gc6b2129 or 1.6.7 */
unsigned major, minor, patch;
- if (sscanf(version, "%u.%u.%u", &major, &minor, &patch) != 3)
- return 0;
+ sscanf(version, "%u.%u.%u", &major, &minor, &patch);
return version_id(major, minor, patch);
}
Looks like nutcracker-tarantool has wrong greeting format (two version numbers instead of three version numbers). @bigbes et al. you'd better either support two-number format in greeting check, or fix nutcracker-tarantool greeting so that it has three numbers instead of two.
Fixed in nutcracker's fork: tarantool/twemproxy@e2c2736