cloudmapper icon indicating copy to clipboard operation
cloudmapper copied to clipboard

Fn::Select cannot select nonexistent value at index 1

Open acidflash opened this issue 5 years ago • 6 comments

Hi, I try to deploy CloudmapperauditorStack and when i try to run aws-vault exec XXXX -- cdk deploy and when the Docker container is public to the ECS i get this error msg

CloudmapperauditorStack: creating CloudFormation changeset... 

❌  CloudmapperauditorStack failed: Error [ValidationError]: Template error: Fn::Select  cannot select nonexistent value at index 1
    at Request.extractError (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/protocol/query.js:50:29)
    at Request.callListeners (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/home/linuxbrew/.linuxbrew/Cellar/aws-cdk/1.31.0/libexec/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
  message: 'Template error: Fn::Select  cannot select nonexistent value at index 1',
  code: 'ValidationError',
  time: 2020-03-30T09:51:53.741Z,
  requestId: 'b89c8655-f4d9-4ae0-baa3-986f092e0056',
  statusCode: 400,
  retryable: false,
  retryDelay: 270.25564448676766
}
Template error: Fn::Select  cannot select nonexistent value at index 1

Regards Jonas

acidflash avatar Mar 30 '20 11:03 acidflash

I'm also seeing this error from a CodeBuild task we set up to install cloudmapper:

Build output:

[100%] success: Published 8b8291b3d2d332689f14d0a420eadbb9234f5975e9a6f384e5a7f7f610c0f620:current
CloudmapperauditorStack: creating CloudFormation changeset...
 X CloudmapperauditorStack failed: ValidationError: Template error: Fn::Select  cannot select nonexistent value at index 1
Template error: Fn::Select  cannot select nonexistent value at index 1
[Container] 2020/04/01 17:19:04 Command did not exit successfully cdk deploy --require-approval never exit status 1

ejohn20 avatar Apr 01 '20 17:04 ejohn20

This appears to be due to a breaking change in the CDK v1.31.0. I have not examined the CDK code in Cloudmapper to see what exactly is causing the error; however installing an older version of the CDK seems to correct the issue.

UPDATE: Confirmed that this fails in v1.31.0, v1.30.0, and v1.29.0.

Rolling back to v1.28.0 or earlier seemed to work for me:

npm install [email protected]

ejohn20 avatar Apr 01 '20 18:04 ejohn20

Rolling back to v1.28.0 or earlier seemed to work for me:

npm install [email protected]

Yes, can confirm downgrade works out for me also.

acidflash avatar Apr 03 '20 13:04 acidflash

Hello @ejohn20 and @acidflash ! I can see here: https://github.com/duo-labs/cloudmapper/blob/bebf0d1a8f785b5d99995a9f120426b6ab3df4ee/auditor/package.json#L25 That it's using the version 1.71.0 or higher, if I understood correctly.

But you were saying that it failed in versions 1.31.0, 1.30.0 and 1.29.0. That's a lot of versions in between. Can you try again and see if it gives the same errors?

Thank you!

w0rmr1d3r avatar Mar 16 '21 09:03 w0rmr1d3r

All good on my side. We've upgraded to this commit and CDK version, and it works:

MAPPERBRANCH: 'main'
MAPPERCOMMIT: '4f5ec6f6eaffdef4c8d14a628215747b548fbc2d'
# 2020-12-07 - release
...
npm install -g [email protected]

ejohn20 avatar Mar 16 '21 13:03 ejohn20

Great! Shall we upgrade the aws-cdk from 1.71.0 to 1.76.0 ?

w0rmr1d3r avatar Mar 16 '21 14:03 w0rmr1d3r