{"record":{"id":"0223d97a912c127a","repo":"basecamp/kamal","slug":"aws-cli-is-not-installed","errorCode":null,"errorMessage":"AWS CLI is not installed","messagePattern":"AWS CLI is not installed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/kamal/secrets/adapters/aws_secrets_manager.rb","lineNumber":52,"sourceCode":"      cmd = args.join(\" \")\n\n      `#{cmd}`.tap do |secrets|\n        raise RuntimeError, \"Could not read #{secrets} from AWS Secrets Manager\" unless $?.success?\n\n        secrets = JSON.parse(secrets)\n\n        return secrets[\"SecretValues\"] unless secrets[\"Errors\"].present?\n\n        raise RuntimeError, secrets[\"Errors\"].map { |error| \"#{error['SecretId']}: #{error['Message']}\" }.join(\" \")\n      end\n    end\n\n    def stringify_secret_value(value)\n      value.is_a?(String) ? value : JSON.dump(value)\n    end\n\n    def check_dependencies!\n      raise RuntimeError, \"AWS CLI is not installed\" unless cli_installed?\n    end\n\n    def cli_installed?\n      `aws --version 2> /dev/null`\n      $?.success?\n    end\nend\n","sourceCodeStart":34,"sourceCodeEnd":60,"githubUrl":"https://github.com/basecamp/kamal/blob/eee0083b38661c3707c6b6052cc89e85038a096c/lib/kamal/secrets/adapters/aws_secrets_manager.rb#L34-L60","documentation":"Before fetching, the AWS adapter's check_dependencies! runs `aws --version` and inspects $?. If the aws executable is missing from PATH (or not executable), Kamal raises RuntimeError \"AWS CLI is not installed\". Kamal never talks to AWS via the SDK here — the aws CLI is a hard requirement of this adapter.","triggerScenarios":"kamal secrets fetch -a aws_secrets_manager on a machine without the AWS CLI installed, with a broken PATH, in a minimal Docker/CI image lacking awscli, or where aws is an alias/function not visible to the subshell.","commonSituations":"Fresh macOS/Linux box; slim CI containers (alpine images without awscli); rbenv/other shims shadowing PATH so `aws` resolves nowhere; uninstalling awscli after switching profiles.","solutions":["Install AWS CLI v2: brew install awscli (macOS), or follow AWS's official install instructions for Linux (curl the official bundle) — apt's awscli is often v1 and too old","Verify the check passes: aws --version in the same shell/environment kamal runs in","For CI/Docker, add the awscli installation step to the image or pipeline before calling kamal secrets fetch"],"exampleFix":"# before\n$ kamal secrets fetch -a aws_secrets_manager RAILS_MASTER_KEY\n# RuntimeError: AWS CLI is not installed\n\n# fix (terminal)\nbrew install awscli\naws --version   # aws-cli/2.x.x\nkamal secrets fetch -a aws_secrets_manager RAILS_MASTER_KEY","handlingStrategy":"validation","validationCode":"abort \"AWS CLI v2 not installed — install from https://docs.aws.amazon.com/cli/\" unless system(\"aws --version > /dev/null 2>&1\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install awscli in the base CI image, not at runtime, to keep fetches fast and reliable","Prefer official AWS v2 installers over distro packages (apt often ships v1, which lacks batch-get-secret-value)"],"tags":["kamal","secrets","aws","dependency","aws-cli","installation"],"backgroundTag":"missing-cli-dependency","analyzedSha":"eee0083b38661c3707c6b6052cc89e85038a096c","analyzedAt":"2026-08-21T15:17:22.045Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}