Repository navigation
SessionManagerPlugin is not found while session-manager-plugin --version is successful #8707
|
Hello, I'm trying to automate a few aws cli commands through a raycast extension, but when running commands through nodejs execSync I get a weird behaviour. For instance, if I try to run the following: It returns the following So I'm a bit puzzled here why running aws ssm start-session would fail if session-manager-plugin is successful I only have this outcome using execSync but I'd really like to understand how it's possible for this to happen Thanks |
Replies: 1 comment 1 reply
|
This usually happens because the AWS CLI process cannot find or execute In your case (Node.js First, print the PATH that Node sees and compare it with your terminal: node -e "console.log(process.env.PATH)" Then run the AWS CLI with an explicit PATH (adjust the path to where the plugin is installed): PATH="/usr/local/bin:$PATH" aws ssm start-session --target i-xxx If you are on macOS with Apple Silicon, also check the architecture mismatch. If AWS CLI is running under one architecture and the plugin under another, the CLI may fail to execute it. Check architectures: file /usr/local/bin/aws file /usr/local/bin/session-manager-plugin Fix by ensuring both are installed for the same architecture (e.g., both arm64), or reinstall both via the same package manager (Homebrew is typical): brew reinstall awscli brew reinstall session-manager-plugin Finally, confirm what executable the AWS CLI is trying to use from the same environment where it fails: which aws which session-manager-plugin aws --version session-manager-plugin --version Once the PATH/architecture is consistent in the Node/Raycast environment, |
This usually happens because the AWS CLI process cannot find or execute
session-manager-pluginin the environment it actually runs in (even thoughsession-manager-plugin --versionworks in your interactive shell).In your case (Node.js
execSync), the most common cause is that Raycast/Node is running with a different PATH (or different architecture context) than your terminal, so the AWS CLI cannot launch the plugin binary.First, print the PATH that Node sees and compare it with your terminal:
node -e "console.log(process.env.PATH)"
Then run the AWS CLI with an explicit PATH (adjust the path to where the plugin is installed):
PATH="/usr/local/bin:$PATH" aws ssm start-session --target i-xxx
…