New branch not recognized and not building

I’ve seen this reported a number of times by a number of people. I’m having the same issue in that a newly created branch is not being picked up by CircleCI. I really don’t want to have to disconnect the entire repo and reconnect it as the other branches are working just fine. What’s the fix for this please?

Private Repo
Currently building all branches but the new one
New branch is actually for changing the CircleCI config.yml

even manually triggering it via this script didn’t work

Readers may be able to offer some guesses, but could you add your Circle config file here, so they do not have to? My guess would be that you have an ignore regex rule set up, and your non-building branch is matching the rule.

I don’t believe that’s the issue. My understanding is that it should show up as skipped even if it was.

version: 2

defaults: &docker_setup
    docker:
        - image: ${BASE}
          aws_auth:
              aws_access_key_id: ${AWS_ACCESS_KEY_ID}
              aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
        - image: circleci/postgres:10-alpine-ram
          environment:
              TZ: America/Los_Angeles
              POSTGRES_USER: {redacted}
              POSTGRES_DB: {redacted}
              POSTGRES_PASSWORD: ''
              working_directory: ~/api
              #DEPLOYMENT_VERSION: ${CIRCLE_BUILD_NUM}

references:
  ecr_login: &ecr_login
    run:
      name: Login to ECR
      command: |
        login="$(aws ecr get-login --no-include-email --region ${ECS_REGION})"
        ${login}

jobs: {removed for brevity, no filters here}

workflows:
    build:
        jobs:
            - build
            - build-and-push-container:
                  requires:
                      - build
            - deploy-to-k8s-stage:
                  requires:
                      - build-and-push-container
                  filters:
                     branches:
                          only: kubernetes
            - deploy-to-stage:
                  requires:
                      - build-and-push-container
                  filters:
                      branches:
                          only: master

following up – when posting to the proper path I get a project not found message
https://circleci.com/api/v1.1/project/github/{redacted}/api/tree/kubernetes/?circle-token=:{token}

oddly, perhaps in spite of the documentation (https://circleci.com/docs/api/#getting-started), using postman to post
https://circleci.com/api/v1.1/project/github/{redacted}/api/build?circle-token={redacted}
with a body of branch=kubernetes works.

Now that the branch has been recognized by CircleCI it seems to be picking up commits as you would expect. I’d still consider this a bug but I have managed to work around it.

thanks

I think there is one gotcha, which is that if a commit fails to build (e.g. because your YAML is invalid) it will not build until you push a new commit. I think CircleCI caches some build config per commit, so it needs a new commit to clear it out.

You could always drop a line to support@circleci.com if you want to get an engineer to see why it did not build - there may be enough behind-the-scenes logging to see what the issue was. However, if it is now building, then :+1:.

1 Like