Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to fork/exec /usr/bin/sh #18

Open
slipcon opened this issue Feb 10, 2022 · 1 comment
Open

unable to fork/exec /usr/bin/sh #18

slipcon opened this issue Feb 10, 2022 · 1 comment

Comments

@slipcon
Copy link

slipcon commented Feb 10, 2022

Trying to use aws-ssm-send-command, simple examples are all failing.

name: Deploy using AWS SSM Send-Command 

on:
    push:
        branches: [main]

jobs:
    start:
        runs-on: ubuntu-latest 

        steps:
            - uses: actions/checkout@v2

            - name: AWS SSM Send Command
              uses: peterkimzz/aws-ssm-send-command@master
              id: ssm
              with:
                  aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID  }}
                  aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY  }}
                  aws-region: us-gov-east-1
                  instance-ids: ${{ secrets.INSTANCE_ID  }}
                  comment: Deploy the main branch
                  working-directory: /home/ec2-user/test-gh-repo
                  command: ls -l

The github action runs successfully, I get the command ID from the output, and view it using AWS CLI, and it always says:

            "CommandPlugins": [
                {
                    "Status": "Failed",
                    "ResponseStartDateTime": 1644522501.751,
                    "StandardErrorUrl": "",
                    "OutputS3BucketName": "",
                    "OutputS3Region": "us-gov-east-1",
                    "OutputS3KeyPrefix": "",
                    "ResponseCode": 1,
                    "Output": "\n----------ERROR-------\nfailed to run commands: fork/exec /usr/bin/sh: no such file or directory",
                    "ResponseFinishDateTime": 1644522501.785,
                    "StatusDetails": "Failed",
                    "StandardOutputUrl": "",
                    "Name": "aws:runShellScript"
                }

I can't figure out why its trying to run /usr/bin/sh - nor why thats failing - it exists on our instance and works fine.

any help?

@akraxx
Copy link

akraxx commented Feb 27, 2022

Hello,

Just got the same issue, for me, it's because the working directory does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants