How to run sam local start-api

When I run sam local start-api in the jbo, I always get Build was canceled. My configuration is like this. Main purpose is invoke sam local start-api and get response with curl.

I have no idea to fix it.

version: 2

jobs:
  deploy-dev:
    machine: true
    steps:
      - checkout
      - run:
          name: load latest
          command: |
            cd /opt/circleci/.pyenv
            git pull
      - run:
          name: install python 3.6.3
          command: |
            pyenv install 3.6.3
            pyenv global 3.6.3
      - run:
          name: sam build
          command: |
            pip install pipenv
            python -m venv venv
            source venv/bin/activate

            pip install aws-sam-cli

            sam build --use-container

            sam local start-api
          background: true
      - run:
          name: curl
          command: |
            curl -X GET http://127.0.0.1:3000/hello

workflows:
  version: 2
  aws-sam-build:
    jobs:
      - deploy-dev

Hello

We are following up on old tickets in the hope of helping people who run into this issue.

We have taken a look into your config.yml and when rerunning the job using SSH there is much more output in regards to the issue.

To resolve the issue you just need to add export LC_ALL=C.UTF-8 and export LANG=C.UTF-8 to your san build job as shown below.

      - run:
          name: sam build
          command: |
            export LC_ALL=C.UTF-8
            export LANG=C.UTF-8

Once this has been done you should be able to continue to build without issue.

Kind Regards
Owen Oliver