circlecicircleci-2.0circleci-workflows

CircleCI 2.0 Scheduled workflow not running


I have a scheduled workflow that stopped running all of the sudden. Its supposed to run once a week, the last time it ran the config looked like

workflows:
  version: 2
  commit-workflow:
    jobs:
      - deploy-dev:
          context: msd-npn-site-deploy
      - deploy-stg:
          requires:
            - deploy-dev
          context: msd-npn-site-deploy
  scheduled-workflow:
    triggers:
      - schedule:
          cron: "0 5 * * 1"
          filters:
            branches:
              only:
                - master
    jobs:
      - build-ami:
          context: msd-npn-packer-credentials
      - refresh-dev:
          requires:
            - build-ami
          context: msd-npn-site-deploy
      - hold:
          type: approval
          requires:
            - refresh-dev
      - refresh-stg:
          requires:
            - hold
          context: msd-npn-site-deploy

During its run it failed on the refresh-stg step. I then changed it to

workflows:
  version: 2
  commit-workflow:
    jobs:
      - deploy-dev:
          context: msd-npn-site-deploy
      - deploy-stg:
          requires:
            - deploy-dev
          context: msd-npn-site-deploy
      - hold:
          type: approval
          requires:
            - deploy-stg
      - deploy-prod:
          requires:
            - hold
          context: msd-prod-site-deploy
  scheduled-workflow:
    triggers:
      - schedule:
          #cron: "0 5 * * 1"
          cron: "* * * * *"
          filters:
            branches:
              only:
                - master
    jobs:
      - build-ami:
          context: msd-npn-packer-credentials
      - refresh-dev:
          requires:
            - build-ami
          context: msd-npn-site-deploy
      - hold:
          type: approval
          requires:
            - refresh-dev
      - refresh-stg:
          requires:
            - hold
          context: msd-npn-site-deploy
      - hold:
          type: approval
          requires:
            - refresh-stg
      - refresh-prod:
          requires:
            - hold
          context: msd-prod-site-deploy

and it stopped running. I now have the cron set to run every minute to test cron: "* * * * *" and it is not running at all. The commit workflow is working. The branch master is correct


Solution

  • The problem was that I had two approval jobs with the same name hold. Giving them different names fixed it.