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

[BUG] CDK bootstrap - Command failed with error 127 #112

Closed
julianpitt opened this issue Mar 12, 2024 · 1 comment · Fixed by #130
Closed

[BUG] CDK bootstrap - Command failed with error 127 #112

julianpitt opened this issue Mar 12, 2024 · 1 comment · Fixed by #130
Assignees
Labels
bug Something isn't working

Comments

@julianpitt
Copy link

Describe the bug

When running through the galileo-cli deploy command wizard on a non boostraped account, you will be asked if you want to bootstrap it. Selecting Yes to bootstrap the account will cause a Command failed with exit code 1 error.

Expected Behavior

Command to bootstrap AWS account and continue with deployment of Galileo

Current Behavior

Command fails and cli wizard terminates.

CLI output with account number removed:

✔ Region "us-west-2" is not bootstrapped in account "xxxxxxxxxxxx". Do you want to bootstrap it? … yes
✔ What managed polices should be attached to bootstrap deployment role? … arn:aws:iam::aws:policy/PowerUserAccess,arn:aws:iam::aws:policy/IAMFullAccess
/bin/sh: 1: cdk.out: not found
****************************************************
*** Newer version of CDK is available [2.132.0]  ***
*** Upgrade recommended (npm install -g aws-cdk) ***
****************************************************

Subprocess exited with error 127
    Error: Command failed with exit code 1: pnpm exec cdk bootstrap --profile default aws://xxxxxxxxxxxx/us-west-2 --cloudformation-execution-policies 
    "arn:aws:iam::aws:policy/PowerUserAccess,arn:aws:iam::aws:policy/IAMFullAccess" --app cdk.out
 ELIFECYCLE  Command failed with exit code 1.
 ```

### Reproduction Steps

Create a new AWS account.
Deploy a cloud 9 instance, then open a terminal and run the following:

Update repositories

sudo apt update -y && sudo NEEDRESTART_MODE=a apt upgrade -y

Install Node

nvm install lts/iron
nvm use lts/iron

Install pnpm

npm i -g pnpm

Install JDK

wget -O- https://apt.corretto.aws/corretto.key | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.corretto.aws stable main' -y
sudo apt-get update -y; sudo apt-get install -y java-18-amazon-corretto-jdk

Remove old aws cli v1

pip uninstall awscli -y

Install python

sudo apt install -y python3.11
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 110
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 100

NOTE: select python3.11 from the list, should be option 2

sudo update-alternatives --config python3

Install poetry

curl -sSL https://install.python-poetry.org | python3 -

Install aws cli v2

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --bin-dir $HOME/.local/bin --update
rm -rf aws
rm awscliv2.zip

pnpm install
export AWS_REGION={current aws region you're in}
export AWS_PROFILE=default
pnpm run galileo-cli deploy


In the wizard, keep all the defaults then select Y when it asks if you want to bootstrap the account


### Possible Solution

Current workaround is to explicitly set the `AWS_PROFILE` and `AWS_REGION` env variables then run `pnpm exec projen bootstrap-account`

### Additional Information/Context

Running on Cloud9 with an updated dependencies and prerequisites installed as outlined in galileo documentation

### Environment details (OS name and version, etc.)

Galileo Prerequisite Check...  system: Linux 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux pnpm: 8.15.4  node: v20.11.1  python: Python 3.11.0rc1  poetry: Poetry (version 1.8.2)  docker: Docker version 25.0.4, build 1a576c5  java: openjdk 18.0.2 2022-07-19 OpenJDK Runtime Environment Corretto-18.0.2.9.1 (build 18.0.2+9-FR) OpenJDK 64-Bit Server VM Corretto-18.0.2.9.1 (build 18.0.2+9-FR, mixed mode, sharing)  aws: aws-cli/2.15.28 Python/3.11.8 Linux/6.5.0-1014-aws exe/x86_64.ubuntu.22 prompt/off   Prerequisite check passed
@julianpitt julianpitt added the bug Something isn't working label Mar 12, 2024
@sperka sperka self-assigned this Apr 10, 2024
@sperka
Copy link
Contributor

sperka commented Apr 10, 2024

This happens because of a cornercase:

  • the project has not been built yet for the first time
  • bootstrapping is required for the first deployment

Manual workaround: build the project manually before running deploy pdk build

Fix coming soon

sperka added a commit to sperka/aws-genai-conversational-rag-reference that referenced this issue May 10, 2024
sperka added a commit to sperka/aws-genai-conversational-rag-reference that referenced this issue May 10, 2024
@sperka sperka mentioned this issue May 10, 2024
3 tasks
sperka added a commit to sperka/aws-genai-conversational-rag-reference that referenced this issue May 10, 2024
sperka added a commit to sperka/aws-genai-conversational-rag-reference that referenced this issue May 10, 2024
sperka added a commit to sperka/aws-genai-conversational-rag-reference that referenced this issue May 10, 2024
martenpayne pushed a commit that referenced this issue May 13, 2024
* fix: vscode settings update (use v1.85+)

* fix(projenrc): configUpgradeDeps at postSynth to conform with pdk upgrade

* fix(api): use custom python dep to conform with pdk upgrade

* fix(galileo-cdk): bump jsii version and add pnpm-logger dep to conform pdk upgrade

* chore(deps): upgrade pdk@0.23.31, cdk@2.137.0 and fix projen dep

* chore(deps): remove sdk/smithy version pinning, replace discont'd aws-sdk packages

* fix(website): build fails in CI

* chore(ws-api): add ws-api bootstrap

* fix(cli): non-built project bootstrap fails
fixes #112

* fix: adjust tsconfig for api and website

* fix(infra): admin user attachment depends on already created group and user

* feat(ws-api): rename to ws-api, add model and wire up with infra

* chore(deps): bump pdk to 0.23.33 and align tsconfigs for api and web

* feat(infra): wire up wsApi with lambdaAuthorizer and bump node runtime (20_x) for lambda handlers

* fix(website): popover dismissbutton and header must be present together

* feat(galileo-sdk): add streaming support to chain

* feat: dependency management and project wiring

* feat(infra): add ws connections table

* feat(infra): split inference engine handler rest/ws with shared logic

* feat(infra): merge inference and presentation stacks to avoid circular deps

* feat(ws-api): connection data persistence

* feat(website): switch to streaming respose in chat

* fix(api): poetry lockfile causes CI build error

* fix(ws-api): don't generate code for send-chat-message
jessieweiyi pushed a commit to jessieweiyi/aws-genai-conversational-rag-reference that referenced this issue May 15, 2024
* fix: vscode settings update (use v1.85+)

* fix(projenrc): configUpgradeDeps at postSynth to conform with pdk upgrade

* fix(api): use custom python dep to conform with pdk upgrade

* fix(galileo-cdk): bump jsii version and add pnpm-logger dep to conform pdk upgrade

* chore(deps): upgrade pdk@0.23.31, cdk@2.137.0 and fix projen dep

* chore(deps): remove sdk/smithy version pinning, replace discont'd aws-sdk packages

* fix(website): build fails in CI

* chore(ws-api): add ws-api bootstrap

* fix(cli): non-built project bootstrap fails
fixes aws-samples#112

* fix: adjust tsconfig for api and website

* fix(infra): admin user attachment depends on already created group and user

* feat(ws-api): rename to ws-api, add model and wire up with infra

* chore(deps): bump pdk to 0.23.33 and align tsconfigs for api and web

* feat(infra): wire up wsApi with lambdaAuthorizer and bump node runtime (20_x) for lambda handlers

* fix(website): popover dismissbutton and header must be present together

* feat(galileo-sdk): add streaming support to chain

* feat: dependency management and project wiring

* feat(infra): add ws connections table

* feat(infra): split inference engine handler rest/ws with shared logic

* feat(infra): merge inference and presentation stacks to avoid circular deps

* feat(ws-api): connection data persistence

* feat(website): switch to streaming respose in chat

* fix(api): poetry lockfile causes CI build error

* fix(ws-api): don't generate code for send-chat-message
jessieweiyi pushed a commit to jessieweiyi/aws-genai-conversational-rag-reference that referenced this issue May 26, 2024
* fix: vscode settings update (use v1.85+)

* fix(projenrc): configUpgradeDeps at postSynth to conform with pdk upgrade

* fix(api): use custom python dep to conform with pdk upgrade

* fix(galileo-cdk): bump jsii version and add pnpm-logger dep to conform pdk upgrade

* chore(deps): upgrade pdk@0.23.31, cdk@2.137.0 and fix projen dep

* chore(deps): remove sdk/smithy version pinning, replace discont'd aws-sdk packages

* fix(website): build fails in CI

* chore(ws-api): add ws-api bootstrap

* fix(cli): non-built project bootstrap fails
fixes aws-samples#112

* fix: adjust tsconfig for api and website

* fix(infra): admin user attachment depends on already created group and user

* feat(ws-api): rename to ws-api, add model and wire up with infra

* chore(deps): bump pdk to 0.23.33 and align tsconfigs for api and web

* feat(infra): wire up wsApi with lambdaAuthorizer and bump node runtime (20_x) for lambda handlers

* fix(website): popover dismissbutton and header must be present together

* feat(galileo-sdk): add streaming support to chain

* feat: dependency management and project wiring

* feat(infra): add ws connections table

* feat(infra): split inference engine handler rest/ws with shared logic

* feat(infra): merge inference and presentation stacks to avoid circular deps

* feat(ws-api): connection data persistence

* feat(website): switch to streaming respose in chat

* fix(api): poetry lockfile causes CI build error

* fix(ws-api): don't generate code for send-chat-message
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

Successfully merging a pull request may close this issue.

2 participants