Environment, system details, and tools:
- AWS EC2
- EC2 Instance Metadata service (i.e. http://169.254.169.254/latest/meta-data/)
- Cloudwatch
- wget
- bash
- Ubuntu 14.04
Has anyone ever seen this? We have a cron job that pushes Cloudwatch metrics from inside an instance by basically doing these steps:
- Get instanceId by running "wget -q -O - http://169.254.169.254/latest/meta-data/instance-id"
- Collecting some metric or other and building an AWS CLI query using
aws cloudwatch put-metric-data ...
- Repeat
The weird thing we are seeing is, very infrequently, one of these runs will die after the wget
query, with no output. As if the Metadata service just failed to respond.
Example end-of-script (we set bash -e and -x to die and to gather debug output):
++ wget -q -O - http://169.254.169.254/latest/meta-data/instance-id
+ INSTANCE_ID=
The script ends there and exits because presumably wget
exited with a non-zero exit status.
This is not reproducible, but it happens on the order of once every 2 weeks.