13

I'm new to AWS CodePipeline and never had past experience with any continuous integration tool like Jenkins, etc. I have created a new AWS CodePipeline as AWS CodeCommit (Code repository) -> CodeBuild (not docker, and environment is NodeJS 7)-> AWS CodeDeploy. Everything is on AWS only. It is an Angular2 project which is running finally deployed on EC2 instances (Windows server 2008). From my local machine, I'm able to commit my code to AWS CodeCommit through active IAM user (Git access) and then I can see CodePipleline starts functioning where Source is fine (green in color) but next step i.e. Build fails (red in color). When I click on its details, I can see following error log :-

https://forums.aws.amazon.com/ 2016/12/23 18:21:16 Waiting for agent https://forums.aws.amazon.com/ 2016/12/23 18:21:36 Phase is DOWNLOAD_SOURCE https://forums.aws.amazon.com/ 2016/12/23 18:21:38 Phase complete: DOWNLOAD_SOURCE Success: false https://forums.aws.amazon.com/ 2016/12/23 18:21:38 Phase context status code: YAML_FILE_ERROR Message: YAML file does not exist https://forums.aws.amazon.com/ 2016/12/23 18:21:38 Runtime error (YAML file does not exist)

Can somebody please guide me on this error? I do not know what does this YAML file means. I googled but nothing relevant found in terms of my NodeJS Angular project.

Thank you, Vinod Kumar

Vinod Kumar
  • 665
  • 3
  • 13
  • 31
  • For me, I didn't have a line between the `phases` and the `artifacts`. If you do not have a new line between them, you will get this error too. – Jeremy Jul 09 '20 at 18:01

3 Answers3

17

The YAML file being referenced is the buildspec.yml file required by CodeBuild. More information can be found at http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html

Eric Johnson
  • 318
  • 2
  • 3
  • 2
    Often the user adds the buildspec.yml file but forgets to push it to the repository before executing the CodeBuild. git push your buildspec.yml file and you should be good to go. Also it must be named buildspec.yml not buildspec.yaml as of today. – Eric Nord Jan 31 '17 at 15:24
  • 2
    @EricNord I've pushed buildspec.yml in the root of my project, yet still got this error :( troubleshooting now – Elaine Apr 29 '17 at 11:23
  • 1
    @Elaine hope you've found it. If not, I just encountered something similar and apparently Codebuild is very picky about spaces / tabs. I converted all tabs to spaces and removed the spaces on an empty line. Hope this helps – Jevado Jul 02 '17 at 15:26
0

Already answered but just adding in just in case someone else encounters this issue.

Yaml files are usually associated with .yaml or .yml extensions.

Code build seems to look for buildspec.yml, and can't see .yaml ones.

froi
  • 7,268
  • 5
  • 40
  • 78
0

Before

version: 0.2

phases:
  install:
    runtime-versions:
      java: openjdk8
    commands:
      - echo intall
  pre_build:
    commands:
      - echo pre_build
  build:
    commands:
      - mvn package
      - echo build
  post_build:
    commands:
      - echo post_build

 artifacts:     
   files:
    - target/spring-boot-rest-api-h2-aws-continious-deloy-0.0.1-SNAPSHOT.jar

After Indentation

version: 0.2

phases:
  install:
    runtime-versions:
      java: openjdk8
    commands:
      - echo intall
  pre_build:
    commands:
      - echo pre_build
  build:
    commands:
      - mvn package
      - echo build
  post_build:
    commands:
      - echo post_build

artifacts:     
  files:
    - target/spring-boot-rest-api-h2-aws-continious-deloy-0.0.1-SNAPSHOT.jar
David Buck
  • 3,752
  • 35
  • 31
  • 35
  • 2
    It took me ages (and I had to edit your answer first) in order to even see that one character had changed in identation. This might be different if you have made any attempt to explain your answer and how it solves the OPs problem. – David Buck Mar 23 '20 at 21:32