Activity log for bug #1977952

Date Who What changed Old value New value Message
2022-06-08 09:02:04 Schmidt Zsolt bug added bug
2022-06-08 09:03:37 Schmidt Zsolt attachment added output of "cloud-init collect-logs" command https://bugs.launchpad.net/cloud-init/+bug/1977952/+attachment/5595563/+files/cloud-init.tar.gz
2022-06-08 09:20:18 Schmidt Zsolt attachment removed output of "cloud-init collect-logs" command https://bugs.launchpad.net/cloud-init/+bug/1977952/+attachment/5595563/+files/cloud-init.tar.gz
2022-06-08 09:21:42 Schmidt Zsolt description Hi! We have some user-data files where we use the phone-home module of cloud-init. So far we did not use it's "tries" parameter and everything worked. However now in version 22.2 there was a change which causes cloud-init to fail. https://github.com/canonical/cloud-init/compare/22.1...22.2#diff-a4aa83fbb946ba1ea7cf6c8dd5965cd62631dc9cb48d4baa50adddbfef06b82cL108 In our case this change in the exception handling throws a TypeError, instead of the ValueError that is excepted: File "/usr/lib/python3/dist-packages/cloudinit/config/cc_phone_home.py", line 132, in handle tries = int(tries) # type: ignore TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' While we can add the "tries" parameter (and after that everything works just like before), this exception should be handled properly. Also according to guidelines: 1. Tell us your cloud provider None 2. Any appropriate cloud-init configuration you can provide us phone-home module 3. Perform the following on the system and attach it to this bug: logs are attached Best regards: Zsolt Hi! We have some user-data files where we use the phone-home module of cloud-init. So far we did not use it's "tries" parameter and everything worked. However now in version 22.2 there was a change which causes cloud-init to fail. https://github.com/canonical/cloud-init/compare/22.1...22.2#diff-a4aa83fbb946ba1ea7cf6c8dd5965cd62631dc9cb48d4baa50adddbfef06b82cL108 In our case this change in the exception handling throws a TypeError, instead of the ValueError that is excepted: File "/usr/lib/python3/dist-packages/cloudinit/config/cc_phone_home.py", line 132, in handle    tries = int(tries) # type: ignore TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' While we can add the "tries" parameter (and after that everything works just like before), this exception should be handled properly. Also according to guidelines: 1. Tell us your cloud provider None 2. Any appropriate cloud-init configuration you can provide us phone-home module 3. Perform the following on the system and attach it to this bug: no logs are necessary Best regards: Zsolt
2022-06-08 13:56:26 James Falcon cloud-init: status New Triaged
2022-06-08 13:56:29 James Falcon cloud-init: importance Undecided High
2022-06-09 08:00:12 DEXTER bug added subscriber DEXTER
2022-06-09 17:38:34 Chad Smith cloud-init: status Triaged In Progress
2022-06-09 17:38:43 Chad Smith cloud-init: assignee James Falcon (falcojr)
2022-06-09 21:04:39 Chad Smith cloud-init: status In Progress Fix Committed
2022-06-10 15:13:48 James Falcon bug task added cloud-init (Ubuntu)
2022-06-10 15:14:08 James Falcon nominated for series Ubuntu Bionic
2022-06-10 15:14:08 James Falcon bug task added cloud-init (Ubuntu Bionic)
2022-06-10 15:14:08 James Falcon nominated for series Ubuntu Impish
2022-06-10 15:14:08 James Falcon bug task added cloud-init (Ubuntu Impish)
2022-06-10 15:14:08 James Falcon nominated for series Ubuntu Jammy
2022-06-10 15:14:08 James Falcon bug task added cloud-init (Ubuntu Jammy)
2022-06-10 15:14:08 James Falcon nominated for series Ubuntu Focal
2022-06-10 15:14:08 James Falcon bug task added cloud-init (Ubuntu Focal)
2022-06-10 15:35:22 James Falcon description Hi! We have some user-data files where we use the phone-home module of cloud-init. So far we did not use it's "tries" parameter and everything worked. However now in version 22.2 there was a change which causes cloud-init to fail. https://github.com/canonical/cloud-init/compare/22.1...22.2#diff-a4aa83fbb946ba1ea7cf6c8dd5965cd62631dc9cb48d4baa50adddbfef06b82cL108 In our case this change in the exception handling throws a TypeError, instead of the ValueError that is excepted: File "/usr/lib/python3/dist-packages/cloudinit/config/cc_phone_home.py", line 132, in handle    tries = int(tries) # type: ignore TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' While we can add the "tries" parameter (and after that everything works just like before), this exception should be handled properly. Also according to guidelines: 1. Tell us your cloud provider None 2. Any appropriate cloud-init configuration you can provide us phone-home module 3. Perform the following on the system and attach it to this bug: no logs are necessary Best regards: Zsolt === Begin SRU Template === [Impact] The cloud-init "phone home" module contains an optional "tries" parameter. In release 22.2, this was accidentally changed to become mandatory. Any previously working cloud-config that didn't contain the "tries" parameter will now cause the module exit with exception. This happened because an overly broad exception handler for converting the 'tries' string to an int was changed to only raise on ValueError. However, if None (or any other non-string) is passed, a TypeError is raised, and this needs to be caught as well. [Test Case] 1. Launch an Ubuntu instance on any cloud-init supported platform with the following userdata: #cloud-config phone_home: url: http://192.168.1.1 post: all 2. By inspecting /var/log/cloud-init.log, ensure the phone home module attempts to make a web request, with the following log: url_helper.py[DEBUG]: [0/10] open 'http://192.168.1.1' with {'url': 'http://192.168.1.1', 'allow_redirects': True, 'method': 'POST', 'headers': {'User-Agent': 'Cloud-Init/22.2'}} configuration [Regression Potential] The parsing exceptions being caught should now be broad enough to handle any configuration we receive, but if not, we would still exit the module with exception. [Other Info] Github PR: https://github.com/canonical/cloud-init/pull/1500 === End SRU Template === Initial bug: Hi! We have some user-data files where we use the phone-home module of cloud-init. So far we did not use it's "tries" parameter and everything worked. However now in version 22.2 there was a change which causes cloud-init to fail. https://github.com/canonical/cloud-init/compare/22.1...22.2#diff-a4aa83fbb946ba1ea7cf6c8dd5965cd62631dc9cb48d4baa50adddbfef06b82cL108 In our case this change in the exception handling throws a TypeError, instead of the ValueError that is excepted: File "/usr/lib/python3/dist-packages/cloudinit/config/cc_phone_home.py", line 132, in handle    tries = int(tries) # type: ignore TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' While we can add the "tries" parameter (and after that everything works just like before), this exception should be handled properly. Also according to guidelines: 1. Tell us your cloud provider None 2. Any appropriate cloud-init configuration you can provide us phone-home module 3. Perform the following on the system and attach it to this bug: no logs are necessary Best regards: Zsolt
2022-06-10 18:47:30 Steve Langasek cloud-init (Ubuntu): status New In Progress
2022-06-10 18:48:16 Steve Langasek cloud-init (Ubuntu Jammy): status New Fix Committed
2022-06-10 18:48:17 Steve Langasek bug added subscriber Ubuntu Stable Release Updates Team
2022-06-10 18:48:19 Steve Langasek bug added subscriber SRU Verification
2022-06-10 18:48:22 Steve Langasek tags verification-needed verification-needed-jammy
2022-06-10 18:50:40 Steve Langasek cloud-init (Ubuntu Impish): status New Fix Committed
2022-06-10 18:50:47 Steve Langasek tags verification-needed verification-needed-jammy verification-needed verification-needed-impish verification-needed-jammy
2022-06-10 18:51:49 Steve Langasek cloud-init (Ubuntu Focal): status New Fix Committed
2022-06-10 18:51:55 Steve Langasek tags verification-needed verification-needed-impish verification-needed-jammy verification-needed verification-needed-focal verification-needed-impish verification-needed-jammy
2022-06-10 18:54:38 Steve Langasek cloud-init (Ubuntu Bionic): status New Fix Committed
2022-06-10 18:54:45 Steve Langasek tags verification-needed verification-needed-focal verification-needed-impish verification-needed-jammy verification-needed verification-needed-bionic verification-needed-focal verification-needed-impish verification-needed-jammy
2022-06-10 21:20:05 James Falcon attachment added test-artifacts.tar.gz https://bugs.launchpad.net/cloud-init/+bug/1977952/+attachment/5596598/+files/test-artifacts.tar.gz
2022-06-13 15:06:30 Chad Smith tags verification-needed verification-needed-bionic verification-needed-focal verification-needed-impish verification-needed-jammy verification-done verification-done-bionic verification-done-focal verification-done-impish verification-done-jammy
2022-06-13 15:16:35 Chad Smith cloud-init (Ubuntu): status In Progress Fix Committed
2022-06-14 16:51:25 Launchpad Janitor cloud-init (Ubuntu Jammy): status Fix Committed Fix Released
2022-06-14 16:51:28 Brian Murray removed subscriber Ubuntu Stable Release Updates Team
2022-06-14 16:51:46 Launchpad Janitor cloud-init (Ubuntu Impish): status Fix Committed Fix Released
2022-06-14 16:52:04 Launchpad Janitor cloud-init (Ubuntu Focal): status Fix Committed Fix Released
2022-06-14 16:52:23 Launchpad Janitor cloud-init (Ubuntu Bionic): status Fix Committed Fix Released
2022-07-01 18:34:42 Launchpad Janitor cloud-init (Ubuntu): status Fix Committed Fix Released
2022-07-01 18:34:42 Launchpad Janitor cve linked 2022-2084
2022-08-19 16:37:21 Brett Holman cloud-init: status Fix Committed Fix Released
2023-04-21 01:50:34 James Falcon cve unlinked 2022-2084
2023-05-12 17:07:55 James Falcon bug watch added https://github.com/canonical/cloud-init/issues/3985