aws / aws/aws-toolkit-vscode

sam commands in codecatalyst dev env may fail if they inherit the local setting

Open
#4,640 0 comments 0 reactions 0 assignees View on GitHub
bug remote-execute sam service:codecatalyst settings-configuration
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem

sam cli commands fail in codecatalyst remote dev envs if the `aws.samcli.location` setting is set in "user" settings (i.e. on the local machine).

## Steps to reproduce the issue

1. set `aws.samcli.location` to something on the local vscode settings (aka "User" settings).
- note: must be different than `/usr/local/bin/sam`
2. open a codecatalyst dev env
3. run the `AWS: Create Lambda SAM Application` command
4. the command fails:
```
2024-04-04 21:42:46 [INFO]: SAM CLI location (from settings): /opt/homebrew/bin/sam
2024-04-04 21:42:46 [ERROR]: Error creating new SAM Application. Check the logs by running the "View AWS Toolkit Logs" command from the Command Palette.
2024-04-04 21:42:46 [ERROR]: Error creating new SAM Application: 'Error: SAM CLI has an invalid version [InvalidSamCliVersion]'
```

## Expected behavior

When running in a remote context (vscode remote-ssh), sam functionality in the Toolkit should ignore the "User" scoped `aws.samcli.location` setting inherited from the local machine. Because the local machine path is usually not valid for a remote machine.

## Proposal

- Declare `aws.samcli.location` with a different scope?
- When running in a remote context, ignore `aws.samcli.location` inherited from "User"/Global scope.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the Toolkit reads the `aws.samcli.location` setting and detects a VS Code remote context, then reproduce the failure with a user-scoped local path in a CodeCatalyst dev environment. Done means SAM commands use a valid remote setting or ignore the inherited local path, while continuing to work locally.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript, vscode
Domain
cloud, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.