tarantool / tarantool-python

Python client library for Tarantool
https://www.tarantool.io
BSD 2-Clause "Simplified" License
100 stars 48 forks source link

Error when connecting to tarantool #95

Closed skythet closed 4 years ago

skythet commented 6 years ago

Trying to connect to tarantool: tarantool.connect('127.0.0.1', 3301). But the following error occurs:

Traceback (most recent call last):
  File "server.py", line 2, in <module>
    from file_server.application import application
  File "file_server/application.py", line 10, in <module>
    tarantool_connection = tarantool.connect(host, port)
  File "ENV/lib/python3.5/site-packages/tarantool/__init__.py", line 50, in connect
    encoding=encoding)
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 127, in __init__
    self.connect()
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 203, in connect
    self.load_schema()
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 344, in load_schema
    self.schema.fetch_space_all()
  File "ENV/lib/python3.5/site-packages/tarantool/schema.py", line 130, in fetch_space_all
    space_rows = self.fetch_space_from(None)
  File "ENV/lib/python3.5/site-packages/tarantool/schema.py", line 117, in fetch_space_from
    index=_index)
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 759, in select
    response = self._send_request(request)
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 341, in _send_request
    return self._send_request_wo_reconnect(request)
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 264, in _send_request_wo_reconnect
    self.update_schema(e.schema_version)
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 349, in update_schema
    self.flush_schema()
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 353, in flush_schema
    self.load_schema()
  File "ENV/lib/python3.5/site-packages/tarantool/connection.py", line 345, in load_schema
    self.schema.fetch_index_all()
  File "ENV/lib/python3.5/site-packages/tarantool/schema.py", line 166, in fetch_index_all
    SchemaIndex(row, self.schema[row[0]])
  File "ENV/lib/python3.5/site-packages/tarantool/schema.py", line 29, in __init__
    for k, v in index_row[5]:
ValueError: too many values to unpack (expected 2)

Python version: Python 3.5.2 Python tarantool connector version:

pip show tarantool
Name: tarantool
Version: 0.6.1
Summary: Python client library for Tarantool 1.6 Database
Home-page: https://github.com/tarantool/tarantool-python
Author: Konstantin Cherkasoff
Author-email: k.cherkasoff@gmail.com
License: BSD
Location: ENV/lib/python3.5/site-packages
Requires: msgpack-python

Tarantool version:

root@8853358639d2:/opt/tarantool# tarantool -V
Tarantool 1.7.5-248-g69e9427
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_BACKTRACE=ON
Compiler: /usr/lib/ccache/cc /usr/lib/ccache/g++
C_FLAGS:-g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -fopenmp -msse2 -std=c11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-format-truncation -fno-gnu89-inline
CXX_FLAGS:-g -O2 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -fopenmp -msse2 -std=c++11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-format-truncation -Wno-invalid-offsetof

Format indexes changed:

[{'type': 'integer', 'field': 2, 'is_nullable': True}]
Totktonada commented 4 years ago

Fixed by https://github.com/tarantool/tarantool-python/commit/6eef9c45a065da4895917b4f394324c6c320360d ?

Totktonada commented 4 years ago

It seems it is fixed in 0.6.2. See release notes.