I'm the original reporter of the issue. I was asked whether I could test
a pre-release of cloud-init for this bug and respond with results in
this launchpad issue (original report [on
Github](https://github.com/canonical/cloud-init/issues/5971)).

But beforehand:
> Since [...] the cloud-init team has no Hetzner access, there is currently no 
> known way to reliably reproduce this

Did you intentionally decide against an account or is it just due to
budget? I talked to my colleagues at Hetzner Cloud. We'd like to offer
the cloud-init project credits for 20 Euro / month, so that you can test
and debug yourself on Hetzner Cloud. According to my colleague the
process is like this: You'd create an account first, tell us your
account number and we then assign the credits. I saw there is a contact
feature on launchpad. Feel free to contact me via that (I guess it gets
forwarded to my email address?), otherwise you could also create a
ticket at Hetzner and mention "Hetzner Cloud, Team Open Source
Integrations", it should then reach the correct department.

But now to my testing results.

The `ERROR` messages are now gone, but the exit code for some reason on
Ubuntu 24.04 is still `2`. Is there a way to find out what caused this
exit code?


## Ubuntu 22.04 (just for reference, here we had no problems with the exit code)

### stable version 24.4-0ubuntu1~22.04.1

```
root@testing-u22:~# cloud-init --version
/usr/bin/cloud-init 24.4-0ubuntu1~22.04.1

root@testing-u22:~# cloud-init status --long
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Thu, 01 Jan 1970 00:00:12 +0000
detail: DataSourceHetzner
errors: []
recoverable_errors:
ERROR:
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
WARNING:
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7f0dc87f1cf0>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7f0dc87f1cf0>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Could not find module named cc_emit_upstart (searched 
['cc_emit_upstart', 'cloudinit.config.cc_emit_upstart'])
        - Could not find module named cc_refresh_rmc_and_interface (searched 
['cc_refresh_rmc_and_interface', 
'cloudinit.config.cc_refresh_rmc_and_interface'])

root@testing-u22:~# echo $?
0
```

### pre-release 24.4.1-0ubuntu0~22.04.1

```
root@testing-u22:~# cloud-init --version
/usr/bin/cloud-init 24.4.1-0ubuntu0~22.04.1

root@testing-u22:~# cloud-init clean --logs --reboot

root@testing-u22:~# cloud-init status --long
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Thu, 01 Jan 1970 00:00:11 +0000
detail: DataSourceHetzner
errors: []
recoverable_errors:
WARNING:
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7f377f26b520>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7f377f26b520>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Could not find module named cc_emit_upstart (searched 
['cc_emit_upstart', 'cloudinit.config.cc_emit_upstart'])
        - Could not find module named cc_refresh_rmc_and_interface (searched 
['cc_refresh_rmc_and_interface', 
'cloudinit.config.cc_refresh_rmc_and_interface'])

root@testing-u22:~# echo $?
0
```


## Ubuntu 24.04 (this was the buggy version)

### stable version 24.4-0ubuntu1~24.04.2

```
root@testing-u24:~# cloud-init --version
/usr/bin/cloud-init 24.4-0ubuntu1~24.04.2

root@testing-u24:~# cloud-init status --long
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Thu, 01 Jan 1970 00:00:14 +0000
detail: DataSourceHetzner
errors: []
recoverable_errors:
ERROR:
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
        - Timed out, no response from urls: 
['http://169.254.169.254/hetzner/v1/metadata/instance-id']
WARNING:
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x716b5ff15c10>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x716b5ff15c10>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x716b5ff15c10>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x716b5ff15c10>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception

root@testing-u24:~# echo $?
2
```

### pre-release 24.4.1-0ubuntu0~24.04.1

```
root@testing-u24:~# cloud-init --version
/usr/bin/cloud-init 24.4.1-0ubuntu0~24.04.1

root@testing-u24:~# cloud-init clean --logs --reboot

root@testing-u24:~# cloud-init status --long
status: done
extended_status: degraded done
boot_status_code: enabled-by-generator
last_update: Thu, 01 Jan 1970 00:00:11 +0000
detail: DataSourceHetzner
errors: []
recoverable_errors:
WARNING:
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7462facf7e30>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7462facf7e30>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7462facf7e30>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception
        - Exception(s) [UrlError("HTTPConnectionPool(host='169.254.169.254', 
port=80): Max retries exceeded with url: /hetzner/v1/metadata/instance-id 
(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 
0x7462facf7e30>: Failed to establish a new connection: [Errno 101] Network is 
unreachable'))")] during request to 
http://169.254.169.254/hetzner/v1/metadata/instance-id, raising last exception

root@testing-u24:~# echo $?
2
```

** Bug watch added: github.com/canonical/cloud-init/issues #5971
   https://github.com/canonical/cloud-init/issues/5971

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2094857

Title:
  cloud-init exits 2 if IMDS connectivity fails

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2094857/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to