[Error] Cannot fetch region variable from config file, environment variables, ecs metadata, or ec2 metadata.
- Dominant language
- Go
- Stars
- 193
- Forks
- 73
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 3
Description
Hello I cant seem to figure out exactly what is being asked here. I am just trying to run a test locally to get a clear idea of how to get a django application configured with xray before even applying it to an ecs fargate cluster, which is the primary goal.
I tried setting credentials and region as environment variables locally and inside `.aws/credentials `but am still getting the same result. The container exits as soon as **docker-compose** file is ran.
**Here is the full error.**
```
➜ mysite git:(main) ✗ docker logs -f e8e58775c8ff
2023-02-20T23:50:51Z [Info] Initializing AWS X-Ray daemon 3.3.6
2023-02-20T23:50:51Z [Info] Using buffer memory limit of 78 MB
2023-02-20T23:50:51Z [Info] 1248 segment buffers allocated
2023-02-20T23:50:51Z [Error] Cannot fetch region variable from config file, environment variables, ecs metadata, or ec2 metadata. Use local-mode to use the local session region
```
Here is the **docker-compose** file.
```
`version: '3'
services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
ports:
- 8000:8000
links:
- xray
environment:
XRAY_DAEMON_ADDRESS: xray:2000
AWS_REGION: us-east-2
xray:
image: amazon/aws-xray-daemon
entrypoint: /usr/bin/xray --local-mode -o`
```
Is there another solution here if the problem is not the credentials? Thank you!
Contributor guide
Research direction
Reproduce the failure with the provided docker-compose configuration and inspect the xray service entrypoint and its environment. Compare the daemon's region-resolution behavior with the supplied AWS_REGION setting and local-mode option. Done means the container remains running and the daemon starts without the region error, or the required configuration is clearly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker-compose, go
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100