{"record":{"id":"b011f05c008d9d80","repo":"pulumi/pulumi","slug":"at-least-one-of-source-or-dest-must-be-provide","errorCode":null,"errorMessage":"at least one of --source or --dest must be provided","messagePattern":"at least one of --source or --dest must be provided","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/state/state_move.go","lineNumber":84,"sourceCode":"\tstateMove := &stateMoveCmd{\n\t\tColorizer: cmdutil.GetGlobalColorization(),\n\t}\n\tcmd := &cobra.Command{\n\t\tUse:     \"move\",\n\t\tAliases: []string{\"mv\"},\n\t\tShort:   \"Move resources from one stack to another\",\n\t\tLong: `Move resources from one stack to another\n\nThis command can be used to move resources from one stack to another. This can be useful when\nsplitting a stack into multiple stacks or when merging multiple stacks into one.\n`,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tctx := cmd.Context()\n\t\t\tsink := cmdutil.Diag()\n\t\t\tws := pkgWorkspace.Instance\n\n\t\t\tif sourceStackName == \"\" && destStackName == \"\" {\n\t\t\t\treturn errors.New(\"at least one of --source or --dest must be provided\")\n\t\t\t}\n\t\t\tsourceStack, err := cmdStack.RequireStack(\n\t\t\t\tctx,\n\t\t\t\tsink,\n\t\t\t\tws,\n\t\t\t\tcmdBackend.DefaultLoginManager,\n\t\t\t\tsourceStackName,\n\t\t\t\tcmdStack.LoadOnly,\n\t\t\t\tdisplay.Options{\n\t\t\t\t\tColor:         cmdutil.GetGlobalColorization(),\n\t\t\t\t\tIsInteractive: true,\n\t\t\t\t},\n\t\t\t\t\"\",\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdestStack, err := cmdStack.RequireStack(","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/state/state_move.go#L66-L102","documentation":"Validation error from `pulumi state move` (pkg/cmd/pulumi/state/state_move.go): the command needs at least one of the --source or --dest stack flags to know what move operation to perform; invoking it with neither is rejected up front before any stack is loaded.","triggerScenarios":"Running `pulumi state move <urn...>` (or with no args) without passing --source and/or --dest, e.g., `pulumi state move urn:pulumi:...` alone.","commonSituations":"Forgetting the flags on first use of the command; assuming the current stack is implicitly the source; copy-pasting an example that omitted the flags.","solutions":["Pass --dest <stack> to move resources into another stack","Pass --source <stack> to move resources out of a specific stack","Pass both flags to move between two explicitly named stacks","Check `pulumi state move --help` for the expected flag syntax"],"exampleFix":"// before\n$ pulumi state move urn:pulumi:prod::web::aws:s3/bucket:Bucket\nerror: at least one of --source or --dest must be provided\n\n// after\n$ pulumi state move urn:pulumi:prod::web::aws:s3/bucket:Bucket --dest org/proj/archive","handlingStrategy":"validation","validationCode":"$ pulumi state move \"$urn\" --source \"${SOURCE:-}\" --dest \"${DEST:-}\"; [ -n \"$SOURCE\" ] || [ -n \"$DEST\" ] || { echo 'set --source and/or --dest'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always decide the move direction up front and pass --dest (into) or --source (out of)","Consult `pulumi state move --help` before scripting the command","Never assume the current stack is implicitly the source"],"tags":["cli","state","validation","flags"],"backgroundTag":"missing-required-flag","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}