Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install snap_package with --classic option #10589

Closed
evandam opened this issue Nov 2, 2020 · 2 comments · Fixed by #14299
Closed

Cannot install snap_package with --classic option #10589

evandam opened this issue Nov 2, 2020 · 2 comments · Fixed by #14299
Labels
Focus: Resources Platform: Debian-like Triage: Feature Request Indicates an issue requesting new functionality.

Comments

@evandam
Copy link

evandam commented Nov 2, 2020

Description

Attempting to install a snap package that requires --classic always fails. I also currently can only use :upgrade (not :install) from #10537.

Chef Version

Chef Infra Client, version 15.13.8

Confirmed this happens in 16.6.14 in Test Kitchen as well.

Platform Version

Ubuntu 18.04

Replication Case

snap_package 'amazon-ssm-agent' do
  options '--classic'
  action :upgrade
end

Client Output

* snap_package[amazon-ssm-agent] action upgrade[2020-11-02T16:48:24+00:00] INFO: Processing snap_package[amazon-ssm-agent] action upgrade (wo-common::ssm_agent line 10)


           ================================================================================
           Error executing action `upgrade` on resource 'snap_package[amazon-ssm-agent]'
           ================================================================================

           RuntimeError
           ------------
           status: Bad Request, kind: snap-needs-classic, message: snap "amazon-ssm-agent" requires classic confinement

           Resource Declaration:
           ---------------------
           # In /var/tmp/kitchen/cache/cookbooks/wo-common/recipes/ssm_agent.rb

            10: snap_package 'amazon-ssm-agent' do
            11:   options '--classic'
            12:   action :upgrade
            13: end
            14:

           Compiled Resource:
           ------------------
           # Declared in /var/tmp/kitchen/cache/cookbooks/wo-common/recipes/ssm_agent.rb:10:in `from_file'

           snap_package("amazon-ssm-agent") do
             package_name "amazon-ssm-agent"
             action [:upgrade]
             default_guard_interpreter :default
             declared_type :snap_package
             cookbook_name "wo-common"
             recipe_name "ssm_agent"
             options ["--classic"]
           end

           System Info:
           ------------
           chef_version=15.13.8
           platform=ubuntu
           platform_version=18.04
           ruby=ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
           program_name=/opt/chef/bin/chef-client
           executable=/opt/chef/bin/chef-client
@evandam evandam added the Status: Untriaged An issue that has yet to be triaged. label Nov 2, 2020
@tas50
Copy link
Contributor

tas50 commented Nov 17, 2020

This will be looked at in #10591

@tas50 tas50 added Triage: Feature Request Indicates an issue requesting new functionality. Platform: Debian-like Focus: Resources and removed Status: Untriaged An issue that has yet to be triaged. labels May 6, 2021
@terenho
Copy link

terenho commented Jan 22, 2024

I checked the code in

request["classic"] = true if options.include?("classic")
, the way to specify '--classic' option should be

snap_package 'amazon-ssm-agent' do
  options 'classic'
  action :upgrade
end

At least that works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus: Resources Platform: Debian-like Triage: Feature Request Indicates an issue requesting new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants