Skip to content

Commit 03366fa

Browse files
timofey-barminPeter-Searby
authored andcommitted
MB-68462:[BP] Fix eshell after migrating to erlang 26
We set cookie in code passed via -eval and I guess there is a race between executing -eval and -remsh. If remsh is executed first, then cookie will not be set by the time of connect. This fix explicitly sets the order for those operarations: we set the cookie first, and then start the remote shell. Change-Id: Ie9cd9ee6b5561d2e07ee25b57f3db3787bcf42eb Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/234795 Reviewed-by: Matt Hall <matt.hall@couchbase.com> Well-Formed: Restriction Checker Tested-by: Peter Searby <peter.searby@couchbase.com>
1 parent f933ac9 commit 03366fa

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cbmgr.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,6 +2322,9 @@ def execute(self, opts):
23222322
# erl script fails in OSX as it is unable to find COUCHBASE_TOP
23232323
env["COUCHBASE_TOP"] = opts.base_path
23242324

2325+
eval_str = 'erlang:set_cookie(list_to_atom(os:getenv("CB_COOKIE"))), ' \
2326+
f'shell:start_interactive({{remote, "{node}"}}).'
2327+
23252328
args = [
23262329
path,
23272330
'-name',
@@ -2330,9 +2333,8 @@ def execute(self, opts):
23302333
'nocookie',
23312334
'-hidden',
23322335
'-eval',
2333-
'erlang:set_cookie(node(), list_to_atom(os:getenv("CB_COOKIE"))).',
2334-
'-remsh',
2335-
node,
2336+
eval_str,
2337+
'-noshell',
23362338
'-proto_dist',
23372339
'cb',
23382340
'-epmd_module',

0 commit comments

Comments
 (0)