Couchbase cli cbimport broken in upgrade 7.0.4 to 7.1.1

Hi,

We planned CB version upgrade from 7.0.4 to 7.1.1 and cb data import same cli command stopped working and tried multiple modified commans all having some issue -

Client Machine - Red Hat Enterprise Linux Server release 7.9 (Maipo)
Folder structure -
2 json files to import at path /cmcc2/folder/A_DATA.json and /cmcc2/folder/B_DATA.json

Working command with 7.0.4 -
/opt/couchbase/bin/cbimport json -f sample -c localhost:8091 -u couchbase -p couchbase -b buc -d file:///cmcc2/folder

Not Working command with 7.1.1 -
Command - /opt/couchbase/bin/cbimport json -f sample -c localhost:8091 -u couchbase -p couchbase -b buc -d file:///cmcc2/folder

Error - JSON import failed: not a file

tried other didnt work
/opt/couchbase/bin/cbimport json -f sample -c localhost:8091 -u couchbase -p couchbase -b buc -d file://cmcc2/folder

error -
JSON import failed: dataset ‘cmcc2/folder’ does not exist

/opt/couchbase/bin/cbimport json -f sample -c localhost:8091 -u couchbase -p couchbase -b buc -d file:///cmcc2/folder/A_DATA.json
error - JSON import failed: not a directory

verbosed -
/opt/couchbase/bin/cbimport json -f sample -c localhost:8091 -u couchbase -p couchbase -b buc -d file:///cmcc2/folder/A_DATA.json -v

log-
2022-09-01T16:39:15.710+03:00 (REST) Successfully connected to cluster | {“enterprise”:true,“uuid”:“e1200d8119bf1786750076c01de97232”,“developer_preview”:false,“version”:{“min_version”:“7.1.1”,“is_mixed_cluster”:false},“max_vbuckets”:1024,“uniform_vbuckets”:true}
2022-09-01T16:39:15.710+03:00 JSON import failed: failed to get import transferable: failed to create JSON source: failed to get manifest from data source: failed to open collection manifest: open /cmcc2/folder/A_DATA.json/collection_manifest.json: not a directory
JSON import failed: not a directory

A_DATA.json -

{
“refData”: [
{



}
],
“catalogVersion”: “1.0”,
“entityType”: “REF_DATA”,
“expiry”: 0,
“casValue”: 0,
“type”: null,
“key”: “A_DATA”
}

Just noticed zip cbimport solution is working fine but folder import is broken in version change -

./cbimport json -f sample -c localhost:8091 -u couchbase -p couchbase -b productDynamicParameterProvider -d file:///cmcc2/folder/json_zipped.zip

I was able to reproduce this. I have created https://issues.couchbase.com/browse/MB-53575

1 Like

We also noticed this on upgrading to 7.1.1. The “-f sample” format is specifically broken. We worked around this by changing to “-f list” and changing our import data to match that as documented here cbimport json | Couchbase Docs.

Hi :wave:

I’ve updated MB-53575 with information as to what’s happening here. To paraphrase, in 7.1.0 we improved error messages for missing datasets, unfortunately, a invalid assumption meant we only added checks for files (not directories); this added a “barrier of entry” disallowing importing samples when unzipped.

Is there a workaround?
Yes, you could zip the sample directory using zip -r <name>.zip <path/to/sample> then import using the same command but provide the zipped sample instead.

Thanks,
James