0

I created a code pipeline with Zappa code and connected to bitbucket. I tried to build it but it is failed at codebuild step stating error.

COMMAND_EXECUTION_ERROR Message: Error while executing command: source venv/bin/activate. Reason: exit status 127

This is my buildspec.yml file

version: 0.2
phases:
  install:
    commands:
      - echo Setting up virtualenv
      - python -m venv venv
      - source venv/bin/activate
      - echo Installing requirements from file
      - pip install -r requirements.txt
  build:
    commands:
      - echo Build started on `date`
      - echo Building and running tests
      - python tests.py
  post_build:
    commands:
      - aws s3 cp backend-env s3://${S3_BUCKET} --recursive
      - echo Build completed on `date`
      - echo Starting deployment
      - zappa update dev
      - echo Deployment completed
  • The actual error is `source: not found`. Presumably it's using `sh` instead of Bash. (Please don't post screen shots of error messages; instead, post the actual error message, as a copy/paste.) – tripleee Sep 05 '20 at 09:14
  • You can probably avoid the error and several others by doing `./venv/bin/python -m pip install -r requirements.txt` in a single step. – tripleee Sep 05 '20 at 09:15
  • how can i counter this problem?what should i have to change in installation phase – Diwakar Soni Sep 05 '20 at 09:17
  • @tripleee Command did not exit successfully ./venv/bin/python -m pip install -r requirements.txt exit status 127 I tried but i am still getting error [Container] 2020/09/05 09:27:14 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: ./venv/bin/python -m pip install -r requirements.txt. Reason: exit status 127 – Diwakar Soni Sep 05 '20 at 09:43
  • Again the actual error is probably in a previous line which you didn't include. The portable replacement for `source` is `.` (just a dot). – tripleee Sep 05 '20 at 11:32

0 Answers0