I got error message about “AttributeError: ‘module’ object has no attribute ‘loads’” (complete error message shown below). I checked the python versions on the server and we do have python 2.7 and 3.4 installed. Can anyone help with this?
Traceback (most recent call last):
File "/opt/couchbase/lib/python/cbtransfer", line 33, in <module>
pump_transfer.exit_handler(pump_transfer.Transfer().main(sys.argv))
File "/opt/couchbase/lib/python/pump_transfer.py", line 80, in main
rv = pumpStation.run()
File "/opt/couchbase/lib/python/pump.py", line 112, in run
rv, source_map, sink_map = self.check_endpoints()
File "/opt/couchbase/lib/python/pump.py", line 167, in check_endpoints
rv, source_map = self.source_class.check(self.opts, self.source_spec)
File "/opt/couchbase/lib/python/pump_dcp.py", line 73, in check
err, map = pump.rest_couchbase(opts, spec)
File "/opt/couchbase/lib/python/pump.py", line 1025, in rest_couchbase
result, errors = rest.list_buckets(True)
File "/opt/couchbase/lib/python/cluster_manager.py", line 671, in list_buckets
result, errors = self._get(url)
File "/opt/couchbase/lib/python/cluster_manager.py", line 32, in g
return f(*args, **kwargs)
File "/opt/couchbase/lib/python/cluster_manager.py", line 1260, in _get
return _handle_response(response, self.debug)
File "/opt/couchbase/lib/python/cluster_manager.py", line 1320, in _handle_response
return response.json(), None
File "/opt/couchbase/lib/python/requests/models.py", line 799, in json
return complexjson.loads(
AttributeError: 'module' object has no attribute 'loads'
The error is coming from the requests module which cbtransfer uses. Depending on the version of Python being used either simplejson or json module is imported as complexjson. The stack trace is saying that the module loaded does not have the loads function.
To help us investigate this further can you please answer the following questions:
What version of Ubuntu is being used?
What version of Python is the script being executed as? The output of python -v should be enough to answer this.
Thank you for the output. I have tried this on Couchbase Server 5.0.0 EE on Ubuntu 14.04.5 LTS and it works for me. Is this a normal install using the package?
I suspect something in the environment is causing the problem as the json module used by cbtransfer is the standard module that comes with Python.
Thanks for your response. I was OOO for a week, but when I tried your first command, it actually worked - there’s no python error anymore and the command appeared to be working.
However, the new problem is, this command seems print out every key it skips during the process, like this:
2018-08-28 11:18:00,607: w3 skipping msg with key: metrics.******
This bucket I’m working on has over 700 million keys. If we print out everything skipped it might take too much time. Is there a way to tune the logging level of this command?