Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PipelineDeployStackAction:Stage xx already contains an action with name 'Execute' #8183

Closed
gmarchand opened this issue May 25, 2020 · 1 comment · Fixed by #8217
Closed
Assignees
Labels
@aws-cdk/app-delivery Related to the app-delivery CI-CD package bug This issue is a bug. in-progress This issue is being actively worked on. p1

Comments

@gmarchand
Copy link

I would want to use aws_cdk.app_delivery.PipelineDeployStackAction to deploy my multiple stacks cdk application but I have this error.
I can't modify the name of the action and I would want to use a stage per environment.

Reproduction Steps

My code:

app.py

...
baseline = BaseLineStack(app, f"{props['namespace']}-baseline", props)
middleware = MiddlewareStack(app, f"{props['namespace']}-middleware", props)
datastore = DatastoreStack(app, f"{props['namespace']}-datastore", props)

stacks = [baseline, middleware, datastore]
pipeline = PipelineStack(
    app,
    f"{props['namespace']}-pipeline",
    baseline.outputs,
    stacks)

pipeline_stack.py

      staging_stage = pipeline.add_stage(
            stage_name="deploy-staging",
        )
        order = 0


        for stack in stacks:
            order += 1
            s = app_delivery.PipelineDeployStackAction(
                input=build_app,
                admin_permissions=True,
                change_set_name=f"changeset-{stack.stack_name}",
                create_change_set_run_order=order,
                stack=stack,
            )
            staging_stage.add_action(s)

Error Log

pipenv run cdk synth
jsii.errors.JavaScriptError: 
  Error: Stage deploy-staging already contains an action with name 'Execute'
      at Stage.addAction (/private/var/folders/gw/zv805zcx1fj0_20sk2zb5xv1zlzd00/T/jsii-kernel-uDDrdX/node_modules/@aws-cdk/aws-codepipeline/lib/stage.js:66:19)
      at /Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7680:51
      at Kernel._wrapSandboxCode (/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:8316:19)
      at /Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7680:25
      at Kernel._ensureSync (/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:8289:20)
      at Kernel.invoke (/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7679:26)
      at KernelHost.processRequest (/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7388:28)
      at KernelHost.run (/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7328:14)
      at Immediate._onImmediate (/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7331:37)
      at processImmediate (internal/timers.js:456:21)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "app.py", line 40, in <module>
    stacks)
  File "/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_runtime.py", line 66, in __call__
    inst = super().__call__(*args, **kwargs)
  File "/Users/gmarchan/Documents/PROJECT/eleanor-private/eleanor/infra/stack/pipeline_stack.py", line 116, in __init__
    staging_stage.add_action(s)
  File "/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/aws_cdk/aws_codepipeline/__init__.py", line 2832, in add_action
    return jsii.invoke(self, "addAction", [action])
  File "/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 113, in wrapped
    return _recursize_dereference(kernel, fn(kernel, *args, **kwargs))
  File "/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 288, in invoke
    args=_make_reference_for_native(self, args),
  File "/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 348, in invoke
    return self._process.send(request, InvokeResponse)
  File "/Users/gmarchan/.local/share/virtualenvs/infra-R-quO2GQ/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 318, in send
    raise JSIIError(resp.error) from JavaScriptError(resp.stack)
jsii.errors.JSIIError: Stage deploy-staging already contains an action with name 'Execute'
Subprocess exited with error 1
make: *** [compile] Error 1

Environment

  • CLI Version : 1.41.0 (build 9e071d2)
  • Framework Version:
  • OS : Macos
  • Language : python

Other

https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts#L129


This is 🐛 Bug Report

@gmarchand gmarchand added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 25, 2020
@skinny85 skinny85 self-assigned this May 26, 2020
@skinny85 skinny85 added @aws-cdk/app-delivery Related to the app-delivery CI-CD package in-progress This issue is being actively worked on. p1 and removed needs-triage This issue or PR still needs to be triaged. labels May 27, 2020
@skinny85
Copy link
Contributor

Hi @gmarchand ,

thanks for reporting the issue. I'm working on a fix.

Related issue: #3984.

Thanks,
Adam

skinny85 added a commit to skinny85/aws-cdk that referenced this issue May 27, 2020
…once in a Stage

The PipelineDeployStackAction class hard-coded the names of the CloudFormation
actions it created for preparing and executing the ChangeSet.
Which meant this composite action could never be used more than once in the same stage
(as that would result in errors saying the action names were duplicated).
Allow overriding the names of the actions to make it possible to be used
more than once in the same CodePipeline stage.

Fixes aws#3984
Fixes aws#8183
@mergify mergify bot closed this as completed in #8217 May 27, 2020
mergify bot pushed a commit that referenced this issue May 27, 2020
…once in a Stage (#8217)

The PipelineDeployStackAction class hard-coded the names of the CloudFormation
actions it created for preparing and executing the ChangeSet.
Which meant this composite action could never be used more than once in the same stage
(as that would result in errors saying the action names were duplicated).
Allow overriding the names of the actions to make it possible to be used
more than once in the same CodePipeline stage.

Fixes #3984
Fixes #8183

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/app-delivery Related to the app-delivery CI-CD package bug This issue is a bug. in-progress This issue is being actively worked on. p1
Projects
None yet
2 participants