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

Mount resource failing to execute after first run. #14047

Open
minsis opened this issue Oct 25, 2023 · 1 comment
Open

Mount resource failing to execute after first run. #14047

minsis opened this issue Oct 25, 2023 · 1 comment
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@minsis
Copy link

minsis commented Oct 25, 2023

Description

When using action :mount on mount resource is failing future runs because previous runs have already mounted the drive.

Chef Version

17.10.3

Platform Version

rhel8

Replication Case

Using something like this:

mount '/my/mount' do
device '/dev/my_mount'
device_type :device
fstype 'xfs'
options %w(defaults)
dump 1
pass 1
enabled true
action [ :mount, :enable ]
end

Client Output

================================================================================
    Error executing action `mount` on resource 'mount[/var/lib/containers]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '32'
    ---- Begin output of ["mount", "-t", "xfs", "-o", "defaults", "/dev/my_mount", "/var/lib/containers"] ----
    STDOUT:
    STDERR: mount: /var/lib/containers: /dev/mapper/my_mount already mounted on /var/lib/containers.
    ---- End output of ["mount", "-t", "xfs", "-o", "defaults", "/dev/my_mount", "/var/lib/containers"] ----
    Ran ["mount", "-t", "xfs", "-o", "defaults", "/dev/my_mount", "/var/lib/containers"] returned 32

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/podman/recipes/default.rb

     11: mount <obfuscated>[:mount_point] do
     12:   device <obfuscated>[:device]
     13:   device_type <obfuscated>[:device_type]
     14:   fstype <obfuscated>[:fstype]
     15:   options <obfuscated>[:options]
     16:   dump <obfuscated>[:dump]
     17:   pass <obfuscated>[:pass]
     18:   enabled <obfuscated>[:enabled]
     19:   action [ :mount, :enable ]
     20:   only_if { <obfuscated>[:enabled] == true }
     21: end
     22:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/podman/recipes/default.rb:11:in `from_file'

    mount("/var/lib/containers") do
      action [:mount, :enable]
      default_guard_interpreter :default
      declared_type :mount
      cookbook_name "podman"
      recipe_name "default"
      device "/dev/my_mount"
      device_type :device
      fstype "xfs"
      options ["defaults"]
      dump 1
      pass 1
      enabled true
      mount_point "/var/lib/containers"
      supports {:remount=>false}
      fsck_device "-"
      only_if { #code block }
    end

    System Info:
    ------------
    chef_version=17.10.3
    platform=redhat
    platform_version=8.8
    ruby=ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]
    program_name=/usr/bin/chef-client
    executable=/opt/chef/bin/chef-client


Stacktrace

See above

@minsis minsis added the Status: Untriaged An issue that has yet to be triaged. label Oct 25, 2023
@minsis
Copy link
Author

minsis commented Oct 25, 2023

Running in trace I also see that Chef reconizes that its already mounted during some evaulation.

[2023-10-25T11:56:05-04:00] TRACE: Found mount /dev/mapper/my_mount to /var/lib/containers in /etc/fstab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant