Couchbase-cli doesn't work after update 6.0.0 to 6.6.0 (bad magic number in argparse)

Ubuntu 18.04

After upgrading from Couchbase 6.0.0 to 6.6.0, couchbase-cli no longer works. I get the error:

Traceback (most recent call last):
File “/opt/couchbase/lib/python/couchbase-cli”, line 8, in
import cbmgr
File “/opt/couchbase/lib/python/”, line 17, in
from argparse import ArgumentError, ArgumentParser, HelpFormatter, Action, SUPPRESS
ImportError: bad magic number in ‘argparse’: b’\x03\xf3\r\n’

I can see there are .pyc files in /opt/couchbase/lib/python that are left over from the 6.0.0 install. I think couchbase-cpi is trying to use these. In particular, the file /opt/couchbase/lib/python/argparse.pyc is causing the problem here. I ran rm /opt/couchbase/bin/python/*.pyc and couchbase-cli then worked.

I think an upgrade should automatically delete all existing *.pyc files before unpacking the new files.


Hi Giles,
Thanks for using our products.
I tried on centos 7.6 and could not reproduce your issue. After offline upgrade from 6.0.0 to 6.6.0, couchbase-cli works as expected

[root@s44015 cb-builds]# /opt/couchbase/bin/couchbase-cli bucket-create -c localhost:8091 --username Administrator --password password --bucket bucket2 --bucket-type couchbase --bucket-ramsize 256 --bucket-replica 1 --bucket-priority high --bucket-eviction-policy fullEviction --enable-flush 0 --enable-index-replica 1
SUCCESS: Bucket created
[root@s44015 cb-builds]#

I will try on ubuntu 18 soon.

Hi Giles,
Couchbase server 6.0.0 does not support Ubuntu 18.04. The highest version Couchbase server 6.0.0 support in Ubuntu is 16.04
Ubuntu 18.04 is supported on Couchbase server 6.0.1 and later as in this document

Hi Giles,
I am able to reproduce your issue in Ubuntu 18.04 upgrading from 6.0.1 to 6.6.0
I created ticket which will fix this issue in 6.6.2
One more time, thanks for using our products
If you have any question, drop me a line at thuan at couchbase dot com

1 Like

Hi @thuan,

Thanks for investigating and reproducing the issue. It’s good news that it should be fixed in 6.6.2.

Regarding your previous reply I know that Couchbase 6.0.0 does not officially support Ubuntu 18.04 and there isn’t an 18.04 release. However, the 16.04 release works fine on 18.04. We’ve been using it for over a year and haven’t found an issue with it.

Best regards,