Giter Club home page Giter Club logo

Comments (12)

amer avatar amer commented on July 30, 2024

Same problem here.

Starting Chef Client, version 11.14.0.rc.2
Compiling Cookbooks...
Recipe: build-essential::_debian
  * package[autoconf] action install (up to date)
  * package[binutils-doc] action install (up to date)
  * package[bison] action install (up to date)
  * package[build-essential] action install (up to date)
  * package[flex] action install (up to date)
  * package[gettext] action install (up to date)
  * package[ncurses-dev] action install (up to date)
Recipe: postgresql::client
  * package[postgresql-client-9.3] action install (up to date)
  * package[libpq-dev] action install (up to date)
Recipe: postgresql::ruby
  * chef_gem[pg] action install

    ================================================================================
    Error executing action `install` on resource 'chef_gem[pg]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
    STDOUT: Building native extensions.  This could take a while...
    STDERR: ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

            /opt/chef/embedded/bin/ruby extconf.rb
    checking for pg_config... yes
    Using config values from /usr/bin/pg_config
    checking for libpq-fe.h... yes
    checking for libpq/libpq-fs.h... yes
    checking for pg_config_manual.h... yes
    checking for PQconnectdb() in -lpq... no
    checking for PQconnectdb() in -llibpq... no
    checking for PQconnectdb() in -lms/libpq... no
    Can't find the PostgreSQL client library (libpq)
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.

    Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/opt/chef/embedded/bin/ruby
        --with-pg
        --without-pg
        --with-pg-config
        --without-pg-config
        --with-pg_config
        --without-pg_config
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/lib
        --with-pqlib
        --without-pqlib
        --with-libpqlib
        --without-libpqlib
        --with-ms/libpqlib
        --without-ms/libpqlib


    Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1 for inspection.
    Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1/ext/gem_make.out
    ---- End output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
    Ran /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" returned 1

    Cookbook Trace:
    ---------------
    /home/vagrant/chef-solo/cookbooks-2/postgresql/recipes/ruby.rb:58:in `rescue in from_file'
    /home/vagrant/chef-solo/cookbooks-2/postgresql/recipes/ruby.rb:24:in `from_file'
    /home/vagrant/chef-solo/cookbooks-2/database/recipes/postgresql.rb:20:in `from_file'
    /home/vagrant/chef-solo/cookbooks-2/databox/recipes/postgresql.rb:16:in `from_file'
    /home/vagrant/chef-solo/cookbooks-2/databox/recipes/default.rb:12:in `from_file'

    Resource Declaration:
    ---------------------
    # In /home/vagrant/chef-solo/cookbooks-2/postgresql/recipes/ruby.rb

     58:     chef_gem "pg"
     59:   rescue Gem::Installer::ExtensionBuildError => e

    Compiled Resource:
    ------------------
    # Declared in /home/vagrant/chef-solo/cookbooks-2/postgresql/recipes/ruby.rb:58:in `rescue in from_file'

    chef_gem("pg") do
      provider Chef::Provider::Package::Rubygems
      action :install
      retries 0
      retry_delay 2
      guard_interpreter :default
      package_name "pg"
      version "0.17.1"
      timeout 900
      gem_binary "/opt/chef/embedded/bin/gem"
      cookbook_name :postgresql
      recipe_name "ruby"
    end


  ================================================================================
  Recipe Compile Error in /home/vagrant/chef-solo/cookbooks-2/databox/recipes/default.rb
  ================================================================================

  Mixlib::ShellOut::ShellCommandFailed
  ------------------------------------
  chef_gem[pg] (postgresql::ruby line 58) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
  ---- Begin output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
  STDOUT: Building native extensions.  This could take a while...
  STDERR: ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

          /opt/chef/embedded/bin/ruby extconf.rb
  checking for pg_config... yes
  Using config values from /usr/bin/pg_config
  checking for libpq-fe.h... yes
  checking for libpq/libpq-fs.h... yes
  checking for pg_config_manual.h... yes
  checking for PQconnectdb() in -lpq... no
  checking for PQconnectdb() in -llibpq... no
  checking for PQconnectdb() in -lms/libpq... no
  Can't find the PostgreSQL client library (libpq)
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of
  necessary libraries and/or headers.  Check the mkmf.log file for more
  details.  You may need configuration options.

  Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/opt/chef/embedded/bin/ruby
    --with-pg
    --without-pg
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib


  Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1 for inspection.
  Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1/ext/gem_make.out
  ---- End output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
  Ran /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" returned 1

  Cookbook Trace:
  ---------------
    /home/vagrant/chef-solo/cookbooks-2/postgresql/recipes/ruby.rb:58:in `rescue in from_file'
    /home/vagrant/chef-solo/cookbooks-2/postgresql/recipes/ruby.rb:24:in `from_file'
    /home/vagrant/chef-solo/cookbooks-2/database/recipes/postgresql.rb:20:in `from_file'
    /home/vagrant/chef-solo/cookbooks-2/databox/recipes/postgresql.rb:16:in `from_file'
    /home/vagrant/chef-solo/cookbooks-2/databox/recipes/default.rb:12:in `from_file'

  Relevant File Content:
  ----------------------
  /home/vagrant/chef-solo/cookbooks-2/postgresql/recipes/ruby.rb:

   51:    end
   52:  
   53:    node['postgresql']['client']['packages'].each do |pg_pack|
   54:      resources("package[#{pg_pack}]").run_action(:install)
   55:    end
   56:  
   57:    begin
   58>>     chef_gem "pg"
   59:    rescue Gem::Installer::ExtensionBuildError => e
   60:      # Are we an omnibus install?
   61:      raise if RbConfig.ruby.scan(%r{(chef|opscode)}).empty?
   62:      # Still here, must be omnibus. Lets make this thing install!
   63:      Chef::Log.warn 'Failed to properly build pg gem. Forcing properly linking and retrying (omnibus fix)'
   64:      gem_dir = e.message.scan(%r{will remain installed in ([^ ]+)}).flatten.first
   65:      raise unless gem_dir
   66:      gem_name = File.basename(gem_dir)
   67:      ext_dir = File.join(gem_dir, 'ext')


  Running handlers:
[2014-08-03T12:27:53+00:00] ERROR: Running exception handlers
  Running handlers complete
[2014-08-03T12:27:53+00:00] ERROR: Exception handlers complete
[2014-08-03T12:27:53+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
  Chef Client failed. 0 resources updated in 26.797060238 seconds
[2014-08-03T12:27:53+00:00] ERROR: chef_gem[pg] (postgresql::ruby line 58) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
STDOUT: Building native extensions.  This could take a while...
STDERR: ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

        /opt/chef/embedded/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/opt/chef/embedded/bin/ruby
    --with-pg
    --without-pg
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib


Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.17.1/ext/gem_make.out
---- End output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" ----
Ran /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.17.1" returned 1
[2014-08-03T12:27:53+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.

from postgresql.

SimonKaluza avatar SimonKaluza commented on July 30, 2024

I have nearly identical error output... Looks like the new Mixlib::ShellOut::ShellCommandFailed exception is the culprit

from postgresql.

SimonKaluza avatar SimonKaluza commented on July 30, 2024

I forked the develop branch to temporarily fix this and merged it to master so I could still deploy applications using this cookbook... You can point your Berksfile to it this until pull request #169 is accepted

cookbook 'postgresql', git: 'https://github.com/SimonKaluza/postgresql.git'

from postgresql.

hulu1522 avatar hulu1522 commented on July 30, 2024

+1
@SimonKaluza
Confirmed repo https://github.com/SimonKaluza/postgresql.git works.

from postgresql.

chrisferry avatar chrisferry commented on July 30, 2024

👍

from postgresql.

chriskilding avatar chriskilding commented on July 30, 2024

@SimonKaluza I can also confirm that your fork of the recipe works on 14.04

from postgresql.

allaire avatar allaire commented on July 30, 2024

👍 thanks

from postgresql.

theSociableme avatar theSociableme commented on July 30, 2024

Same problem

from postgresql.

mavenastic avatar mavenastic commented on July 30, 2024

I get the same issue using cookbook 'postgresql', git: "https://github.com/SimonKaluza/postgresql.git" and the postgresql::ruby recipe with a target Debian 7.6 server.

What is surprising is that:

  • bundle install runs fine when done manually on the server.
  • the patch has been merged per #169

Any idea?

from postgresql.

slyness avatar slyness commented on July 30, 2024

#169 was merged and is available in the latest supermarket versions. If this hasn't resolved the issue please re-open the issue.

from postgresql.

germs12 avatar germs12 commented on July 30, 2024

@slyness This worked for me (to use the supermarket version), but seems to be broken in master. I encountered the issue using the github version, but resolved w/ the supermarket version (depends 'postgresql', '~> 3.4.18')

from postgresql.

lock avatar lock commented on July 30, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from postgresql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.