{"record":{"id":"e5821ced1351408a","repo":"hyperledger/fabric","slug":"trailing-args-detected-e5821c","errorCode":null,"errorMessage":"trailing args detected","messagePattern":"trailing args detected","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/peer/node/start.go","lineNumber":128,"sourceCode":"\tdefaultChaincodePort   = 7052\n)\n\nvar chaincodeDevMode bool\n\nfunc startCmd() *cobra.Command {\n\t// Set the flags on the node start command.\n\tflags := nodeStartCmd.Flags()\n\tflags.BoolVarP(&chaincodeDevMode, \"peer-chaincodedev\", \"\", false, \"start peer in chaincode development mode\")\n\treturn nodeStartCmd\n}\n\nvar nodeStartCmd = &cobra.Command{\n\tUse:   \"start\",\n\tShort: \"Starts the node.\",\n\tLong:  `Starts a node that interacts with the network.`,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif len(args) != 0 {\n\t\t\treturn fmt.Errorf(\"trailing args detected\")\n\t\t}\n\t\t// Parsing of the command line is done so silence cmd usage\n\t\tcmd.SilenceUsage = true\n\t\treturn serve(args)\n\t},\n}\n\n// externalVMAdapter adapts coerces the result of Build to the\n// container.Interface type expected by the VM interface.\ntype externalVMAdapter struct {\n\tdetector *externalbuilder.Detector\n}\n\nfunc (e externalVMAdapter) Build(\n\tccid string,\n\tmdBytes []byte,\n\tcodePackage io.Reader,\n) (container.Instance, error) {","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/peer/node/start.go#L110-L146","documentation":"`peer node start` accepts no positional arguments; if any trailing args are passed to the command, RunE immediately fails with this fmt.Errorf before starting the server. It is a strict CLI argument guard, not a runtime condition.","triggerScenarios":"Running `peer node start <something>` — any extra positional tokens after `start`.","commonSituations":"Copy-pasting commands like `peer node start peer1` assuming a node name argument; shell scripts appending unintended arguments; confusing `node start` with other subcommands that take args.","solutions":["Remove all positional arguments: run exactly `peer node start`.","Pass configuration via flags/env (CORE_PEER_* variables, -f for a serve config) instead of positional args.","Fix the calling script so it does not append stray parameters to the command."],"exampleFix":"// before\npeer node start peer1\n// after\npeer node start","handlingStrategy":"validation","validationCode":"if [ \"$#\" -ne 0 ]; then echo \"usage: peer node start (no args)\" >&2; exit 1; fi\npeer node start","typeGuard":null,"tryCatchPattern":"if err := cmd.Run(); err != nil && strings.Contains(err.Error(), \"trailing args detected\") {\n    return fmt.Errorf(\"peer node start takes no positional arguments\")\n}","preventionTips":["Run `peer node start` with exactly zero positional arguments.","Configure the node via CORE_PEER_* env vars or the -f serve config file.","Quoted/empty shell variables can still become args — audit script expansions."],"tags":["fabric","peer-cli","cli-arguments"],"backgroundTag":"trailing-cli-arguments","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"}