[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-05-03 Thread Chad Smith
** Description changed:

  [ Impact ]
  
   * SRU of cloud-init 24.1.3 to Focal, Jammy and Mantic introduced a
  regression where cloud-init will attempt to call `snap refresh` on new
  Ubuntu instance launches if the Ubuntu image does not contain snapd deb
  package and optional #cloud-config user-data is provided which contains
  `upgrade_packages: true`.
  
   * Such optional user-data on custom ubuntu images will result in cloud-init 
exiting in error condition as seen from cloud-init status due to the following 
error message:
   - ('package_update_upgrade_install', ProcessExecutionError("Unexpected error 
while running command.\nCommand: ['snap', 'refresh']\nExit code: -\nReason: 
[Errno 2] No such file or directory: b'snap'\nStdout: -\nStderr: -"))
  
  This only affects new custom Ubuntu image launches where both of the 
following conditions are met:
  1. image is a custom ubuntu image which does not contain snapd deb package
  2. At instance launch, optional #cloud-config user-data contains 
`package_upgrade: true`
  
  Ubuntu cloudimages published by Canonical for Focal, Jammy and Mantic
  all currently have the snapd deb package installed.
  
  Even for custom Ubuntu images without snapd deb package installed, this
  issue is only triggered when #cloud-config contains the optional
  `package_upgrade: true` during instance launch.
  
  This error log does cause cloud-init status to exit non-zero, but it
  doesn't affect the integrity of the configuration applied to the system.
  It is just an undesirable error log message for an unsupported (snap)
  package manager within the environment.
  
  [ Test Plan ]
   * # launch ubuntu cloud images in LXC, remove snapd, provide 
"#cloud-config\npackage_upgrade:true" as user-data and clean reboot to force 
cloud-init to attempt to upgrade any package managers (snap and apt) where 
applicable.
  
   * confirm no snap command present in image
   * check cloud-init status --format=yaml to ensure no errors
   * grep snap.*refresh /var/log/cloud-init.log to assert no stray snap refresh 
is attempted on an image without snap
  
  #!/bin/bash
+ set -ex
  SERIES=$1
+ 
  cat > pkg-update.yaml < setup_proposed.sh 

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-05-03 Thread Chad Smith
** Description changed:

  [ Impact ]
  
   * SRU of cloud-init 24.1.3 to Focal, Jammy and Mantic introduced a
  regression where cloud-init will attempt to call `snap refresh` on new
  Ubuntu instance launches if the Ubuntu image does not contain snapd deb
  package and optional #cloud-config user-data is provided which contains
  `upgrade_packages: true`.
  
   * Such optional user-data on custom ubuntu images will result in cloud-init 
exiting in error condition as seen from cloud-init status due to the following 
error message:
   - ('package_update_upgrade_install', ProcessExecutionError("Unexpected error 
while running command.\nCommand: ['snap', 'refresh']\nExit code: -\nReason: 
[Errno 2] No such file or directory: b'snap'\nStdout: -\nStderr: -"))
  
  This only affects new custom Ubuntu image launches where both of the 
following conditions are met:
  1. image is a custom ubuntu image which does not contain snapd deb package
  2. At instance launch, optional #cloud-config user-data contains 
`package_upgrade: true`
  
  Ubuntu cloudimages published by Canonical for Focal, Jammy and Mantic
  all currently have the snapd deb package installed.
  
  Even for custom Ubuntu images without snapd deb package installed, this
  issue is only triggered when #cloud-config contains the optional
  `package_upgrade: true` during instance launch.
  
  This error log does cause cloud-init status to exit non-zero, but it
  doesn't affect the integrity of the configuration applied to the system.
  It is just an undesirable error log message for an unsupported (snap)
  package manager within the environment.
  
- 
  [ Test Plan ]
   * # launch ubuntu cloud images in LXC, remove snapd, provide 
"#cloud-config\npackage_upgrade:true" as user-data and clean reboot to force 
cloud-init to attempt to upgrade any package managers (snap and apt) where 
applicable.
  
   * confirm no snap command present in image
   * check cloud-init status --format=yaml to ensure no errors
   * grep snap.*refresh /var/log/cloud-init.log to assert no stray snap refresh 
is attempted on an image without snap
  
  #!/bin/bash
- lxc launch ubuntu-daily:jammy test-no-snap
- sleep 3
- lxc exec test-no-snap -- cloud-init status --wait
- lxc exec test-no-snap -- apt remove snapd -y
- 
+ SERIES=$1
  cat > pkg-update.yaml < pkg-update.yaml 

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-05-02 Thread Andreas Hasenack
Please also confirm, via the test plan, that if the image has the snap
deb installed, that the snaps will be upgraded, i.e., that we don't
break the normal use case with canonical images.

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

Title:
  images without snapd installed error on `update_packages: true` user-
  data

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


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-05-02 Thread Andreas Hasenack
Reopening the main devel (oracular) task as the fix is not there yet,
nor uploaded.

** Changed in: cloud-init (Ubuntu)
   Status: Fix Committed => Confirmed

** Also affects: cloud-init (Ubuntu Oracular)
   Importance: Critical
 Assignee: Chad Smith (chad.smith)
   Status: Confirmed

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

Title:
  images without snapd installed error on `update_packages: true` user-
  data

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


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-05-02 Thread Andreas Hasenack
Before release into updates, please make sure to address Oracular, and
also the test plan amendment from comment #5.

** Changed in: cloud-init (Ubuntu Noble)
   Status: New => Fix Committed

** Tags added: verification-needed verification-needed-noble

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

Title:
  images without snapd installed error on `update_packages: true` user-
  data

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


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-04-29 Thread Chad Smith
** Also affects: cloud-init (Ubuntu Noble)
   Importance: Undecided
   Status: New

** Also affects: cloud-init (Ubuntu Mantic)
   Importance: Undecided
   Status: New

** Also affects: cloud-init (Ubuntu Jammy)
   Importance: Undecided
   Status: New

** Also affects: cloud-init (Ubuntu Focal)
   Importance: Undecided
   Status: New

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

Title:
  images without snapd installed error on `update_packages: true` user-
  data

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


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-04-29 Thread Chad Smith
Given that all Canonical Ubuntu images (including server minimal and
cloud minimal images) contain snapd deb package, this is not a critical
path concern for Canonical stable supported Ubuntu images. So,
`regression-update` tag is dropped for our specific support paths as
this doesn't regress image streams we claim to support. This SRU remains
queued in unapproved queue for Focal, Jammy, Mantic and Novble with
priority for next SRU reviewer when time is available as we do want this
fixed shortly to better support any derivative Ubuntu images which may
have dropped snapd from their images in an effect to shrink that image
size even further.


** Tags removed: regression-update

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

Title:
  images without snapd installed error on `update_packages: true` user-
  data

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


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-04-29 Thread Chad Smith
** Description changed:

- In Ubuntu images that do not have snapd debian package installed
- launching with the following user-data triggers cloud-init to run `snap
- refresh` when that command doesn't exist.
+ [ Impact ]
  
+  * SRU of cloud-init 24.1.3 to Focal, Jammy and Mantic introduced a
+ regression where cloud-init will attempt to call `snap refresh` on new
+ Ubuntu instance launches the Ubuntu image does not contain snapd deb
+ package installed and  optional #cloud-config user-data is provided
+ which contains `upgrade_packages: true`.
+ 
+  * Such optional user-data on custom ubuntu images will result in cloud-init 
exiting in error condition as seen from cloud-init status due to the following 
error message:
+   - ('package_update_upgrade_install', ProcessExecutionError("Unexpected 
error while running command.\nCommand: ['snap', 'refresh']\nExit code: 
-\nReason: [Errno 2] No such file or directory: b'snap'\nStdout: -\nStderr: -"))
+ 
+ 
+ This only affects new custom Ubuntu image launches where both of the 
following conditions are met:
+ 1. image is a custom ubuntu image which does not contain snapd deb package
+ 2. At instance launch, optional #cloud-config user-data contains 
`package_upgrade: true`
+ 
+ 
+ Ubuntu cloudimages published by Canonical for Focal, Jammy and Mantic all 
currently snapd deb package.
+ 
+ And even for custom Ubuntu images without snapd installed, only when
+ package operations are provided via #cloud-config is the instance launch
+ affected.
+ 
+ 
+ [ Test Plan ]
+  * # launch ubuntu cloud images in LXC, remove snapd, provide 
"#cloud-config\npackage_upgrade:true" as user-data and clean reboot to force 
cloud-init to attempt to upgrade any package managers (snap and apt) where 
applicable.
+ 
+  * confirm no snap command present in image
+  * check cloud-init status --format=yaml to ensure no errors
+  * grep snap.*refresh /var/log/cloud-init.log to assert no stray snap refresh 
is attempted on an image without snap
+ 
+ 
+ #!/bin/bash
+ lxc launch ubuntu-daily:jammy test-no-snap
+ sleep 3
+ lxc exec test-no-snap -- cloud-init status --wait
+ lxc exec test-no-snap -- apt remove snapd -y
+ 
+ cat > pkg-update.yaml < pkg-update.yaml < pkg-update.yaml < pkg-update.yaml 

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-04-29 Thread Chad Smith
Upstream commit merged https://github.com/canonical/cloud-
init/commit/a6f7577d582aa51d51ca129fcff65313e210d47b

** Changed in: cloud-init (Ubuntu)
   Status: New => Fix Committed

** Changed in: cloud-init (Ubuntu)
 Assignee: (unassigned) => Chad Smith (chad.smith)

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

Title:
  images without snapd installed error on `update_packages: true` user-
  data

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


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2064132] Re: images without snapd installed error on `update_packages: true` user-data

2024-04-29 Thread Chad Smith
Upstream github issue re-opened representing this fix:  
https://github.com/canonical/cloud-init/issues/5143
upstream Pull request fixing this issue: 
https://github.com/canonical/cloud-init/pull/5224

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

Title:
  images without snapd installed error on `update_packages: true` user-
  data

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


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs