{"record":{"id":"18ed317d3adbd790","repo":"istio/istio","slug":"bootstrap-requires-pod-name-or-file-parameter","errorCode":null,"errorMessage":"bootstrap requires pod name or --file parameter","messagePattern":"bootstrap requires pod name or --file parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"istioctl/pkg/proxyconfig/proxyconfig.go","lineNumber":1135,"sourceCode":"\t\tLong:  `Retrieve information about bootstrap configuration for the Envoy instance in the specified pod.`,\n\t\tExample: `  # Retrieve full bootstrap configuration for a given pod from Envoy.\n  istioctl proxy-config bootstrap <pod-name[.namespace]>\n\n  # Retrieve full bootstrap configuration for a pod under a deployment from Envoy.\n  istioctl proxy-config bootstrap deployment/<deployment-name[.namespace]>\n\n  # Retrieve full bootstrap without using Kubernetes API\n  ssh <user@hostname> 'curl localhost:15000/config_dump' > envoy-config.json\n  istioctl proxy-config bootstrap --file envoy-config.json\n\n  # Show a human-readable Istio and Envoy version summary\n  istioctl proxy-config bootstrap <pod-name[.namespace]> -o short\n`,\n\t\tAliases: []string{\"b\"},\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\tif (len(args) == 1) != (configDumpFile == \"\") {\n\t\t\t\tcmd.Println(cmd.UsageString())\n\t\t\t\treturn fmt.Errorf(\"bootstrap requires pod name or --file parameter\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(c *cobra.Command, args []string) error {\n\t\t\tvar configWriter *configdump.ConfigWriter\n\t\t\tkubeClient, err := ctx.CLIClient()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif len(args) == 1 {\n\t\t\t\tif podName, podNamespace, err = getPodName(ctx, args[0]); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tconfigWriter, err = setupPodConfigdumpWriter(kubeClient, podName, podNamespace, bootstrapPath, c.OutOrStdout())\n\t\t\t} else {\n\t\t\t\tconfigWriter, err = setupFileConfigdumpWriter(configDumpFile, c.OutOrStdout())\n\t\t\t}\n\t\t\tif err != nil {","sourceCodeStart":1117,"sourceCodeEnd":1153,"githubUrl":"https://github.com/istio/istio/blob/8dc789c5cf17517c64e3c36cb3288230f149dfae/istioctl/pkg/proxyconfig/proxyconfig.go#L1117-L1153","documentation":"Thrown by `istioctl proxy-config bootstrap` when the argument/file precondition fails: the command requires exactly one of a pod name argument OR `--file <envoy-config.json>`, not both and not neither. The Args hook enforces `(len(args) == 1) != (configDumpFile == \"\")` — i.e. exactly one source of Envoy config must be given.","triggerScenarios":"Running `istioctl proxy-config bootstrap` with no args and no `--file`; or with both a pod name and `--file`; or with two positional args (len(args)==2 makes the XOR false).","commonSituations":"Forgetting `--file` when working offline from a dumped config; passing both a pod and a file because you assumed file overrides the pod; shell globbing producing extra positional args.","solutions":["Pass exactly one source: `istioctl proxy-config bootstrap <pod>.<namespace>` or `istioctl proxy-config bootstrap --file envoy-config.json`.","If both were given, remove either the pod argument or the `--file` flag.","Check quoting of arguments if a script may expand to multiple words."],"exampleFix":"# before (neither, or both)\nistioctl proxy-config bootstrap\nistioctl proxy-config bootstrap mypod --file dump.json\n\n# after\nistioctl proxy-config bootstrap mypod.default","handlingStrategy":"validation","validationCode":"# bash: enforce XOR before invoking\nif [ $# -eq 1 ] && [ -n \"$DUMP_FILE\" ]; then echo 'pass pod XOR --file, not both' >&2; exit 2; fi\nif [ $# -eq 0 ] && [ -z \"$DUMP_FILE\" ]; then echo 'need pod or --file' >&2; exit 2; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --file as a full replacement for the pod argument, never an addition.","In automation, assert exactly one of POD_ARG / DUMP_FILE is set."],"tags":["istioctl","cli-usage","arguments"],"backgroundTag":null,"analyzedSha":"8dc789c5cf17517c64e3c36cb3288230f149dfae","analyzedAt":"2026-08-15T15:16:55.434Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}