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

pipelines:base directory for cdk.out not found #25842

Closed
Helgeb opened this issue Jun 3, 2023 · 6 comments
Closed

pipelines:base directory for cdk.out not found #25842

Helgeb opened this issue Jun 3, 2023 · 6 comments
Labels
@aws-cdk/pipelines CDK Pipelines library bug This issue is a bug. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@Helgeb
Copy link

Helgeb commented Jun 3, 2023

Describe the bug

The Code Pipeline fails in the Build-Step after updating from cdk 2.77.0 to 2.82.0.

Expected Behavior

The build step should be successful.

Current Behavior

The build step fails in the pipeline. The end of the output is:

[Container] 2023/06/02 20:45:29 Entering phase POST_BUILD
[Container] 2023/06/02 20:45:29 Phase complete: POST_BUILD State: SUCCEEDED
[Container] 2023/06/02 20:45:29 Phase context status code:  Message: 
[Container] 2023/06/02 20:45:29 Expanding base directory path: project_folder/cdk.out
[Container] 2023/06/02 20:45:29 Assembling file list
[Container] 2023/06/02 20:45:29 Expanding project_folder/cdk.out
[Container] 2023/06/02 20:45:29 Skipping invalid file path project_folder/cdk.out
[Container] 2023/06/02 20:45:29 Preparing to copy TEST report pytest_reports
[Container] 2023/06/02 20:45:29 Expanding base directory path:  src/
[Container] 2023/06/02 20:45:29 Assembling file list
[Container] 2023/06/02 20:45:29 Expanding src/
[Container] 2023/06/02 20:45:29 Expanding file paths for base directory src/
[Container] 2023/06/02 20:45:29 Assembling file list
[Container] 2023/06/02 20:45:29 Expanding junit.xml
[Container] 2023/06/02 20:45:29 Found 1 file(s)
[Container] 2023/06/02 20:45:29 Report export config is NO_EXPORT, skip exporting reports
[Container] 2023/06/02 20:45:29 Phase complete: UPLOAD_ARTIFACTS State: FAILED
[Container] 2023/06/02 20:45:29 Phase context status code: CLIENT_ERROR Message: no matching base directory path found for project_folder/cdk.out
no matching base directory path found for project_folder/cdk.out

Reproduction Steps

My Pipeline is defined by the following code:

    const pipeline = new pipelines.CodePipeline(this, "Pipeline", {
      pipelineName: "Pipeline",
      synth: new pipelines.CodeBuildStep("Synth", {
        input: pipelines.CodePipelineSource.codeCommit(repository, "master"),
        commands: [
          "cd project_folder",
          "npm ci",
          "npm run build",
          "npx cdk synth",
        ],
        buildEnvironment: {
          buildImage: codebuild.LinuxBuildImage.STANDARD_7_0,
        },
        partialBuildSpec: codebuild.BuildSpec.fromObject({
          phases: {
            install: {
              "runtime-versions": { python: "3.11" },
              commands: ["cd src/", "pip3 install -r requirements.txt"],
            },
            pre_build: {
              commands: ["python -m pytest --junitxml=junit.xml", "cd .."],
            },
          },
          reports: {
            pytest_reports: {
              files: ["junit.xml"],
              "file-format": "JUNITXML",
              "base-directory": "src/",
            },
          },
        }),
        primaryOutputDirectory: "project_folder/cdk.out",
      }),
      crossAccountKeys: true,
    });

Possible Solution

Downgrading to cdk 2.77.0 fixes the problem. So my first guess is, that it is related to #25392.

Additional Information/Context

No response

CDK CLI Version

2.77.0

Framework Version

No response

Node.js Version

18.16.0

OS

Ubuntu 22.04

Language

Typescript

Language Version

No response

Other information

No response

@Helgeb Helgeb added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 3, 2023
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Jun 3, 2023
@pahud
Copy link
Contributor

pahud commented Jun 5, 2023

Hi,

Looking at this doc, I noticed you specified primaryOutputDirectory: "project_folder/cdk.out" but I didn't see you cd project_folder in the ShellStep. Maybe primaryOutputDirectory is not required?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 5, 2023
@Helgeb
Copy link
Author

Helgeb commented Jun 5, 2023

There is a cd project_folder.

@Helgeb Helgeb closed this as completed Jun 5, 2023
@Helgeb Helgeb reopened this Jun 5, 2023
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 5, 2023
@peterwoodworth
Copy link
Contributor

Downgrading to cdk 2.77.0 fixes the problem. So my first guess is, that it is related to #25392.

Can you please test if 2.78.0 causes it to break for you?

@peterwoodworth peterwoodworth added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 6, 2023
@Helgeb
Copy link
Author

Helgeb commented Jun 6, 2023

Weird, after updating again the error doesn't occur. I don't see what I changed but I will close the Issue.

@Helgeb Helgeb closed this as completed Jun 6, 2023
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library bug This issue is a bug. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants