hyperledger / hyperledger/fabric-samples

Inconsistent DELAY handling causes "sleep: missing operand" in cc invoke/query flows

Open
#1,411 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3k
Forks
3.5k
Avg merge
3d 20h
Merged PRs (30d)
6

Description

While running the test network (e.g. `./network.sh cc invoke` or `cc query`), I hit this error:

sleep: missing operand

After tracing it, this comes from `test-network/scripts/ccutils.sh` where retry loops use:

sleep $DELAY

In some cases, `DELAY` isn’t set, so the command ends up being just `sleep`, which fails.
there is already a `CLI_DELAY` (default = 3), but it isn’t used here.

A simple fix would be to fall back to it, for example:

sleep ${DELAY:-$CLI_DELAY}

this avoids the error and keeps the existing behavior when `DELAY` is provided

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.