Serverless deploy to LocalStack fails: “Invalid character in header content [authorization]”
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- aws, docker, node.js, typescript
Research direction
Reproduce serverless deploy --stage local using serverless.ts and docker-compose.yml, focusing on the “Resolving AWS account ID” step and the authorization-header error. Check the listed Serverless Framework, serverless-localstack, LocalStack, and Node.js versions. Done means deployment proceeds beyond account resolution to packaging and CloudFormation synthesis without the invalid-header failure.
Written by the indexing model from the issue text.
Description
Running serverless deploy --stage local against LocalStack aborts during the “Resolving AWS account ID” step with the error:
Unable to find function cleanup on plugin Esbuild
Deploying "sls" to stage "local" (us-east-1)
Using serverless-localstack
Using serverless-localstack
serverless-localstack: Reconfigured endpoints
Error: Failed to resolve AWS account ID: Invalid character in header content ["authorization"]
deployment never reaches packaging or CloudFormation synthesis
serverless.ts
plugins: ['serverless-iam-roles-per-function', 'serverless-localstack'],
custom:
localstack:
stages: ['local']
edgePort: 4566
host: 'http://localhost'
provider:
name: aws
runtime: nodejs22.x
environment:
AWS_ENDPOINT_URL: 'http://localhost:4566'
AWS_ACCESS_KEY_ID: '000000000001'
AWS_ACCOUNT_ID: '000000000001'
docker-compose.yml
s3mock:
image: adobe/s3mock:latest
environment:
- retainFilesOnExit=true
- root=root
ports:
- 9090:9090
volumes:
- ./uploadedFiles:/root
localstack:
container_name: localstack
image: localstack/localstack
ports:
- 4566:4566
- 4510-4559:4510-4559
environment:
- DEBUG=${DEBUG:-0}
- SERVICES=lambda,sqs,sns
volumes:
- '${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'
Versions
| Component | Version |
|---|---|
| Serverless Framework | 4.14.3 |
| serverless-localstack | 1.3.1 |
| LocalStack Docker image | localstack/localstack:latest (pulled 2025-05-14) |
| Node.js | 22.0.0 |
- Dominant language
- JavaScript
- Stars
- 542
- Forks
- 92
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from localstack/serverless-localstack
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
aws:apigateway status: backlog
Difficulty 4/5 3-5 days Newbie friendliness 35/100
localstack/serverless-localstack#270 · 3 reactions ·
-
serverless-webpack status: backlog status: response required
Difficulty 3/5 1-2 days Newbie friendliness 35/100
localstack/serverless-localstack#266 · 1 comment ·
All issues in localstack/serverless-localstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
web-platform-tests/interop#1455 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100