-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
pg gem fails to compile with chef 12.0 #212
Comments
Same here... Somewhere something has changed with the embedded ruby in chef-12.0.0 and causes the whole thing to fail. Here in the When it tries to do the omnibus fix it fails:
Sorry for this set back but this is a major issue unless people lock their chef version. EDIT: EDIT 2: lib_builder = execute 'generate pg gem Makefile' do
# [COOK-3490] pg gem install requires full path on RHEL
environment "PATH" => "#{ENV['PATH']}:/usr/pgsql-#{node['postgresql']['version']}/bin #{RbConfig.ruby} extconf.rb"
cwd ext_dir
action :nothing
end
lib_builder.run_action(:run) |
As I explained, this is not due to the removal of the Digging into this, I was able to reproduce the build failure. The mkmf.log has these errors:
And later,
These errors are repeated a couple times, I'm sure if you look at mkmf.log on your system ( Running chef 11.16.4 using the omnibus package worked, and I believe it's because that version uses Ruby 1.9.3. Compare Chef 11.16.4's embedded ruby:
Versus Chef 12.0.0's:
The requirements of the
It's possible it hasn't been tested, and may not work, on Ruby 2.1.0+. |
The PG gem works fine with Ruby 2.1.2 -- I use it all the time. It just doesn't work with Chef for some bizarre reason. I just ran into this, myself. |
Same issue here. |
Similar to the OP, I was able to work around it in
Of course, that ONLY works for kitchen and not for, say, knife bootstrap. One way or the other, moral of the story is to pin your versions... While I haven't tried it, it's also possible that the issue could be worked around the "long way", for people who really need 12, by dropping the omnibus altogether and instead installing chef as a gem in sequence with others. I remember seeing this as an alternative while googling around. As a relative newbie, though, I don't much like the idea. The Omnibus is a good idea. It's just breaking stuff, here... |
It seems like this is pretty clear about what the problem is:
So what is responsible for installing the pg libs and where are they and why can't extconf.rb find them? |
What it seems like and what it is are two different universes :-) The library is installed. I checked. Also, this works fine with the 11.16.4 omnibus. |
This is the same as chef/chef#2587. Where's the problem. Should the recipe be fixed, or is it a bug in Chef? |
What is the complete output of mkmf.log? |
@lamont-granquist I'll unpin and reconverge and let you know in a little while. I do remember that the error didn't really seem to make a lot of sense, though 😄 |
Yeah mkmf.log never makes any sense, part of the reason why I need to see the whole thing in context... |
|
Here is a link to my |
So its most likely this one I think:
A lot of the tests aren't relevant, we need to look only at the -lpq ones, and most of the other ones blow up in the parser as ruby steps through different C syntaxes. This one parsed and compiled but failed to link. It looks like we're getting a conflict between the embedded openssl and the system one. Not sure how solvable that is, because ruby needs to load the openssl from embedded, but if the system libpg can't link against that one, you just can't load that into the same C process. This smells like a resurrection of the old problem we had with this cookbook, details have paged out of my brain but there's a COOK ticket somewhere. |
Don't know if this is needed but I thought I would post a link to the successful build |
Yeah @hulu1522 that's useful, here's the same test, passing:
wonder if this is related to the LIBPATH stuff in mkmf.rb that trolled AIX builds so hard... |
@lamont-granquist This absolutely looks like a resurrection of the old issue that turned out to be incompatible SSL libraries or something bizarre like that. I was at first really crabby because I assumed it was that issue and it still wasn't fixed, but pinning back to 11.16.4 suggests instead that this is a case of the issue being a hydra :-) |
Yeah, I think it may be ruby 2.1 did some changes that re-introduced the problem. Wouldn't show up on normal non-omnibus-chef pg-gem on ruby 2.1. And, the two gcc compile lines only differ by the new one having |
Try editing
(or whatever its set to, but its probably set to that on linuxen) |
We ship openssl 1.0.1j in chef-11 as well so that didn't change. |
Hey, I didn't say any of this actually made sense :-) I've had other fish to fry this afternoon, but I'll try the above rbconfig.rb thing when I can. |
That solution works. Of course, that's not a practical solution for actually using, say, knife solo in an automatic way going forward, but it did make things work. Full procedure:
|
Heh,yeah, so we can work on ripping that out of the base ruby that we ship. I knew about that issue offhand because it already trolled us hard when we were building omnibus chef on AIX, so we already have some workarounds that we can just apply on every platform. |
...AIX... You are brave! 😄 |
HAHAHAHAHAHAHAHHAHAHA, luckily for me we hired some other sucker to take it over (@scotthain), but i still wind up learning more than i ever wanted to about it... |
I don't know what you're talking about @lamont-granquist ;) |
For those using Test-Kitchen this is a TEMP work around until the fix is merged: fix = Chef::Util::FileEdit.new("/opt/chef/embedded/lib/ruby/2.1.0/x86_64-linux/rbconfig.rb")
fix.search_file_delete_line("^.*LIBPATHENV.*$")
fix.write_file Just put it in your recipe. |
As workarounds go, that's not terrible, but it would be nice if the issue itself did not keep rearing its head every time a version changes! 😄 (I know, I'm demanding!) |
Can this be re-opened @amdprophet ? |
FYI I was working on spiking out a It's not yet working and I had to move on to something else for now, but I can't see why it shouldn't be possible, if someone wants to submit PRs. A custom postgresql is required for now, and can be found in the berksfile. test-kitchen suite should be functional. |
I'm seeing this issue with Ubuntu 14.04 and Chef Client 12.4.2, getting the same output as @sfroehler. |
Hit this with chefdk 7.0 / chef-solo 12.4.1. Reverted to chef-solo 11.14.2 for testing, deploying. |
Yeah, hitting this too. Maybe this hacky workaround will give someone more capable a bit of insight. vagrant@vagrant:~$ chef-client -v Vagrant 1.7.4 audrey:ubuntu2 jluc$ chef -v workaround: depends 'build-essential' #this was added Now, this is not the only cookbook to require build-essential in my build, so I found it odd that I would encounter this problem. Apparently however, if my bemyerp-postgresql cookbooks recipe are first in the sequence, before other cookbooks using build-essential, then things are ok. If other cookbooks using build_essential go first, then fail. Could it be that postgresql's use of build_essential requires it to be 'just so'. Which it gets if it goes first, but not if it some other cookbooks gets there first? |
test-kitchen 1.4.2 Running into this same issue on test kitchen when attempting to install berkflow 0.7.0 gem_package 'berkflow' do
version '0.7.0'
options('--no-document --no-user-install --install-dir /opt/chefdk/embedded/lib/ruby/gems/2.1.0')
action :install
end Attempted the fix mentioned above (no difference in behavior) fix = Chef::Util::FileEdit.new('/opt/chef/embedded/lib/ruby/2.1.0/x86_64-linux/rbconfig.rb')
fix.search_file_delete_line('^.*LIBPATHENV.*$')
fix.write_file The error claims that a file was made at /opt/chefdk/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/ffi-1.9.10/gem_make.out but the only one on the system was /opt/chefdk/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/ffi-1.9.8/gem_make.out, contents are
If I manually install the berkflow gem with
it works as expected. On a side note, execute 'chef gem install berkflow -v 0.7.0 --no-user-install' places it on a strange path under root when I would expect it to be under /opt/chefdk/.../bin I'm trying to make a pre-configured chef workstation with the gems my org adds in for our workflow |
+1 Seeing this on mysql gem. |
Also hitting this on Ubuntu 14.04 w/ chef-client 12.3.0. Trying to install pg for an lwrp I wrote, have libpq-dev installed at the system level. |
What's odd for me is it's failing running this It didn't even get to the part where it tried to compile it or at least didn't log it. I put ignore_failures true for the gem install just so jenkins would stop failing and the gem eventually gets installed but it's not a gem I need other that would be problematic. |
Try setting I seem to remember some reason this couldn't be done automatically, but maybe I'm wrong... |
tried the compile time, didn't work. What's odd is it's not even getting to the point of compiling the gem it fails earlier than that. |
Yeah, I've tried all the recommended work-around to no avail. For me, it can't find the libpq-dev dependency even though it is installed and the pg gem installs for the system ruby just fine. In my case since there doesn't seem to be a direct solution to this readily available I'm going to rewrite my lwrp to shell out to psql commands. It's going to be a bit of a PITA, but it's better than not working at all. |
Ah, just ran into this again yesterday when working on a new cookbook, and saw that I needed to set |
I changed the order of the gem install and it's better. I got the same What is the root cause of all this? This isn't just a pg gem issue. On Mon, Dec 7, 2015 at 3:19 PM, Patrick Connolly notifications@github.com
|
It has something to do with how the dependency paths for the omnibus components are set. I've lifted the solution from the postgres cookbook referenced above into my LWRP and it seems to work: https://github.com/hw-cookbooks/postgresql/blob/develop/recipes/ruby.rb#L32 |
I think the mysql2_chef_gem cookbook has the proper future-oriented approach (see my comment above for link to abandonned WIP) |
following up, in my case the problem was lack of memory. I changed my resource to run |
I'm getting this. This is first time i'm trying to install mysql on ubuntu in vagrant environment using chef provisioner Vagrant 1.8.5 depends 'apt', ' "gcc -o conftest -I/opt/chef/embedded/include/ruby-2.1.0/x86_64-linux -I/opt/chef/embedded/include/ruby-2.1.0/ruby/backward -I/opt/chef/embedded/include/ruby-2.1.0 -I. -I/usr/local/include -I/opt/chef/embedded/include -O2 -O3 -g -pipe -I/opt/chef/embedded/include -I/opt/chef/embedded/include -O2 -O3 -g -pipe -fPIC conftest.c -L. -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -L. -Wl,-rpath,/opt/chef/embedded/lib -fstack-protector -L/opt/chef/embedded/lib -rdynamic -Wl,-export-dynamic -L/opt/chef/embedded/lib -Wl,-R/opt/chef/embedded/lib -lnsl -lz -lm -Wl,-R -Wl,/opt/chef/embedded/lib -L/opt/chef/embedded/lib -lruby -lmysqlclient -lnsl -lz -lm -lpthread -lrt -ldl -lcrypt -lm -lc" Any solution? |
You're in the wrong cookbook issue queue, @ashwinrayaprolu1984 ;) Just came across this mysql, so you'll want to drop a +1 here: |
I saw this just now . Thanks for reply i had fixed it in meantime though. |
Allow to set LANG and LC_ALL in envvars
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. |
Just ran into this issue when my omnibus plugin for vagrant upgraded the chef-client from 11.16 to 12.0.
Fixed by pinning to last known 11.x version that worked.
config.omnibus.chef_version = '11.16.4'
The text was updated successfully, but these errors were encountered: