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

Issue with AWS SSM Send-Command #6

Open
Sergushka opened this issue Aug 13, 2020 · 12 comments
Open

Issue with AWS SSM Send-Command #6

Sergushka opened this issue Aug 13, 2020 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@Sergushka
Copy link

Sergushka commented Aug 13, 2020

Hi,
thanks for an awesome action

I've set this role AmazonSSMFullAccess to my user and my instance also has this role.

I've added all vulnerable infrormation to secrets. When running the job I get this error
I've tried single instance and both multiple instances but no effect

instance-ids: | {{ secrets.INSTANCE_ID }} {{ secrets.INSTANCE_ID }}
instance-ids: {{ secrets.INSTANCE_ID }}

InvalidParameterType: Expected params.InstanceIds to be an Array
    at ParamValidator.fail (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:50:37)
    at ParamValidator.validateType (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:232:10)
    at ParamValidator.validateList (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:99:14)
    at ParamValidator.validateMember (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:90:21)
    at ParamValidator.validateStructure (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:75:14)
##[error]InvalidParameterType: Expected params.InstanceIds to be an Array
    at ParamValidator.validateMember (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:88:21)
    at ParamValidator.validate (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:34:10)
    at Request.VALIDATE_PARAMETERS (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/event_listeners.js:132:42)
    at Request.callListeners (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at callNextListener (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/sequential_executor.js:96:12) {
  message: 'Expected params.InstanceIds to be an Array',
  code: 'InvalidParameterType',
  time: 2020-08-13T11:14:06.846Z
} InvalidParameterType: Expected params.InstanceIds to be an Array
    at ParamValidator.fail (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:50:37)
    at ParamValidator.validateType (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:232:10)
    at ParamValidator.validateList (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:99:14)
    at ParamValidator.validateMember (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:90:21)
    at ParamValidator.validateStructure (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:75:14)
    at ParamValidator.validateMember (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:88:21)
    at ParamValidator.validate (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/param_validator.js:34:10)
    at Request.VALIDATE_PARAMETERS (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/event_listeners.js:132:42)
    at Request.callListeners (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at callNextListener (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.2/node_modules/aws-sdk/lib/sequential_executor.js:96:12)```
@peterkimzz
Copy link
Owner

peterkimzz commented Aug 14, 2020

Thank you for your comment.

Actually 1.0.2 version has some issue because of aws-sdk package, but the issue has been released at 1.0.4 version.
Please use the action, and I recommend to use single instance.

If you get same error again, let me know on this issue page.

@peterkimzz peterkimzz added the bug Something isn't working label Aug 14, 2020
@peterkimzz peterkimzz self-assigned this Aug 14, 2020
@Sergushka
Copy link
Author

I've tried kind of the same action here https://github.com/marketplace/actions/aws-ssm-send-command-temp and it works fine with the same settings

@agatha7l
Copy link

Buh

@ghost
Copy link

ghost commented Nov 11, 2020

@peterkimzz , I experienced this issue right now, I have IAM User with AmazonSSMFullAccess and I also attach AmazonSSMFullAccess roles to the instance but I got this error

/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/request.js:31
            throw err;
            ^

InvalidInstanceId: null
    at Request.extractError (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/protocol/json.js:52:27)
    at Request.callListeners (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/request.js:690:12)
    at Request.callListeners (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/master/node_modules/aws-sdk/lib/sequential_executor.js:116:18)

Edit: sorry wrong mention

@ghost
Copy link

ghost commented Nov 11, 2020

Resolved 😓 , It turned out I'm using master branch 🙏

@RazRCL
Copy link

RazRCL commented Nov 22, 2020

Hi there,
I also have issue with AWS SSM Send-Command.
My github action is running correctly, but the status of the command keep of staying "Pending" forever, how can I fix it?
this is my output:
{ Command: { CommandId: '5fab5b78-b7ac-492b-aeee-ff1ad62f0f9d', DocumentName: 'AWS-RunShellScript', DocumentVersion: '', Comment: 'Deploying staging branch', ExpiresAfter: 2020-11-22T15:39:16.677Z, Parameters: { commands: [Array], workingDirectory: [Array] }, InstanceIds: [ '***' ], Targets: [], RequestedDateTime: 2020-11-22T13:39:16.677Z, Status: 'Pending', StatusDetails: 'Pending', OutputS3BucketName: '', OutputS3KeyPrefix: '', MaxConcurrency: '50', MaxErrors: '0', TargetCount: 1, CompletedCount: 0, ErrorCount: 0, DeliveryTimedOutCount: 0, ServiceRole: '', NotificationConfig: { NotificationArn: '', NotificationEvents: [], NotificationType: '' }, CloudWatchOutputConfig: { CloudWatchLogGroupName: '', CloudWatchOutputEnabled: false }, TimeoutSeconds: 3600 } }

@peterkimzz
Copy link
Owner

Hi, @RazRCL

Sometimes I got same issue like your case, but it resolved when I rebooted or recreated an instance.
I don't know why the task is pending.

I guess it's not the error of Github action, might be aws-sdk.

Please try it and let me know.

@souravpurkait360
Copy link

souravpurkait360 commented Sep 17, 2021

/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/request.js:31
            throw err;
            ^

InvalidInstanceId: null
    at Request.extractError (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.callListeners (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/request.js:690:12)
    at Request.callListeners (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.4/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
  message: null,
  code: 'InvalidInstanceId',
  time: 2021-09-17T15:45:59.669Z,
  requestId: '4e396d23-3cf2-40d8-8d3c-412eaa7774eb',
  statusCode: 400,
  retryable: false,
  retryDelay: 43.30718366886279
}

I am getting this error. I have tried with v1.0.1, v1.0.4 and master. Same issue persists. @peterkimzz please help

Editing: This is fixed by setting security group to default. I was blocking the SSM via security group.

@vinodMS
Copy link

vinodMS commented Dec 30, 2021

Hi, @RazRCL

Sometimes I got same issue like your case, but it resolved when I rebooted or recreated an instance. I don't know why the task is pending.

I guess it's not the error of Github action, might be aws-sdk.

Please try it and let me know.

@peterkimzz Is this still an issue in 2021? I tried to use the script and the status is still pending.

@KimBitrus26
Copy link

Hi @peterkimzz everything seems to be fine on github actions but status is always pending and i have rebooted my instance as you suggested. what can i do to make it work?

@mcneilla
Copy link

I made a slight amendment in the code due to an error following the build command, but when I try and pull the code to the EC2 I get this error:

Run peterkimzz/[email protected]
with:
aws-region: ca-central-1
comment: Deploy the main branch
working-directory: /home/ec2-user/mocksocialmediawebsite
command: /bin/sh /home/ec2-user/deploy.sh
Error: Input required and not supplied: aws-access-key-id
Error: Error: Input required and not supplied: aws-access-key-id
at Object.getInput (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.1/node_modules/@actions/core/lib/core.js:78:15)
at SanitizeInputs (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.1/index.js:42:29)
at Object. (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.1/index.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11 Error: Input required and not supplied: aws-access-key-id
at Object.getInput (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.1/node_modules/@actions/core/lib/core.js:78:15)
at SanitizeInputs (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.1/index.js:42:29)
at Object. (/home/runner/work/_actions/peterkimzz/aws-ssm-send-command/1.0.1/index.js:6:18)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11

I have the .pem file, but I am not sure where or how to add this

Any advice greatly appreciated

@iamunadike
Copy link

is not .pem just learn bout github secrets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants