Q Extension fails to load with error 'amazonqLsp: failed to run (exitcode=1)'
Problem
Amazon Q VScode plugin fails to load with the following error after the latest updates.
2025-06-17 15:14:47.390 [info] lsp: Installing 'AmazonQ' Language Server v1.13.0 to: /Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0 (Attribution notice can be found at https://aws-language-servers.us-east-1.amazonaws.com/65ebf30c-d9e8-4477-b027-c60f62250433/THIRD_PARTY_LICENSES)
2025-06-17 15:14:48.955 [info] lsp: Finished preparing "AmazonQ" LSP server: '/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0'
2025-06-17 15:14:50.543 [warning] telemetry: invalid Metric: "languageServer_setup" emitted with missing fields: id
2025-06-17 15:14:50.543 [warning] amazonqLsp: Failed to start downloaded LSP, falling back to bundled LSP: amazonqLsp: failed to run (exitcode=1): PID 2591: [/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/node /Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js --nolazy --preserve-symlinks --stdio --pre-init-encryption --set-credentials-encryption-key]
2025-06-17 15:14:50.833 [warning] childProcess: Process 2595 exceeded memory threshold: 157.89 MB
2025-06-17 15:14:51.021 [info] initialized 'submitFeedback' command with default feedback id: Amazon Q
Steps to reproduce the issue
- Install plugin
- Plugin fails to launch and Shows error 'Failed to Launch Amazon Q language server failed to run.
Expected behaviour
Plugin loads and runs.
Reverting to version 1.61 resolves this issue, all versions beyond that fail with the same error.
System details (run AWS: About and/or Amazon Q: About)
- OS: Mac OS X 15.5
- Visual Studio Code version: 1.101.0
- AWS Toolkit version:
- Amazon Q version: 1.75.0
What happens if you run this in your terminal:
/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/node /Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js --nolazy --preserve-symlinks --stdio --pre-init-encryption --set-credentials-encryption-key
The following error occurs ( account number and username redacted )
TypeError: Cannot redefine property: AWSPowerUserAccess-111111111111
at Function.defineProperty (<anonymous>)
at /Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1902277
at Array.forEach (<anonymous>)
at a (/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1902223)
at constructor.loadFrom (/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1902909)
at u (/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1807727)
at constructor.region (/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1808700)
at constructor.set (/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1725502)
at constructor.<anonymous> (/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1723632)
at constructor.each (/Users/redacted/Library/Caches/aws/toolkits/language-servers/AmazonQ/1.13.0/servers/aws-lsp-codewhisperer.js:8:1930021)
Node.js v18.20.8
I can confirm this issue still exists with version v1.79.0
Issue https://github.com/aws/aws-toolkit-vscode/issues/7538 appears to the same as this issue.
Issue has been identified and sorted.
Problem: The Amazon Q language server was failing with a "Cannot redefine property" error for an AWS profile.
Root Cause:
The AWS config file had duplicate profile definitions for the same profile: • [profile-name] (incorrect format) • [profile profile-name] (correct format)
Solution Applied:
- Backed up the original config to ~/.aws/config.backup
- Removed the duplicate entry - kept only the properly formatted [profile profile-name] section
- Cleared caches - removed AWS CLI and Amazon Q language server cached data
- Refreshed SSO login - ran aws sso login --profile
Result: The duplicate profile conflict was eliminated, allowing the language server to start without the property redefinition error.
@teknologika Can you describe more detail about the solution please? I tried to fix but it didnt work