vagrant-chef icon indicating copy to clipboard operation
vagrant-chef copied to clipboard

Error executing action `install` on resource 'apt_package[postgresql-client-9.6]'

Open ghost opened this issue 7 years ago • 7 comments

Hello! When I try to install the box it returns an error due to a postgres-client dependency. Can you please help to solve it? Thank you.

Error executing action `install` on resource 'apt_package[postgresql-client-9.6]'
==> default:     ================================================================================
==> default:
==> default:     Mixlib::ShellOut::ShellCommandFailed
==> default:     ------------------------------------
==> default:     Expected process to exit with [0], but received '100'
==> default:     ---- Begin output of ["apt-get", "-q", "-y", "install", "postgresql-client-9.6=9.6.5-1.pgdg16.04+2"] ----
==> default:     STDOUT: Reading package lists...
==> default:     Building dependency tree...
==> default:     Reading state information...
==> default:     Some packages could not be installed. This may mean that you have
==> default:     requested an impossible situation or if you are using the unstable
==> default:
==> default: distribution that some required packages have not yet been created
==> default:
==> default:
==> default: or been moved out of Incoming.
==> default:
==> default:
==> default: The following information may help to resolve the situation:
==> default:
==> default:     The following packages have unmet dependencies:
==> default:      postgresql-client-9.6 : Depends: libpq5 (>= 9.6.5) but 9.5.9-0ubuntu0.16.04 is to be installed
==> default:     STDERR: E: Unable to correct problems, you have held broken packages.
==> default:     ---- End output of ["apt-get", "-q", "-y", "install", "postgresql-client-9.6=9.6.5-1.pgdg16.04+2"] ----
==> default:     Ran ["apt-get", "-q", "-y", "install", "postgresql-client-9.6=9.6.5-1.pgdg16.04+2"] returned 100
==> default:
==> default:     Resource Declaration:
==> default:     ---------------------
==> default:     # In /var/chef/cache/cookbooks/postgresql/recipes/client.rb
==> default:
==> default:       3: package "postgresql-client-9.6" do
==> default:       4:   action :install
==> default:       5: end
==> default:
==> default:     Compiled Resource:
==> default:     ------------------
==> default:     # Declared in /var/chef/cache/cookbooks/postgresql/recipes/client.rb:3:in `from_file'
==> default:
==> default:     apt_package("postgresql-client-9.6") do
==> default:       package_name "postgresql-client-9.6"
==> default:       action [:install]
==> default:       default_guard_interpreter :default
==> default:       declared_type :package
==> default:       cookbook_name "postgresql"
==> default:       recipe_name "client"
==> default:     end
==> default:
==> default:     System Info:
==> default:     ------------
==> default:     chef_version=13.5.3
==> default:     platform=ubuntu
==> default:     platform_version=16.04
==> default:     ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
==> default:     program_name=chef-solo worker: ppid=26486;start=10:11:45;
==> default:     executable=/opt/chef/bin/chef-solo
==> default:
==> default: [2017-10-31T10:11:53+00:00] INFO: Running queued delayed notifications before re-raising exception
==> default:
==> default: Running handlers:
==> default: [2017-10-31T10:11:53+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2017-10-31T10:11:53+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 0 resources updated in 07 seconds

ghost avatar Oct 31 '17 10:10 ghost

Is this a new box or existing?

josegonzalez avatar Oct 31 '17 15:10 josegonzalez

It's a new box, cloned this morning.

ghost avatar Oct 31 '17 15:10 ghost

Can you place the entire log output in gist.github.com and link me to it? I'll try setting it up now.

josegonzalez avatar Oct 31 '17 15:10 josegonzalez

Yes. First there is an issue with git:

==> default: ArgumentError
==> default:     -------------
==> default:     Malformed version number string 1:2.7.4-0ubuntu1.3
==> default:
==> default:     Resource Declaration:
==> default:     ---------------------
==> default:     # In /var/chef/cache/cookbooks/git/recipes/install.rb
==> default:
==> default:       3: package 'git' do
==> default:       4:   action :upgrade
==> default:       5: end
==> default:
==> default:     Compiled Resource:
==> default:     ------------------
==> default:     # Declared in /var/chef/cache/cookbooks/git/recipes/install.rb:3:in `from_file'
==> default:
==> default:     apt_package("git") do
==> default:       package_name "git"
==> default:       action [:upgrade]
==> default:       default_guard_interpreter :default
==> default:       declared_type :package
==> default:       cookbook_name "git"
==> default:       recipe_name "install"
==> default:     end
==> default:
==> default:     System Info:
==> default:     ------------
==> default:     chef_version=13.6.0
==> default:     platform=ubuntu
==> default:     platform_version=16.04
==> default:     ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
==> default:     program_name=chef-solo worker: ppid=2237;start=15:17:21;
==> default:     executable=/opt/chef/bin/chef-solo
==> default:
==> default:

But if i vagrant ssh to the machine and apt-get install git manually, then postgres is the new issue (that I don't know how to solve). This is the link to the full log: https://gist.github.com/kifki/7fb3e9322b0d8c1c66ef3652aba2ce17

ghost avatar Oct 31 '17 15:10 ghost

Okay great, I see the git issue. I'll see if I can spend some time today fixing this, sound good?

josegonzalez avatar Oct 31 '17 15:10 josegonzalez

Thank you so much!

ghost avatar Oct 31 '17 16:10 ghost

Had similar problem this morning with new install.

==> default: The following packages have unmet dependencies: ==> default: postgresql-client-9.6 : Depends: libpq5 (>= 9.6.5) but 9.5.9-0ubuntu0.16.04 is to be installed ==> default: STDERR: E: Unable to correct problems, you have held broken packages.

Since I do not have root access to install the required package manually, Just gave a shot by changing the postgresql-client version from 9.6 to 9.5 (in all recipe .rb files) fixed the issued for postgresql and proceeded.

Now an issue occured in rubygem (FFI gem) installation. Seems to be version conflict to me. Here is the full log for Ruby/FFI:

==> default: * gem_package[hub] action upgrade ==> default: [2018-02-14T16:13:11+00:00] INFO: gem_package[hub] upgraded hub to 1.12.4 ==> default: [2018-02-14T16:13:11+00:00] INFO: gem_package[hub] upgraded hub to 1.12.4 ==> default: ==> default: - upgrade package hub from uninstalled to 1.12.4 ==> default: * gem_package[ffi] action upgrade ==> default: ==> default: ===============================================================

==> default: Error executing action upgrade on resource 'gem_package[ffi]'

==> default: ===============================================================

==> default: ==> default: Mixlib::ShellOut::ShellCommandFailed ==> default: ------------------------------------ ==> default: Expected process to exit with [0], but received '1' ==> default: ---- Begin output of /usr/bin/gem install ffi -q --no-rdoc --no -ri -v "1.9.21" --source=https://www.rubygems.org --no-ri --no-rdoc --verbose --

==> default: STDOUT: Building native extensions. This could take a while...

==> default: STDERR: ERROR: Error installing ffi: ==> default: ERROR: Failed to build gem native extension. ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ ffi_c ==> default: /usr/bin/ruby2.4 -r ./siteconf20180214-14506-1y8n92r.rb extconf .rb ==> default: checking for ffi.h... no ==> default: checking for ffi.h in /usr/local/include,/usr/include/ffi... no

==> default: checking for shlwapi.h... no ==> default: checking for rb_thread_blocking_region()... no ==> default: checking for rb_thread_call_with_gvl()... yes ==> default: checking for rb_thread_call_without_gvl()... yes ==> default: creating extconf.h ==> default: creating Makefile ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_ c ==> default: make "DESTDIR=" clean ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_ c ==> default: make "DESTDIR=" ==> default: Running autoreconf for libffi ==> default: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh : 2: exec: autoreconf: not found ==> default: libffi.mk:6: recipe for target '"/var/lib/gems/2.4.0/gems/ffi-1 .9.21/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a' failed ==> default: make: *** ["/var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libff i-x86_64-linux-gnu"/.libs/libffi_convenience.a] Error 127 ==> default: ==> default: make failed, exit code 2 ==> default: ==> default: Gem files will remain installed in /var/lib/gems/2.4.0/gems/ffi -1.9.21 for inspection. ==> default: Results logged to /var/lib/gems/2.4.0/extensions/x86_64-linux/2 .4.0/ffi-1.9.21/gem_make.out ==> default: ---- End output of /usr/bin/gem install ffi -q --no-rdoc --no-r i -v "1.9.21" --source=https://www.rubygems.org --no-ri --no-rdoc --verbose ----

==> default: Ran /usr/bin/gem install ffi -q --no-rdoc --no-ri -v "1.9.21" - -source=https://www.rubygems.org --no-ri --no-rdoc --verbose returned 1 ==> default: ==> default: Resource Declaration: ==> default: ==> default: --------------------- ==> default: ==> default: # In /var/chef/cache/cookbooks/ruby/recipes/install.rb ==> default: ==> default: ==> default: 49: gem_package g do ==> default: ==> default: 50: gem_binary("/usr/bin/gem") ==> default: ==> default: 51: options "--no-ri --no-rdoc --verbose" ==> default: 52: action :upgrade ==> default: 53: end ==> default: 54: end ==> default: ==> default: Compiled Resource: ==> default: ------------------ ==> default: # Declared in /var/chef/cache/cookbooks/ruby/recipes/install.rb :49:in `block in from_file' ==> default: ==> default: gem_package("ffi") do ==> default: package_name "ffi" ==> default: action [:upgrade] ==> default: default_guard_interpreter :default ==> default: declared_type :gem_package ==> default: cookbook_name "ruby" ==> default: recipe_name "install" ==> default: gem_binary "/usr/bin/gem" ==> default: options "--no-ri --no-rdoc --verbose" ==> default: end ==> default: ==> default: System Info: ==> default: ------------ ==> default: chef_version=13.7.16 ==> default: platform=ubuntu ==> default: platform_version=16.04 ==> default: ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux] ==> default: program_name=chef-solo worker: ppid=9599;start=16:12:09; ==> default: executable=/opt/chef/bin/chef-solo ==> default: ==> default: [2018-02-14T16:13:13+00:00] INFO: Running queued delayed notificati ons before re-raising exception ==> default: [2018-02-14T16:13:13+00:00] INFO: Running queued delayed notificati ons before re-raising exception ==> default: Running handlers: ==> default: [2018-02-14T16:13:13+00:00] ERROR: Running exception handlers ==> default: [2018-02-14T16:13:13+00:00] ERROR: Running exception handlers ==> default: Running handlers complete ==> default: [2018-02-14T16:13:13+00:00] ERROR: Exception handlers complete ==> default: [2018-02-14T16:13:13+00:00] ERROR: Exception handlers complete ==> default: Chef Client failed. 4 resources updated in 01 minutes 04 seconds ==> default: [2018-02-14T16:13:13+00:00] FATAL: Stacktrace dumped to /var/chef/c ache/chef-stacktrace.out ==> default: [2018-02-14T16:13:13+00:00] FATAL: Stacktrace dumped to /var/chef/c ache/chef-stacktrace.out ==> default: [2018-02-14T16:13:13+00:00] FATAL: Please provide the contents of t he stacktrace.out file if you file a bug report ==> default: [2018-02-14T16:13:13+00:00] FATAL: Please provide the contents of t he stacktrace.out file if you file a bug report ==> default: [2018-02-14T16:13:13+00:00] ERROR: gem_package[ffi] (ruby::install line 49) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ==> default: ---- Begin output of /usr/bin/gem install ffi -q --no-rdoc --no-ri -v "1.9.21" --source=https://www.rubygems.org --no-ri --no-rdoc --verbose ---- ==> default: STDOUT: Building native extensions. This could take a while... ==> default: STDERR: ERROR: Error installing ffi: ==> default: ERROR: Failed to build gem native extension. ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_ c ==> default: /usr/bin/ruby2.4 -r ./siteconf20180214-14506-1y8n92r.rb extconf.rb ==> default: checking for ffi.h... no ==> default: checking for ffi.h in /usr/local/include,/usr/include/ffi... no ==> default: checking for shlwapi.h... no ==> default: checking for rb_thread_blocking_region()... no ==> default: checking for rb_thread_call_with_gvl()... yes ==> default: checking for rb_thread_call_without_gvl()... yes ==> default: creating extconf.h ==> default: creating Makefile ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c ==> default: make "DESTDIR=" clean ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c ==> default: make "DESTDIR=" ==> default: Running autoreconf for libffi ==> default: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: 2: exec: autoreconf: not found ==> default: libffi.mk:6: recipe for target '"/var/lib/gems/2.4.0/gems/ffi-1.9.2 1/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a' failed ==> default: make: *** ["/var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x8 6_64-linux-gnu"/.libs/libffi_convenience.a] Error 127 ==> default: ==> default: make failed, exit code 2 ==> default: ==> default: Gem files will remain installed in /var/lib/gems/2.4.0/gems/ffi-1.9 .21 for inspection. ==> default: Results logged to /var/lib/gems/2.4.0/extensions/x86_64-linux/2.4.0 /ffi-1.9.21/gem_make.out ==> default: ---- End output of /usr/bin/gem install ffi -q --no-rdoc --no-ri -v "1.9.21" --source=https://www.rubygems.org --no-ri --no-rdoc --verbose ---- ==> default: Ran /usr/bin/gem install ffi -q --no-rdoc --no-ri -v "1.9.21" --sou rce=https://www.rubygems.org --no-ri --no-rdoc --verbose returned 1 ==> default: [2018-02-14T16:13:13+00:00] ERROR: gem_package[ffi] (ruby::install line 49) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ==> default: ---- Begin output of /usr/bin/gem install ffi -q --no-rdoc --no-ri -v "1.9.21" --source=https://www.rubygems.org --no-ri --no-rdoc --verbose ---- ==> default: STDOUT: Building native extensions. This could take a while... ==> default: STDERR: ERROR: Error installing ffi: ==> default: ERROR: Failed to build gem native extension. ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_ c ==> default: /usr/bin/ruby2.4 -r ./siteconf20180214-14506-1y8n92r.rb extconf.rb ==> default: checking for ffi.h... no ==> default: checking for ffi.h in /usr/local/include,/usr/include/ffi... no ==> default: checking for shlwapi.h... no ==> default: checking for rb_thread_blocking_region()... no ==> default: checking for rb_thread_call_with_gvl()... yes ==> default: checking for rb_thread_call_without_gvl()... yes ==> default: creating extconf.h ==> default: creating Makefile ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c ==> default: make "DESTDIR=" clean ==> default: ==> default: current directory: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c ==> default: make "DESTDIR=" ==> default: Running autoreconf for libffi ==> default: /var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: 2: exec: autoreconf: not found ==> default: libffi.mk:6: recipe for target '"/var/lib/gems/2.4.0/gems/ffi-1.9.2 1/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a' failed ==> default: make: *** ["/var/lib/gems/2.4.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x8 6_64-linux-gnu"/.libs/libffi_convenience.a] Error 127 ==> default: ==> default: make failed, exit code 2 ==> default: ==> default: Gem files will remain installed in /var/lib/gems/2.4.0/gems/ffi-1.9 .21 for inspection. ==> default: Results logged to /var/lib/gems/2.4.0/extensions/x86_64-linux/2.4.0 /ffi-1.9.21/gem_make.out ==> default: ---- End output of /usr/bin/gem install ffi -q --no-rdoc --no-ri -v "1.9.21" --source=https://www.rubygems.org --no-ri --no-rdoc --verbose ---- ==> default: Ran /usr/bin/gem install ffi -q --no-rdoc --no-ri -v "1.9.21" --sou rce=https://www.rubygems.org --no-ri --no-rdoc --verbose returned 1 ==> default: [2018-02-14T16:13:13+00:00] FATAL: Chef::Exceptions::ChildConvergeE rror: Chef run process exited unsuccessfully (exit code 1) ==> default: [2018-02-14T16:13:13+00:00] FATAL: Chef::Exceptions::ChildConvergeE rror: Chef run process exited unsuccessfully (exit code 1) Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.

pravynandas avatar Feb 14 '18 16:02 pravynandas