[tools] couchbase-cli broken when upgrade from 6.0.1 to 6.6.0 in Ubuntu 18.04

Description

Steps to Reproduce

  1. Install Couchbase server 6.0.1 on a Ubuntu 18.04 server.

  2. Use couchbase-cli to initial node and create bucket1.  It works as expected.

  3. Upgrade node to Couchbase server 6.6.0
    #Use couchbase-cli to create a second bucket, bucket2, failed with error: 

    root@ip-172-31-18-93:~# /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 Traceback (most recent call last):   File "/opt/couchbase/lib/python/couchbase-cli", line 8, in <module>     import cbmgr   File "/opt/couchbase/lib/python/cbmgr.py", line 17, in <module>     from argparse import ArgumentError, ArgumentParser, HelpFormatter, Action, SUPPRESS ImportError: bad magic number in 'argparse': b'\x03\xf3\r\n' root@ip-172-31-18-93:~

Workaround

Remove all file with extension pyc in /opt/couchbase/lib/python/*.pyc as mention in this Forum, it works

root@ip-172-31-18-93:~# rm -rf /opt/couchbase/lib/python/*.pyc root@ip-172-31-18-93:~# /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@ip-172-31-18-93:~#

This bug does not affect centos as I confirmed in the forum.

 

 

 

Components

Affects versions

Fix versions

Labels

Environment

Ubuntu 18.04

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Show:

Arunkumar Senthilnathan April 6, 2021 at 7:51 PM

Verified with upgrade from 6.0.5 to 6.6.2

Chris Hillery March 1, 2021 at 8:52 AM

All new debugging and fixing is tracked on https://couchbasecloud.atlassian.net/browse/MB-44430#icft=MB-44430, so I'm re-closing this one.

Chris Hillery February 26, 2021 at 11:23 AM

The second part of this fix - deleting /opt/couchbase/lib/python entirely on uninstall - is the underlying cause of https://couchbasecloud.atlassian.net/browse/MB-44430#icft=MB-44430. This bug means that python-based tools will be broken after upgrading from any Server with this "fix" in it, which will include 6.6.2 if we don't put in a patch before GA. I've been testing several possible fixes, and I have something that mostly works, but it's still producing a warning message that indicates I still don't entirely understand what's going on.

Chris Hillery February 26, 2021 at 9:40 AM

Turns out my safe, low-impact fix for this breaks upgrade from 6.6.2+ to a higher version. Re-opening to put in proper change - this will require a new 6.6.2 build.

CB robot January 21, 2021 at 11:24 AM

Build couchbase-server-7.0.0-4272 contains voltron commit 2f9e21f with commit message:
https://couchbasecloud.atlassian.net/browse/MB-43323#icft=MB-43323: Fix upgrade problem caused by stray .pyc files

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Is this a Regression?

No

Triage

Untriaged

Operating System

Ubuntu 64-bit

Story Points

Sprint

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created December 16, 2020 at 4:13 AM
Updated June 17, 2021 at 10:56 PM
Resolved March 1, 2021 at 8:53 AM
Instabug

Flag notifications