Questions tagged [aws-codebuild]
Describes Amazon Web Services CodeBuild questions and answers. Scope should be limited to AWS CodeBuild.
1,177
questions
43votes
6answers
47kviews
ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc' in AWS CodeBuild
ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc'
(/python3.7/site-packages/botocore/docs/bcdoc/init.py)
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7....
34votes
6answers
22kviews
CodeBuild execution continues after build fails instead of stopping
I'm building a CI/CD pipeline using git, codebuild and elastic beanstalk.
During codebuild execution when build fails due to syntax error of a test case, I see codebuild progress to next stage and ...
31votes
5answers
36kviews
toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading
Why does this happen, when I want to build an image from a Dockerfile in CodeCommit with CodeBuild?
I get this Error:
toomanyrequests: You have reached your pull rate limit. You may increase the ...
27votes
13answers
55kviews
How to increase the maximum size of the AWS lambda deployment package (RequestEntityTooLargeException)?
I upload my lambda function sources from AWS codebuild. My Python script uses NLTK so it needs a lot of data. My .zip package is too big and an RequestEntityTooLargeException occurs. I want to know ...
26votes
2answers
13kviews
Selecting other branch instead of master as a source repository on AWS CodeBuild
How to specify different branch instead of master branch on AWS code deploy while using Github as source provider ? I see there is no option to select in the console to select branch(may be I missed).
...
24votes
2answers
17kviews
DOWNLOAD_SOURCE Failed AWS CodeBuild
Whenever I start AWS CodeBuild I get this type of error every time. please help.
DOWNLOAD_SOURCE Failed 3 mins, 2 secs
Get
https://github.com/themithunbiswas/test-...
23votes
3answers
38kviews
How to pass environment variable to the buildspec.yml for AWS codebuild
I have the following command in my buildspec.yml file in my gatsby site root directory.
version: 0.2
phases:
install:
commands:
- npm i npm@latest -g
- npm install --global gatsby-...
22votes
7answers
25kviews
AWS CodeBuild + CodePipeline: "No matching artifact paths found"
I am attempting to get CodePipeline to fetch my code from GitHub and build it with CodeBuild. The first (Source) step works fine. But the second (Build) step fails during the "UPLOAD_ARTIFACTS" part. ...
22votes
2answers
16kviews
How to run docker-compose on AWS CodeBuild?
I'm trying to setup automated Rails tests on AWS CodeBuild using docker-compose, but it errors out.
In buildspec.yml:
phases:
build:
commands:
- docker-compose up -d
[Container] 2018/...
21votes
2answers
16kviews
Is there a way to change directory on AWS codebuild
With Snap-CI going away I've been trying to get our builds working on AWS CodeBuild. I have my buildspec.yml built out, but changing directories doesn't seem to work.
version: 0.1
phases:
install:
...
21votes
6answers
16kviews
Get GitHub git branch for AWS CodeBuild
I'm setup AWS CodeBuild to build automatically from GitHub. Other CI services provide an environment variable for the branch, but I can't find one for AWS CodeBuild. There is a ...
21votes
2answers
7kviews
AWS CodeBuild – Build does not have internet connectivity. Please check subnet network configuration
I am experimenting with CodeBuild but have reached a dead-end. My build always fails with the error message:
Build does not have internet connectivity. Please check subnet network configuration.
I ...
21votes
4answers
11kviews
Setting credentials for https git clone in AWS CodeBuild
I am running a CodeBuild on a project that has private requirements stored in CodeCommit.
I need to add a command in buildspec.yml that loads the https git credentials so git clone works when ...
19votes
2answers
5kviews
AWS CodeBuild local cache failing to actually cache?
I've been trying to get AWS CodeBuild's local cache to work and for the life of me I can't get even the most basic cache to work. My ultimate goal is to cache Gradle artifacts, as discussed here.
...
19votes
2answers
9kviews
CodePipeline: ECR source + ECS deploy configuration
Basically, I need to configure CI/CD with bitbucket source code to ECS containers. I want to use CodePipline to deploy new ECR image to ECS.
Currently, there is no option in AWS CodePipline to ...
18votes
5answers
24kviews
AWS CodeBuild buildspec.yml get all files and subfolders recursively
I'm trying to use AWS CodeBuild to get all files and subfolders inside a nested public folder and deploy to an S3 bucket using CodePipeline. I was able to hook them all together but struggling to ...
17votes
3answers
13kviews
AWS Codebuild puting all artifacts in root of S3 bucket
I'm building a project that puts all of it's files in a 'dist' folder, and running it through CodeBuild. I'm trying to get it to put all of the files and folders in 'dist' into the root of the s3 ...
16votes
1answer
5kviews
CodeStar/CodeBuild Role X trusts too many services, expected only 1
I'm testing out CodeStar with the default NodeJS & serverless template. For some reason this template defaults to nodejs 8.11 for the runtime environment and 6.10 for the build environment.
In ...
16votes
5answers
20kviews
AWS Codebuild fails while downloading source. Message: Access Denied
I created a CodeBuild Project that uses a docker image for node8. The purpose of this CodeBuild project is to do unit testing. It takes an input artifact from CodeCommit. And in the buildspec.yml it ...
15votes
5answers
9kviews
Cannot run `source` in AWS Codebuild
I am using AWS CodeBuild along with Terraform for automated deployment of a Lambda based service. I have a very simple buildscript.yml that accomplishes the following:
Get dependencies
Run Tests
Get ...
15votes
3answers
6kviews
Export existing CodePipeline/CodeBuild projects to Cloudformation
Is there a way to export existing CodePipeline/CodeBuild projects to Cloudformation?
I'm in the process of converting our existing CI/CD infrastructure into code so it would be easy to replicate them ...
15votes
3answers
17kviews
YAML_FILE_ERROR: YAML file does not exist
I'm trying to implement a pipeline on AWS, but I get an error:
YAML_FILE_ERROR: YAML file does not exist
I don't know why. I'm using github repo for mean stack project, entry file is docker-compose. ...
15votes
5answers
4kviews
Github monorepo as source for AWS CodePipeline
We use the monorepo approach for storing our source in github.
Is it currently possible to have CodePipeline trigger only on a commit to a particular subfolder.
This is something that is currently ...
15votes
2answers
4kviews
AWS codeBuild/codePipeline with serverless framework
I am trying to automate Deployment Pipeline for my application. Here is the automation architecture, I came up with:
As you can see, I am using codePipeline and codeBuild to automate my deployment. ...
14votes
2answers
10kviews
AWS CodeBuild failed CLIENT_ERROR: authorization failed for primary source and source version
I have already authenticated the GitHub account.
My AWS CodePipeline is failing with this error:
CLIENT_ERROR: authorization failed for primary source and source version
14votes
1answer
19kviews
Codebuild aws command not found when ran?
I'm trying to get a simple docker app to build using AWS codebuild, but I am coming across an error where the aws command is not found:
[Container] 2016/12/10 04:29:17 Build started on Sat Dec 10 04:...
14votes
3answers
7kviews
How to set Branch Filter option in AWS CodeBuild cloudformation template?
If using a Github repository as a source in a CodeBuild project, the Branch Filter option allows to run builds only for branches, whose name is matching a certain regular expression.
AWS Management ...
14votes
1answer
2kviews
How do I fix EACCES: permission denied, open
I see the following error when executing
npm install -g serverless via buildspec.yml from AWS Codebuild
storage-engine@3.0.7 postinstall /usr/local/lib/node_modules/serverless/node_modules/storage-...
13votes
2answers
9kviews
YAML_FILE_ERROR Message: Wrong number of container tags, expected 1
I am new to AWS CodePipeline and I am getting this Error on AWS CodeBuild
"YAML_FILE_ERROR Message: Wrong number of container tags, expected 1"
I have setup AWS CodePipeline with CodeBuild and ...
13votes
1answer
6kviews
Using IAM roles on the AWS CodeBuild worker
Is there a way to grant IAM instance roles to be used by the build process?
In my particular case I need to perform some s3 operations during build (unrelated to archiving artifacts).
So far the ...
13votes
2answers
4kviews
Viewing Unit Test and Coverage Reports Generated in AWS CodeBuild
I am using AWS CodeBuild to run unit tests for my python project using pytest. I am using the --junitxml argument and the pytest-cov package to generate test reports and coverage reports that I've ...
13votes
1answer
4kviews
AWS CodeBuild does not work with Yarn Workspaces
I'm using Yarn Workspaces in my repository and also using AWS CodeBuild to build my packages. When build starts, CodeBuild takes 60 seconds to install all packages and I'd want to avoid this time ...
12votes
5answers
9kviews
Getting Commit ID in CodePipeline
I am using CodePipeline with CodeCommit. Builds are triggered automatically with push to master branch. In CodePipeline console it is clearly visible that i am receiving commit id but i need to get it ...
12votes
1answer
10kviews
What is the difference between HEAD_REF vs BASE_REF in AWS Codebuild git webhook?
I want to set a build webhook when a PullRequest is opened from dev branch to master branch. AWS Codebuild has a webhook based on HEAD_REF and BASE_REF which lacks detailed documentation.
What do ...
12votes
3answers
8kviews
Receive "Not authorized to perform DescribeSecurityGroups" when creating new Project in AWS CodeBuild
I am trying to create a new project in AWS CodeBuild. Every time I attempt to I receive the following error:
Not authorized to perform DescribeSecurityGroups
Any help would be greatly appreciated.
12votes
3answers
18kviews
AWS CodePipeline, build failed & getting error as YAML_FILE_ERROR M
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 ...
12votes
4answers
27kviews
Code build is failed with Error while executing command: npm install. Reason: exit status 127
I created a code pipeline with very simple code and connected to codecommit. tried to build it but it is failing at codebuild step stating error executing npm install. Am I missing something? Sorry I ...
12votes
3answers
6kviews
How can I have multiple CodeBuild buildspec files in different directories?
I have a large monorepo with many projects in it. I want to have many build jobs, each using a buildspec in the relevant tree in the repo.
For example, I have a lambda function called Email, and a ...
11votes
2answers
3kviews
AWS CodeBuild ECR CannotPullContainerError
CodeBuild project fails at the Provisioning phase due to the following error
BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE: Unable to pull customer's container image. CannotPullContainerError: Error response ...
11votes
5answers
6kviews
Unable to create AWS CodeBuild Webhook
I'm trying to create a webhook via AWS CodeBuild and this is the error I receive.
I've also tried creating the webhook via AWS CLI using the following command:
aws codebuild create-webhook --project-...
11votes
2answers
7kviews
AWS CodeBuild VPC_CLIENT_ERROR: Unexpected EC2 error: UnauthorizedOperation
I created CodeBuild project in a custom VPC and in private subnet.
Private subnet has internet access, also AWS console confirms that internet connection is for this code build project. I keep getting ...
11votes
3answers
7kviews
CodeDeploy to S3
I have a site in a S3 bucket, configured for web access, for which I run an aws s3 sync command every time I push on a specific git repository (I'm using Gitlab at the moment).
So if I push to stable ...
11votes
2answers
10kviews
How to handle multiple environments in CodePipeline?
I'm using code pipeline to deploy my infrastructure and I would like to be able to deploy it in different environments (dev, staging, prod,...).
I currently have a buildspec.yml file containing some "...
11votes
2answers
2kviews
CodeBuild (AWS) from CodePipeline (AWS) is not working
I have created a code build project from code pipeline wizard with all the necessary required options and valid IAM role. I have added IAM role policy as well which is required for accessing and ...
11votes
2answers
4kviews
AWS CodeBuild Github webhook does not update status of PullRequest
Using the official guide, created build project to run tests on GitHub PullRequests creation. The webhook is correctly shown on GitHub, builds are being triggered in Codebuild, however, the build ...
10votes
4answers
4kviews
AWS CodePipeline build lacks Git history
Context:
I have a CodePipeline set up that uses CodeCommit and CodeBuild as its source and build phases.
My build includes a plugin (com.zoltu.git-versioning) that uses the Git commit history to ...
10votes
3answers
6kviews
How to use output artifact of CodeBuild in CloudFormation?
So I have a fairly simple stack I'm trying to setup consisting of a single Lambda function subscribed to an SNS topic. I'd like to use CodePipeline with three stages: Source (GitHub) -> Build (...
10votes
5answers
6kviews
AWS CodeBuild as non-root user
Is there a way to drop root user on AWS CodeBuild?
We are building a Yocto project that fails on CodeBuild if we're root (Bitbake sanity check).
Our desperate approach doesn't work either:
...
...
10votes
1answer
17kviews
AWS CodeBuild error on DOWNLOAD_SOURCE: CLIENT_ERROR: repository not found for primary source and source version
I'm trying to create a CodeBuild project using Terraform, but when I build I'm getting the following error on the DOWNLOAD_SOURCE step:
CLIENT_ERROR: repository not found for primary source and ...
10votes
3answers
3kviews
AWS CodeBuild Badge update on CodePipeline trigger
I've created an AWS CodeBuild project that includes a build badge and when I trigger the build manually, all works OK (i.e. the badge is updated). I've now added a CodePipeline project that triggers ...