Articles in this section

Missing module error when running Aerospike Tools v3 27 1

Problem Description

When a new install of Aerospike Tools 3.27.1 has been completed the following error occurs when running certain tools.

 

root@7d644cbf8a1c:/tmp/aerospike-tools-3.27.1-ubuntu18.04# asloglatency

Traceback (most recent call last):

 File "/usr/bin/asloglatency", line 55, in <module>

  from builtins import str

ImportError: No module named builtins

root@7d644cbf8a1c:/tmp/aerospike-tools-3.27.1-ubuntu18.04# asloglatency --help

Traceback (most recent call last):

 File "/usr/bin/asloglatency", line 55, in <module>

  from builtins import str

ImportError: No module named builtins


Explanation

This error will occur when the Pthon future module is not installed on the system. The future module provides a compatibility layer between Python 2 and Python 3. In Aerospike Tools 3.27.1 support for Python 3 was introduced however support for Python 2 also remains and so the module is required.


Solution

The Python pip tool should be used to install the future module.

 

root@7d644cbf8a1c:/usr/bin# apt install python3-pip

Reading package lists... Done

 

...

 

root@7d644cbf8a1c:/usr/bin# pip3 install future

Collecting future

 Downloading https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829kB)

  100% |################################| 829kB 1.7MB/s

Building wheels for collected packages: future

 Running setup.py bdist_wheel for future ... done

 Stored in directory: /root/.cache/pip/wheels/8b/99/a0/81daf51dcd359a9377b110a8a886b3895921802d2fc1b2397e

Successfully built future

Installing collected packages: future

Successfully installed future-0.18.2

root@7d644cbf8a1c:/usr/bin# asloglatency

Traceback (most recent call last):

 File "/usr/bin/asloglatency", line 55, in <module>

  from builtins import str

ImportError: No module named builtins

root@7d644cbf8a1c:/usr/bin# python3 /usr/bin/asloglatency

Usage:

 -l log file

  default: /var/log/aerospike/aerospike.log

 -h histogram name

  MANDATORY - NO DEFAULT

  e.g. 'reads nonet'

 -N namespace name. If specified will display histogram latency

  for the namespace related histogram. e.g read, write.

  Not required for

  - Non-namespace histograms, e.g. svc-demarshal

  - Fully qualified namespace histogram names, e.g. {test}-read

 -t analysis slice interval

  default: 10

  other e.g. 3600 or 1:00:00

 -f log time from which to analyze

  default: tail

  other e.g. head or 'Sep 22 2011 22:40:14' or -3600 or -1:00:00

 -d maximum duration for which to analyze

  default: not set

  e.g. 3600 or 1:00:00

 -n number of buckets to display

  default: 3

 -e show 0-th then every n-th bucket

  default: 3

 -r (roll until user hits return key or ctrl-c)

  default: set if -f tail, otherwise not set

 -V show tool version

root@7d644cbf8a1c:/usr/bin# python3 /usr/bin/asloglatency -V

Aerospike Log Latency Tool

Version 3.27.1


Notes

Full release notes for Aerospike Tools 3.27.1 can be found here: https://www.aerospike.com/download/tools/notes.html#3.27.1  Tools version 4.0.2 drops support for Python 2.

Applies To Earliest Version

5.0

Applies To Latest Version

5.1
Was this article helpful?
0 out of 0 found this helpful