apptension / saas-boilerplate

SaaS Boilerplate - Open Source and free SaaS stack that lets you build SaaS products faster in React, Django and AWS. Focus on essential business logic instead of coding repeatable features!
https://apptension.com/saas-boilerplate
MIT License
2.12k stars 232 forks source link

Deployment error: Error in Bootstrap CDK #608

Open Mahadeb369 opened 1 month ago

Mahadeb369 commented 1 month ago

Describe the bug

After completing the first step of configuration of AWS credentials and configure the hosted zone successfully, when I try to run pnpm saas infra bootstrap, it always throws me the error which I mentioned in the logs section. It's not only happening with this command, it also happening, when I try to run pnpm saas aws login.

Steps to reproduce

  1. Set up the aws-vault according to the documentation.
  2. Configure the hosted zone in AWS Route53 according to the second step of the documentation.
  3. Run pnpm saas infra bootstrap or pnpm saas aws login.
  4. Get the error.

System Info

System:
    OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (2) x64 Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
    Memory: 4.39 GB / 7.63 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
    pnpm: 9.6.0 - ~/.nvm/versions/node/v20.15.0/bin/pnpm

Logs

ubuntu@ip-172-31-41-178:~/my-space/saas-boilerplate$ pnpm saas infra bootstrap

------ Notice ------
This CLI collects various anonymous events, warnings, and errors to improve the CLI tool and enhance your user experience.
Read more: https://docs.demo.saas.apptoku.com/working-with-sb/dev-tools/telemetry
If you want to opt out of telemetry, you can set the environment variable SB_TELEMETRY_DISABLED to 1 in your shell.
For example:
   export SB_TELEMETRY_DISABLED=1

    Error: Command failed: aws-vault export saas
    Enter passphrase to unlock "/home/ubuntu/.awsvault/keys/": aws-vault: error: exec: Failed to get credentials for saas: operation error STS: 
    AssumeRole, failed to sign request: failed to retrieve credentials: inappropriate ioctl for device

    Code: 1
ubuntu@ip-172-31-41-178:~/my-space/saas-boilerplate$ 
Click to expand! In the error you can see, it always asking to enter the passphrase to execute the aws-vault command successfully. But after running the "pnpm saas ..." commends there is no scope to enter the passphrase explicitly or implicitly. **My aws-vault setup (~/.aws/config):** ```shell [profile my-profile] region=eu-west-1 [profile saas] source_profile = my-profile role_arn = arn:aws:iam::123456:role/ProdAdminRole region=eu-west-1 ```

Validations

mkleszcz commented 1 month ago

It looks like you have some configuration issue. Is the above ~/.aws/config file content literally copy and paste or you changed the AWS account id? Because I bet your account is not 123456 :) Try to validate the AWS config by running aws-vault exec saas -- /bin/bash

Mahadeb369 commented 1 month ago

It is obvious that I will not share my actual AWS account ID here. I just edited that part.

I have checked all the credentials and everything is correct. I also validated the AWS config by running aws-vault exec saas. Here is the output:

ubuntu@ip-172-31-41-178:~/my-space/saas-boilerplate$ aws-vault --version
v7.2.0
ubuntu@ip-172-31-41-178:~/my-space/saas-boilerplate$ aws-vault exec saas
Enter passphrase to unlock "/home/ubuntu/.awsvault/keys/": 
Starting subshell /bin/bash, use `exit` to exit the subshell
ubuntu@ip-172-31-41-178:~/my-space/saas-boilerplate$

As you can see, it asks for a passphrase to execute the command. After entering the passphrase, it successfully starts a subshell. However, when I run pnpm saas infra bootstrap, it does not prompt or provide any option for me to enter the passphrase. That is the issue.

mkleszcz commented 1 month ago

Ok, now I know what the issue is. Looks like the NX doesn't allow for shell input... On OSX this is not an issue because there is a system prompt for a password to keychain. We need to figure it our how to fix this on linux.