Description

When using the db-manage.py script, which is present inside the contrail-API container, you may find that the command "python db-manage.py --debug check" is failing with the following error code:

ERROR: (v1.14) Checker check_cassandra_keyspace_replication: Exception, <class 'thrift.transport.TTransport.TTransportException'>
DB-Manage Script version: 1.14

This error is seen in the db-manage script version 1.14. This article recommends upgrading to version 1.40 to resolve this error since this is a known issue.

Symptoms

The error

shell # python db_manage.py --debug check
.
.
2022-12-05 17:18:35,843 ERROR: (v1.14) Checker check_cassandra_keyspace_replication: Exception, <class 'thrift.transport.TTransport.TTransportException'>
.
.
Traceback (most recent call last):
  File "test.py", line 3005, in <module>
    main()
  File "test.py", line 2986, in main
    return globals()['db_%s' % (verb)](args, api_args)
  File "test.py", line 2898, in db_check
    db_checker.check_cassandra_keyspace_replication()
  File "test.py", line 1144, in wrapper
    errors = func(*args, **kwargs)
  File "test.py", line 1247, in check_cassandra_keyspace_replication
    ks_prop = sys_mgr.get_keyspace_properties(full_ks_name)
  File "/usr/lib/python2.7/site-packages/pycassa/system_manager.py", line 115, in get_keyspace_properties
    ks_def = self._conn.describe_keyspace(keyspace)
  File "/usr/lib/python2.7/site-packages/pycassa/cassandra/Cassandra.py", line 1427, in describe_keyspace
    return self.recv_describe_keyspace()
  File "/usr/lib/python2.7/site-packages/pycassa/cassandra/Cassandra.py", line 1438, in recv_describe_keyspace
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  File "/usr/lib64/python2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 126, in readMessageBegin
    sz = self.readI32()
  File "/usr/lib64/python2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 206, in readI32
    buff = self.trans.readAll(4)
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
    chunk = self.read(sz - have)
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 271, in read
    self.readFrame()
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 277, in readFrame
    self.__rbuf = StringIO(self.__trans.readAll(sz))
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
    chunk = self.read(sz - have)
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TSocket.py", line 118, in read
    message='TSocket read 0 bytes')
TTransportException: TSocket read 0 bytes

Solution

This is a known issue so we recommend that you upgrade the db-manage script to the latest version (1.40) and rerun the commands.

You can access the latest version of the db-manage.py script at: https://github.com/tungstenfabric/tf-controller/blob/master/src/config/api-server/vnc_cfg_api_server/db_manage.py

To upgrade the the script to the latest version, refer to KB36519 - [Contrail] How to install the latest version of db_manage.py in config_api container [juniper.net].

Modification History

2022-12-06: Initial version