"CircleCI was unable to execute the job to completion"

I’m having a big problem. Every time my build is being executed it gets canceled mid-way through the job for no obvious reason.

I get the following error message:

CircleCI was unable to execute the job to completion, because the CircleCI agent received a kill signal midway through the job.

This means that that either the agent got killed accidentally (through a killall command), or that the build container entrypoint (i.e. PID 1) allocated too much memory or terminated early. Consider clearing entrypoint/command values and try again.

My config.yml looks like following:

version: 2
jobs:
  build:
    working_directory: ~/repo

    docker:  
      # specify the version you desire here
      - image: circleci/php:7.1-apache-node-browsers
        command: |
          sudo docker-php-ext-install pdo_mysql
          sudo docker-php-ext-enable pdo_mysql

      - image: circleci/mysql:5.6
        environment:
          MYSQL_ROOT_PASSWORD: somewordpress
          MYSQL_DATABASE: wordpress
          MYSQL_USER: wordpress
          MYSQL_PASSWORD: wordpress

    steps:
      # Checkout from GIT
      - checkout

      # Test DB Connection
      - run:
          name: Install MySQL CLI
          command: |
            sudo apt-get install mysql-client
            mysql -u wordpress -pwordpress wordpress < sql-data/dummy.sql
      - run:
          name: Execute DB test
          command: |
            php -f index.php

Does anyone have an idea why this is happening?

Could you try executing this:

          sudo docker-php-ext-install pdo_mysql
          sudo docker-php-ext-enable pdo_mysql

In your Execute DB test step?

      - run:
          name: Execute DB test
          command: |
            sudo docker-php-ext-install pdo_mysql
            sudo docker-php-ext-enable pdo_mysql
            php -f index.php

What happens if you try to run this in an SSH session? Can you inspect dmesg after that to see if any processes had to be sacrificed?

Edit

Ah, @Cormac is right - you are trying to run a custom command in the context of running your build container. I am surprised your container starts at all.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.