{"record":{"id":"0a0b6ba2a1a84339","repo":"hyperledger/fabric","slug":"must-supply-genesis-block-path","errorCode":null,"errorMessage":"Must supply genesis block path","messagePattern":"Must supply genesis block path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/channel/join.go","lineNumber":119,"sourceCode":"\tproposalResp, err = cf.EndorserClient.ProcessProposal(context.Background(), signedProp)\n\tif err != nil {\n\t\treturn ProposalFailedErr(err.Error())\n\t}\n\n\tif proposalResp == nil {\n\t\treturn ProposalFailedErr(\"nil proposal response\")\n\t}\n\n\tif proposalResp.Response.Status != 0 && proposalResp.Response.Status != http.StatusOK {\n\t\treturn ProposalFailedErr(fmt.Sprintf(\"bad proposal response %d: %s\", proposalResp.Response.Status, proposalResp.Response.Message))\n\t}\n\tlogger.Info(\"Successfully submitted proposal to join channel\")\n\treturn nil\n}\n\nfunc join(cmd *cobra.Command, args []string, cf *ChannelCmdFactory) error {\n\tif genesisBlockPath == common.UndefinedParamValue {\n\t\treturn errors.New(\"Must supply genesis block path\")\n\t}\n\t// Parsing of the command line is done so silence cmd usage\n\tcmd.SilenceUsage = true\n\n\tvar err error\n\tif cf == nil {\n\t\tcf, err = InitCmdFactory(EndorserRequired, PeerDeliverNotRequired, OrdererNotRequired)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tspec, err := getJoinCCSpec()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn executeJoin(cf, spec)","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/channel/join.go#L101-L137","documentation":"The join command itself re-validates its inputs and aborts with this message if genesisBlockPath (the -b/--blockpath flag) is unset. It is the command-level guard for the same requirement getJoinCCSpec enforces, raised before any factory or proposal work begins.","triggerScenarios":"Running `peer channel join` without the -b flag (or with an empty value), e.g. `peer channel join -b ''` or omitting it entirely.","commonSituations":"Scripts where the BLOCKFILE variable is empty/unset; documentation examples truncated; calling join from a wrapper that only passes the channel ID.","solutions":["Rerun with the genesis block: `peer channel join -b ./channel-artifacts/mychannel.block`.","Ensure the script exports/sets the block path variable before invoking join.","Verify the genesis block file exists (ls -l) prior to joining."],"exampleFix":"// before\nBLOCKFILE=${PWD}/channel-artifacts/${CHANNEL_NAME}.block   # CHANNEL_NAME unset -> empty path\npeer channel join -b $BLOCKFILE\n// after\n: \"${CHANNEL_NAME:?must be set}\"\npeer channel join -b \"$BLOCKFILE\"","handlingStrategy":"validation","validationCode":"// bash\n: \"${BLOCKFILE:?set -b / BLOCKFILE before running}\"\n[ -r \"$BLOCKFILE\" ] || { echo \"block file not found: $BLOCKFILE\"; exit 1; }\npeer channel join -b \"$BLOCKFILE\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export BLOCKFILE/CHANNEL_NAME before calling join in scripts.","Use : \"${VAR:?}\" guards to fail fast on unset variables.","Verify artifacts exist between configtxgen and join steps.","Use set -euo pipefail so unset variables abort scripts early."],"tags":["hyperledger-fabric","cli","missing-argument"],"backgroundTag":"missing-required-flag","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}