serverless / github-action

:zap::octocat: A Github Action for deploying with the Serverless Framework
Apache License 2.0
647 stars 169 forks source link

Error: spawnSync docker ENOENT #17

Open amaury1093 opened 4 years ago

amaury1093 commented 4 years ago

Here's the relevant connfig in my action:

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - run: yarn install
      - name: Test serverless invoke locally
        uses: serverless/github-action@master
        with:
          args: invoke local -f check-if-email-exists-serverless -d "$(cat test/payload.json)"
        env:
          SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}

I get the following error

/usr/bin/docker run --name dfb27aa9b0e04814be28211b63b4f8c5f04_6461eb --label 488dfb --workdir /github/workspace --rm -e SERVERLESS_ACCESS_KEY -e INPUT_ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/microservices/microservices":"/github/workspace" 488dfb:27aa9b0e04814be28211b63b4f8c5f04 invoke local -f check-if-email-exists-serverless -d "$(cat test/payload.json)"
Serverless: Warning the Serverless Dashboard doesn't support the following runtime: rust
Serverless: Building native Rust check-if-email-exists-serverless func...
Serverless: Dockerized Rust build encountered an error: Error: spawnSync docker ENOENT null.

  Error --------------------------------------------------

  Error: Error: spawnSync docker ENOENT
      at functions.forEach.funcName (/github/workspace/node_modules/serverless-rust/index.js:129:15)
      at Array.forEach (<anonymous>)
      at RustPlugin.build (/github/workspace/node_modules/serverless-rust/index.js:110:22)
      at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:505:55)
      at tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
      at Object.gotValue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:168:18)
      at Object.gotAccum (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:155:25)
      at Object.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
      at _drainQueueStep (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)

All the code is open source:

A quick google search links me to this issue: https://github.com/serverless/serverless/issues/5663#issuecomment-452444370

This is because that project uses serverless-rust which depends on docker. @softprops, you might want to add info about the docker requirement in the READMEs of these repos 😉

From what I understand, Docker is not running in the Github Actions VM. Is it possible to run Docker?

MadebyAe commented 2 years ago

👋🏼 amaurym

Just wondering... Did you found any work-around? I am having same issue.

MadebyAe commented 2 years ago

👋 I had a similar issue. I just added this line to my serverless.yaml

custom:
  rust:
    dockerless: true

But now I have a different issue:

Error: spawnSync cargo ENOENT

Any ideas? Thanks in advance.