canonical / canonical/cloud-init

Warning in logs on EC2 in v6-only environment

Open
#5,388 1 comment 0 reactions 0 assignees View on GitHub
bug ds: ec2
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

In a v6-only environment on EC2, we attempt to reach IMDS via v4 but fail. This is expected. The v6 connection also seems to take longer to work. Both of these wind up logging a warning:
```
2024-06-06 21:21:10,554 - url_helper.py[WARNING]: Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', port=80): M
ax retries exceeded with url: /latest/api/token (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))"), UrlError("HTTPConnectionPool(host='f
d00:ec2::254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))")] during req
uest to http://[fd00:ec2::254]/latest/api/token, raising last exception
2024-06-06 21:21:10,554 - url_helper.py[WARNING]: Calling 'http://[fd00:ec2::254]/latest/api/token' failed [0/120s]: request err
or [HTTPConnectionPool(host='fd00:ec2::254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnection
Error(': Failed to establish a new connection: [Errno 101] Network i
s unreachable'))]
```

```
ubuntu@i-093c1d9617261fd90:~$ cloud-init status --long
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Thu, 06 Jun 2024 21:21:56 +0000
detail: DataSourceEc2Local
errors: []
recoverable_errors:
WARNING:
- Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))"), UrlError("HTTPConnectionPool(host='fd00:ec2::254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))")] during request to http://[fd00:ec2::254]/latest/api/token, raising last exception
- Calling 'http://[fd00:ec2::254]/latest/api/token' failed [0/120s]: request error [HTTPConnectionPool(host='fd00:ec2::254', port=80): Max retries exceeded with url: /latest/api/token (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))]
ubuntu@i-093c1d9617261fd90:~$ echo $?
2
```

This doesn't seem like it should be a "degraded done" case.

[cloud-init.log](https://github.com/user-attachments/files/15686671/cloud-init.log)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.