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

libarchive_file resource fails to extract on RHEL7/CentOS7 #41

Open
snkutlu opened this issue Jan 30, 2019 · 2 comments
Open

libarchive_file resource fails to extract on RHEL7/CentOS7 #41

snkutlu opened this issue Jan 30, 2019 · 2 comments

Comments

@snkutlu
Copy link

snkutlu commented Jan 30, 2019

Cookbook version

libarchive 2.1.0

Chef-client version

v14.10.9

Platform Details

RHEL 7 / CentOS 7

Scenario:

When trying to extract a ZIP file with libarchive_file resource, it fails with following errors:

[2019-01-29T15:32:56+00:00] FATAL: LoadError: Could not open library 'libarchive.so.13': /lib64/liblzma.so.5: version `XZ_5.2' not found (required by /opt/chef/embedded/lib/libarchive.so.13).
Could not open library 'libarchive.13': libarchive.13: cannot open shared object file: No such file or directory.
Could not open library 'libarchive.13.so': libarchive.13.so: cannot open shared object file: No such file or directory.
Could not open library 'libarchive-13': libarchive-13: cannot open shared object file: No such file or directory.
Could not open library 'libarchive-13.so': libarchive-13.so: cannot open shared object file: No such file or directory.
Could not open library 'libarchive.so': /lib64/liblzma.so.5: version `XZ_5.2' not found (required by /opt/chef/embedded/lib/libarchive.so).
Could not open library 'libarchive': libarchive: cannot open shared object file: No such file or directory.
Could not open library 'archive': archive: cannot open shared object file: No such file or directory

Chef has libarchive.so.13.3.3 installed in /opt/chef/embedded/lib directory.

ls -la /opt/chef/embedded/lib/libarchive.so*
lrwxrwxrwx. 1 root root      20 Jan 29 15:32 /opt/chef/embedded/lib/libarchive.so -> libarchive.so.13.3.3
lrwxrwxrwx. 1 root root      20 Jan 29 15:32 /opt/chef/embedded/lib/libarchive.so.13 -> libarchive.so.13.3.3
-rwxr-xr-x. 1 root root  977008 Dec 20 04:16 /opt/chef/embedded/lib/libarchive.so.13.3.3

If I delete libarchive.so* from that directory then it starts to use OS version (libarchive.13.1.2) and everything starts to work as expected

Steps to Reproduce:

  • Include libarchive in your metadata.rb
  • Code a resource in your recipe as follows:
libarchive_file 'Extract zip file' do
  path '/path/to/your/zipfile.zip'
  extract_to '/some/real/path'
  action :extract
end
  • Cook

Expected Result:

ZIP file should be extracted to given path and chef-client run finished successfully

Actual Result:

Chef-client run fails with the above error and ZIP file is not extracted

@ashley-abbott
Copy link

I've added gem 'ffi-libarchive' into my wrapper cookbook's Gemfile and convergence succeeds, same client version and cookbook version

@arielrolfo
Copy link

facing exactly same issue here, none of the above workarounds worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants