Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Component/s: postgresql
-
Labels:None
Description
When using the postgresql cookbook on an omnibus install, it fails with this error:
[Tue, 03 Jul 2012 18:18:12 -0700] INFO: Processing gem_package[pg] action install (postgresql::client line 42) [Tue, 03 Jul 2012 18:18:18 -0700] ERROR: gem_package[pg] (postgresql::client line 42) has had an error [Tue, 03 Jul 2012 18:18:18 -0700] ERROR: Running exception handlers [Tue, 03 Jul 2012 18:18:18 -0700] FATAL: Saving node information to /var/chef/cache/failed-run-data.json [Tue, 03 Jul 2012 18:18:18 -0700] ERROR: Exception handlers complete [Tue, 03 Jul 2012 18:18:18 -0700] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out [Tue, 03 Jul 2012 18:18:18 -0700] FATAL: Mixlib::ShellOut::ShellCommandFailed: gem_package[pg] (postgresql::client line 42) 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.14.0" ---- 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-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config --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.14.0 for inspection. Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.14.0/ext/gem_make.out ---- End output of /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.14.0" ---- Ran /opt/chef/embedded/bin/gem install pg -q --no-rdoc --no-ri -v "0.14.0" returned 1
Related ticket: http://help2.opscode.com/admin.php?pg=request&reqid=12522
Issue Links
- is depended on by
-
COOK-1534
postgresql::ruby recipe to handle rubygem install, add database::postgresql recipe
-
Activity
- All
- Comments
- History
- Activity
- Transitions Summary
It appears we are failing to use the system library due to an openssl conflict.
have_library: checking for PQconnectdb() in -lpq... -------------------- no" gcc -o conftest -I/opt/chef/embedded/include/ruby-1.9.1/i686-linux -I/opt/chef/embedded/include/ruby-1.9.1/ruby/backward -I/opt/chef/embedded/include/ruby-1.9.1 -I. -I/opt/chef/embedded/include -D_FILE_OFFSET_BITS=64 -I/ usr/include/postgresql -L/opt/chef/embedded/lib -I/opt/chef/embedded/include -fPIC conftest.c -L. -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L. -Wl,-rpath / opt/chef/embedded/lib -L/opt/chef/embedded/lib -I/opt/chef/embedded/include -rdynamic -Wl,-export-dynamic -L/usr/lib -Wl,-R -Wl,/opt/chef/embedded/lib -L/opt/chef/embedded/lib -lruby-static -lpq -lpthread -lrt -ldl -lc rypt -lm -lc" /usr/lib/libpq.so: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_write@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_set_fd@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_use_PrivateKey_file@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `CRYPTO_set_locking_callback@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `X509_NAME_get_text_by_NID@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_connect@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `ENGINE_init@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `X509_STORE_load_locations@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_CTX_get_cert_store@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_free@OPENSSL_1.0.0'/usr/lib/libpq.so: undefined reference to `SSL_library_init@OPENSSL_1.0.0'/usr/lib/libpq.so: undefined reference to `SSL_CTX_ctrl@OPENSSL_1.0.0'/usr/lib/libpq.so: undefined reference to `ERR_get_error@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_pending@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `ENGINE_free@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `X509_get_subject_name@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_use_certificate_file@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_check_private_key@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_load_error_strings@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `ENGINE_by_id@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_CTX_new@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `CRYPTO_num_locks@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `ENGINE_load_private_key@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `ENGINE_finish@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_set_verify@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `X509_free@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `CRYPTO_set_id_callback@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_get_error@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_new@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_shutdown@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_use_PrivateKey@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `TLSv1_method@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `X509_STORE_set_flags@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_read@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `OPENSSL_config@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_CTX_load_verify_locations@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `ERR_reason_error_string@OPENSSL_1.0.0' /usr/lib/libpq.so: undefined reference to `SSL_set_ex_data@OPENSSL_1.0.0' collect2: ld returned 1 exit status
Would it be horrible to ask to add libpq (the ruby-pg) gem to Omnibus? Basically I don't think there is a real way to solve the problem short of doing that.
Thanks
I worked around this problem by customizing my bootstrap template to use a clean rubygems install instead of omnibus. Haven't found any omnibus-like workarounds, myself.
You actually shouldn't need to customize the bootstrap file to work around this, you can just specify any bootstrap file with -d aside from chef-full when first bootstrapping and it won't use omnibus. The ones available in 10.12 are:
centos5-gems
fedora13-gems
ubuntu10.04-gems
ubuntu10.04-apt
ubuntu12.04-gems
More info: http://wiki.opscode.com/display/chef/Knife+Bootstrap
I'm pretty sure this was broken at one point with Omnibus in Ubuntu 10.04 LTS but works now. Which project repo would I go poking in to investigate? I'd rather get eyes on an OK fix before 10.14.0 goes out the door.
So what best way to fix this problem now? Inoperability of postgresql cookbooks is prevent setup servers by chef ![]()
Ubuntu 12.04 LTS
knife-solo v0.012 (https://github.com/matschaffer/knife-solo)
Any update on a work around or fix? I'm having the same issue:
Ubuntu 12.04 LTS (64bit), Vagrant, Chef Hosted.
This bug only effects the omnibus version of Chef. For a workaround you can install through apt-get, yum, gems, or when doing a knife bootstrap just specify your distro's bootstrap file with -d. More info on the apt-get and gems options can be found here - http://wiki.opscode.com/display/chef/Installing+Chef+Client+on+Ubuntu+or+Debian Omnibus Chef is only installed when using the http://www.opscode.com/chef/install/ script or when using the default chef-full knife bootstrap file.
I would just like to note that we are affected by this bug using Omnibus package on Ubuntu 12.04
But we are NOT affected by this bug using Omnibus packages on Centos 5.6.
Is there any work being done on this issue ? Postgresql cookbook seems to be unsable at the moment. Id really like to avoid having tons of execute resources as a workaround…using pg gem during chef run would be perfection…but at the moment impossible.
Basically the problem is simple. I don't know how Opscode are building the embedded ruby which comes with Omnibus install, but it looks like they're building them against not standard OS libraries. I had a go at installing the pg gem linking it against OS libs and all goes through just fine:
$ ruby --version ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
$ gem --version 1.8.23
$ sudo gem install pg Building native extensions. This could take a while... Successfully installed pg-0.14.1 1 gem installed Installing ri documentation for pg-0.14.1... Installing RDoc documentation for pg-0.14.1...
The quintessential problem here is that the OpenSSL library Opscode's ruby is trying to link against when bulding 'pg' is different than the one that PostgreSQL was built with - this means that the omnibus ruby must be built against non-standard OS libraries ?? - meaning this is not built on actual versions of OS which he omnibus install.sh picker on http://www.opscode.com/chef/install/ is trying to suggest.
Would be awesome if the embedded ruby build was fixed with this regard. There is a few blockers which would be awesome if they were fixed.
Also one of the workarounds here is to use Opscode packages for chef-client. I would STRONGLY advise AGAINST that as the Opscode pacakge ship with ruby 1.8 - I guess I don't need to add more to this
Interesting thing though is that Opscode package come with ruby 1.8 and omnibus with 1.9.3..
That's basically how far I got as well.
Here's some more debug output. First, this is the openssl version shipped with omnibus:
#####################
# /opt/chef/embedded/bin/openssl
vagrant@jenkins:~$ /opt/chef/embedded/bin/openssl version
OpenSSL 1.0.0f 4 Jan 2012
vagrant@jenkins:~$ ldd /opt/chef/embedded/bin/openssl
linux-vdso.so.1 => (0x00007fff1f1ff000)
libssl.so.1.0.0 => /opt/chef/embedded/lib/libssl.so.1.0.0 (0x00007f737d52f000)
libcrypto.so.1.0.0 => /opt/chef/embedded/lib/libcrypto.so.1.0.0 (0x00007f737d178000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f737cf6b000)
libz.so.1 => /opt/chef/embedded/lib/libz.so.1 (0x00007f737cd4e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f737c98f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f737d78d000)
vagrant@jenkins:~$ ll /opt/chef/embedded/lib/libssl.so
lrwxrwxrwx 1 root root 15 Oct 4 01:45 /opt/chef/embedded/lib/libssl.so -> libssl.so.1.0.0*
And this is what's on the system (Ubuntu 12.04):
####################
# /usr/bin/openssl
vagrant@jenkins:~$ /usr/bin/openssl version
OpenSSL 1.0.1 14 Mar 2012
vagrant@jenkins:~$ ldd /usr/bin/openssl
linux-vdso.so.1 => (0x00007fffd7889000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fd83992f000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fd839567000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8391a7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd838fa3000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd838d8c000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd839b95000)
vagrant@jenkins:~$ ll /usr/lib/x86_64-linux-gnu/libssl.so
lrwxrwxrwx 1 root root 37 Aug 21 05:22 /usr/lib/x86_64-linux-gnu/libssl.so -> /lib/x86_64-linux-gnu/libssl.so.1.0.0
Interestingly, the system openssl reports to be version 1.0.1 but seems to be linked against 1.0.0 libraries?!? If that is the case, why is there a conflict? I still don't fully understand what's going on...
I then wanted to override the -I and -L flags that are used when `/opt/chef/embedded/bin/gem install` compiles the native extensions, but haven't figured how to do this yet... (and not even sure if that would help)
I was able to get the pg gem to install in the Chef omnibus location with the "install.sh" here:
https://gist.github.com/3954641
I haven't done further testing about the functionality of this within a Ruby program, nor have I put this in a recipe.
The gist also includes the file list of the leftovers after removing the chef package.
What are folks' thoughts about installing postgresql from source into the omnibus location only when Chef needs to interact through the pg gem (such as the database cookbook's resources)? It totally doesn't feel right to me because it's an unmanaged source install.
I agree, it feels dirty. Is there any reason outside of the client contacting chef servers and user interactions for OpenSSL to be bundled?
If not, is there way to statically link the OpenSSL libraries into the omnibus ruby binaries so they have the required bits to be able to function in a minimal environment? If this can be accomplished, then it seems the best option is to begin using system libraries for everything else. The only remaining question would be; does doing this negatively impact other platforms, such as Windows?
I realize this is a huge change in the omnibus and chef packaging for potentially one component... but it's the best alternative I can think of at the moment. I hope this feedback is useful.
Thanks Joshua! The workaround you gisted works for me. I've put it in a recipe (one big execute block for now) and afterwards used the database cookbook to set up users and databases via the pg gem. No problems so far.
Yet I agree with Ryan and second the approach he describes. Postgres might not be the only place where we could fail due to this conflict, I suspect there are other gems which would fail in the same way currently...
Pull request: https://github.com/opscode-cookbooks/postgresql/pull/28
For future posterity... There seems to be some misunderstanding of the omnibus design goals in the comments above. Addressing what @Milos mentioned in particular, the design goal of omnibus is to ship a consistent version of openssl in /opt/chef which is pinned at a given version across all platforms (rhel 5, rhel 6, ubuntu >= 10.06, solaris 8/9/10, debian, suse, etc). The mismatch between the standard O/S libraries and the omnibus libraries is not a bug, it is a design goal and is the whole point. From the perspective of an ubuntu 12.10 customer this looks like a step backwards, but it means we don't need to support backwards compatibility with whatever shipped in rhel5 6+ years ago...
I'm still unable to get the fix to work under 12.04 using v2.0.2.
172.20.1.170 [2012-11-30T11:15:40-08:00] INFO: Processing package[postgresql-client] action install (postgresql::client line 24) 172.20.1.170 172.20.1.170 [2012-11-30T11:15:40-08:00] INFO: Processing package[libpq-dev] action install (postgresql::client line 24) 172.20.1.170 172.20.1.170 [2012-11-30T11:15:41-08:00] INFO: Processing chef_gem[pg] action install (postgresql::ruby line 40) 172.20.1.170 172.20.1.170 172.20.1.170 ================================================================================ 172.20.1.170 172.20.1.170 Error executing action `install` on resource 'chef_gem[pg]' 172.20.1.170 172.20.1.170 ================================================================================ 172.20.1.170 172.20.1.170 172.20.1.170 Gem::Installer::ExtensionBuildError 172.20.1.170 172.20.1.170 ----------------------------------- 172.20.1.170 172.20.1.170 ERROR: Failed to build gem native extension. 172.20.1.170 172.20.1.170 172.20.1.170 /opt/chef/embedded/bin/ruby extconf.rb 172.20.1.170 172.20.1.170 checking for pg_config... yes 172.20.1.170 172.20.1.170 Using config values from /usr/bin/pg_config 172.20.1.170 172.20.1.170 checking for libpq-fe.h... yes 172.20.1.170 172.20.1.170 checking for libpq/libpq-fs.h... yes 172.20.1.170 172.20.1.170 checking for pg_config_manual.h... yes 172.20.1.170 172.20.1.170 checking for PQconnectdb() in -lpq... no 172.20.1.170 172.20.1.170 checking for PQconnectdb() in -llibpq... no 172.20.1.170 172.20.1.170 checking for PQconnectdb() in -lms/libpq... no 172.20.1.170 172.20.1.170 Can't find the PostgreSQL client library (libpq) 172.20.1.170 172.20.1.170 *** extconf.rb failed *** 172.20.1.170 172.20.1.170 Could not create Makefile due to some reason, probably lack of 172.20.1.170 172.20.1.170 necessary libraries and/or headers. Check the mkmf.log file for more 172.20.1.170 172.20.1.170 details. You may need configuration options. 172.20.1.170 172.20.1.170 172.20.1.170 Provided configuration options: 172.20.1.170 172.20.1.170 172.20.1.170 --with-opt-dir 172.20.1.170 172.20.1.170 172.20.1.170 --with-opt-include 172.20.1.170 172.20.1.170 172.20.1.170 --without-opt-include=${opt-dir}/include 172.20.1.170 172.20.1.170 --with-opt-lib 172.20.1.170 --without-opt-lib=${opt-dir}/lib 172.20.1.170 --with-make-prog 172.20.1.170 --without-make-prog 172.20.1.170 172.20.1.170 --srcdir=. 172.20.1.170 --curdir 172.20.1.170 --ruby=/opt/chef/embedded/bin/ruby 172.20.1.170 --with-pg 172.20.1.170 --without-pg 172.20.1.170 --with-pg-dir 172.20.1.170 172.20.1.170 --without-pg-dir 172.20.1.170 --with-pg-include 172.20.1.170 --without-pg-include=${pg-dir}/include 172.20.1.170 --with-pg-lib 172.20.1.170 --without-pg-lib=${pg-dir}/lib 172.20.1.170 --with-pg-config 172.20.1.170 --without-pg-config 172.20.1.170 --with-pg_config 172.20.1.170 --without-pg_config 172.20.1.170 --with-pqlib 172.20.1.170 --without-pqlib 172.20.1.170 172.20.1.170 --with-libpqlib 172.20.1.170 --without-libpqlib 172.20.1.170 --with-ms/libpqlib 172.20.1.170 --without-ms/libpqlib 172.20.1.170 172.20.1.170 172.20.1.170 Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.14.1 for inspection. 172.20.1.170 172.20.1.170 Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.14.1/ext/gem_make.out 172.20.1.170 172.20.1.170 Cookbook Trace: 172.20.1.170 172.20.1.170 --------------- 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:40:in `rescue in from_file' 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:21:in `from_file' 172.20.1.170 /var/chef/cache/cookbooks/singlenomore/recipes/default.rb:9:in `from_file' 172.20.1.170 172.20.1.170 Resource Declaration: 172.20.1.170 --------------------- 172.20.1.170 172.20.1.170 # In /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb 172.20.1.170 172.20.1.170 40: chef_gem "pg" 172.20.1.170 41: rescue Gem::Installer::ExtensionBuildError => e 172.20.1.170 172.20.1.170 Compiled Resource: 172.20.1.170 ------------------ 172.20.1.170 # Declared in /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:40:in `rescue in from_file' 172.20.1.170 172.20.1.170 172.20.1.170 chef_gem("pg") do 172.20.1.170 provider Chef::Provider::Package::Rubygems 172.20.1.170 action :install 172.20.1.170 retries 0 172.20.1.170 retry_delay 2 172.20.1.170 package_name "pg" 172.20.1.170 version "0.14.1" 172.20.1.170 cookbook_name "postgresql" 172.20.1.170 recipe_name "ruby" 172.20.1.170 end 172.20.1.170 172.20.1.170 [2012-11-30T11:15:51-08:00] WARN: Failed to properly build pg gem. Forcing properly linking and retrying (omnibus fix) 172.20.1.170 172.20.1.170 [2012-11-30T11:15:51-08:00] INFO: Processing execute[generate pg gem Makefile] action run (postgresql::ruby line 71) 172.20.1.170 172.20.1.170 checking for pg_config... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for libpq-fe.h... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for libpq/libpq-fs.h... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for pg_config_manual.h... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQconnectdb() in -lpq... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQconnectionUsedPassword()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQisthreadsafe()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQprepare()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQexecParams()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQescapeString()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQescapeStringConn()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQescapeLiteral()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQescapeIdentifier()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQgetCancel()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for lo_create()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for pg_encoding_to_char()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for pg_char_to_encoding()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQsetClientEncoding()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQlibVersion()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PQping()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for rb_encdb_alias()... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for rb_enc_alias()... 172.20.1.170 no 172.20.1.170 172.20.1.170 checking for PGRES_COPY_BOTH in libpq-fe.h... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for PGRES_SINGLE_TUPLE in libpq-fe.h... 172.20.1.170 no 172.20.1.170 172.20.1.170 checking for struct pgNotify.extra in libpq-fe.h... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for unistd.h... 172.20.1.170 yes 172.20.1.170 172.20.1.170 checking for ruby/st.h... 172.20.1.170 yes 172.20.1.170 172.20.1.170 creating extconf.h 172.20.1.170 172.20.1.170 creating Makefile 172.20.1.170 172.20.1.170 [2012-11-30T11:16:02-08:00] INFO: execute[generate pg gem Makefile] ran successfully 172.20.1.170 172.20.1.170 [2012-11-30T11:16:02-08:00] INFO: Processing execute[make pg gem lib] action run (postgresql::ruby line 78) 172.20.1.170 172.20.1.170 172.20.1.170 ================================================================================ 172.20.1.170 172.20.1.170 Error executing action `run` on resource 'execute[make pg gem lib]' 172.20.1.170 172.20.1.170 ================================================================================ 172.20.1.170 172.20.1.170 172.20.1.170 Errno::ENOENT 172.20.1.170 172.20.1.170 ------------- 172.20.1.170 172.20.1.170 No such file or directory - make 172.20.1.170 172.20.1.170 172.20.1.170 Cookbook Trace: 172.20.1.170 172.20.1.170 --------------- 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:83:in `rescue in rescue in from_file' 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:39:in `rescue in from_file' 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:21:in `from_file' 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/singlenomore/recipes/default.rb:9:in `from_file' 172.20.1.170 172.20.1.170 172.20.1.170 Resource Declaration: 172.20.1.170 172.20.1.170 --------------------- 172.20.1.170 172.20.1.170 # In /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb 172.20.1.170 172.20.1.170 172.20.1.170 78: lib_maker = execute 'make pg gem lib' do 172.20.1.170 172.20.1.170 79: command 'make' 172.20.1.170 172.20.1.170 80: cwd ext_dir 172.20.1.170 172.20.1.170 81: action :nothing 172.20.1.170 172.20.1.170 82: end 172.20.1.170 172.20.1.170 83: lib_maker.run_action(:run) 172.20.1.170 172.20.1.170 172.20.1.170 Compiled Resource: 172.20.1.170 172.20.1.170 ------------------ 172.20.1.170 172.20.1.170 # Declared in /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:78:in `rescue in rescue in from_file' 172.20.1.170 172.20.1.170 172.20.1.170 execute("make pg gem lib") do 172.20.1.170 172.20.1.170 action [:nothing] 172.20.1.170 172.20.1.170 retries 0 172.20.1.170 172.20.1.170 retry_delay 2 172.20.1.170 172.20.1.170 command "make" 172.20.1.170 backup 5 172.20.1.170 cwd "/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/pg-0.14.1/ext" 172.20.1.170 returns 0 172.20.1.170 cookbook_name "postgresql" 172.20.1.170 recipe_name "ruby" 172.20.1.170 end 172.20.1.170 172.20.1.170 172.20.1.170 ================================================================================ 172.20.1.170 172.20.1.170 Recipe Compile Error in /var/chef/cache/cookbooks/singlenomore/recipes/default.rb 172.20.1.170 172.20.1.170 ================================================================================ 172.20.1.170 172.20.1.170 172.20.1.170 Errno::ENOENT 172.20.1.170 172.20.1.170 ------------- 172.20.1.170 172.20.1.170 execute[make pg gem lib] (postgresql::ruby line 78) had an error: Errno::ENOENT: No such file or directory - make 172.20.1.170 172.20.1.170 172.20.1.170 Cookbook Trace: 172.20.1.170 172.20.1.170 --------------- 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:83:in `rescue in rescue in from_file' 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:39:in `rescue in from_file' 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb:21:in `from_file' 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/singlenomore/recipes/default.rb:9:in `from_file' 172.20.1.170 172.20.1.170 172.20.1.170 Relevant File Content: 172.20.1.170 172.20.1.170 ---------------------- 172.20.1.170 172.20.1.170 /var/chef/cache/cookbooks/postgresql/recipes/ruby.rb: 172.20.1.170 172.20.1.170 172.20.1.170 76: lib_builder.run_action(:run) 172.20.1.170 172.20.1.170 77: 172.20.1.170 172.20.1.170 78: lib_maker = execute 'make pg gem lib' do 172.20.1.170 172.20.1.170 79: command 'make' 172.20.1.170 172.20.1.170 80: cwd ext_dir 172.20.1.170 172.20.1.170 81: action :nothing 172.20.1.170 172.20.1.170 82: end 172.20.1.170 172.20.1.170 83>> lib_maker.run_action(:run) 172.20.1.170 172.20.1.170 84: 172.20.1.170 172.20.1.170 85: lib_installer = execute 'install pg gem lib' do 172.20.1.170 172.20.1.170 86: command 'make install' 172.20.1.170 172.20.1.170 87: cwd ext_dir 172.20.1.170 88: action :nothing 172.20.1.170 89: end 172.20.1.170 90: lib_installer.run_action(:run) 172.20.1.170 91: 172.20.1.170 92: spec_installer = execute 'install pg spec' do 172.20.1.170 172.20.1.170 [2012-11-30T11:16:02-08:00] ERROR: Running exception handlers 172.20.1.170 172.20.1.170 [2012-11-30T11:16:02-08:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json 172.20.1.170 172.20.1.170 [2012-11-30T11:16:02-08:00] ERROR: Exception handlers complete 172.20.1.170 172.20.1.170 [2012-11-30T11:16:02-08:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 172.20.1.170 172.20.1.170 [2012-11-30T11:16:02-08:00] FATAL: Errno::ENOENT: execute[make pg gem lib] (postgresql::ruby line 78) had an error: Errno::ENOENT: No such file or directory - make
Looks like build-essential is missing: 172.20.1.170 [2012-11-30T11:16:02-08:00] FATAL: Errno::ENOENT: execute[make pg gem lib] (postgresql::ruby line 78) had an error: Errno::ENOENT: No such file or directory - make
Might take a look at your build-essential cookbook. If it's not a current version, you're likely missing the compile time install support.
I'm using version build-essential 1.2.0 and postgresql 2.0.2. I see default['build_essential']['compiletime'] in the attributes file. I've set that to true.
Hi Andrew. It still looks like an issue with build-essential. The same error is showing up (no make executable found). Does the make executable actually exist on that system? Is it in some non-standard path?
Adam: This looks to be the same issue that Andrew was having. It is likely your build-essential cookbook needs to be updated to a later version. It provides an attribute flag to install the build essential tools at compile time, which are required to build the pg gem. Relevant error in log pointing to this:
ec2-54-235-44-15.compute-1.amazonaws.com No such file or directory - make
So upgrade your build-essential cookbook, re-converge the node, and see if that resolves things.
Cheers!
Using the Ubuntu 12.04 Precise EC2 ami and installing via Rubygems, the postgresql::server recipe succeeds.
knife ec2 server create -I ami-b89842d1 -G btm -S btm -x ubuntu -r "recipe[apt],recipe[apt::update],recipe[postgresql::server]" -d ubuntu12.04-gems --bootstrap-version 10.12.0However, using the omnibus install (chef-full template), the postgresql::server recipe fails building the pg gem.
knife ec2 server create -I ami-b89842d1 -G btm -S btm -x ubuntu -r "recipe[apt],recipe[apt::update],recipe[postgresql::server]" -d chef-full --bootstrap-version 10.12.0