CircleCI build errors but passes on local

Hi,

I am using CircleCI to run my tests in CI. The tests seem to fail on the CI but pass on the local. Here is the log. I tried SSH to get into the container to see what is the time it takes in the container but it stalls there too.

I have simply downgraded the TypeScript version in the PR and it causes no regressions in the local. I have disabled the caching mechanisms but no luck.

These are the last lines:

Using 1 worker with 2048MB memory limit
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.afterWrite [as oncomplete] (net.js:779:14)
Emitted 'error' event at:
    at onwriteError (_stream_writable.js:431:12)
    at onwrite (_stream_writable.js:456:5)
    at _destroy (internal/streams/destroy.js:40:7)
    at Socket._destroy (net.js:604:3)
    at Socket.destroy (internal/streams/destroy.js:32:8)
    at WriteWrap.afterWrite [as oncomplete] (net.js:781:10)
Traceback (most recent call last):
  File "scripts/build.py", line 1270, in <module>
    build()
  File "scripts/build.py", line 1263, in build
    build_using_webpack()
  File "scripts/build.py", line 530, in build_using_webpack
    subprocess.check_call(cmd, shell=True)
  File "/usr/local/lib/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'node_modules/webpack/bin/webpack.js --config webpack.prod.config.ts' returned non-zero exit status 1
Exited with code 1

I can’t understand what’s causing the error.

This is my config file:

var_for_docker_image: &docker_image circleci/python:2.7.14-jessie-browsers

anchor_for_job_defaults: &job_defaults
  working_directory: /home/circleci/oppia
  docker:
    - image: *docker_image

anchor_for_installing_dependencies: &install_dependencies
  name: Install dependencies
  command: |
    source scripts/setup.sh || exit 1
    source scripts/setup_gae.sh || exit 1
anchor_for_restoring_cache: &restore_cache
  keys:
    - setup-files-cache-{{ checksum "date" }}
    - third-party-cache-{{ checksum "date" }}

version: 2
jobs:
  setup:
    <<: *job_defaults
    steps:
      - checkout
      - run: date +%F > date
      # - restore_cache:
      #     <<: *restore_cache
      - run:
          <<: *install_dependencies
      - save_cache:
          key: setup-files-cache-{{ checksum "date" }}
          paths:
            - node_modules/
            - ../oppia_tools/

  lint_tests:
    <<: *job_defaults
    steps:
      - checkout
      - run: date +%F > date
      - restore_cache:
          <<: *restore_cache
      - run:
          name: Run lint tests
          command: |
            bash scripts/install_third_party.sh
            python scripts/third_party_size_check.py
            python scripts/pre_commit_linter.py --path=. --verbose
      - save_cache:
          key: third-party-cache-{{ checksum "date" }}
          paths:
            - third_party/

  frontend_tests:
    <<: *job_defaults
    steps:
      - checkout
      # - run: date +%F > date
      # - restore_cache:
      #     <<: *restore_cache
      - run:
          name: Run frontend tests
          command: |
            bash -x scripts/run_frontend_tests.sh --run-minified-tests=true
      - run:
          name: Generate frontend coverage report
          command: |
            sudo pip install codecov
            codecov --file ../karma_coverage_reports/coverage-final.json
          when: on_success

  backend_tests:
    <<: *job_defaults
    steps:
      - checkout
      # - run: date +%F > date
      # - restore_cache:
      #     <<: *restore_cache
      - run:
          name: Run backend tests
          command: |
            bash scripts/run_backend_tests.sh --generate_coverage_report --exclude_load_tests
      - run:
          name: Generate backend coverage report
          command: |
            sudo pip install codecov
            codecov
          when: on_success

workflows:
  version: 2
  circleci_tests:
    jobs:
      - setup
      # These lines are commented out because lint tests are being run on Travis CI.
      # - lint_tests:
      #     requires:
      #       - setup
      - frontend_tests:
          requires:
            - setup
      - backend_tests:
          requires:
            - setup
notify:
  webhooks:
    # A list of hook hashes, containing the url field
    # gitter hook
    - url: https://webhooks.gitter.im/e/71ac71505d1d45161035

I think the version of NodeJS on this image could be very old. Can you try circleci/python:2.7.16-jessie-node-browsers and see if that works better?