-
-
Notifications
You must be signed in to change notification settings - Fork 901
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
Nokogiri fails to build with latest ruby:2.2.3 docker image #1370
Comments
@adrienkohlbecker It looks differently for me (on Ubuntu-15.04): lars@netzbuch:~/comcard/nokogiri$ docker run -it ruby:2.2.3 env MAKE="nice make -j2" gem install nokogiri
Unable to find image 'ruby:2.2.3' locally
2.2.3: Pulling from ruby
575489a51992: Pull complete
6845b83c79fb: Pull complete
f9fffdafe16d: Pull complete
d63502d4fbd8: Pull complete
a3d4ddaffb90: Pull complete
df231b622270: Pull complete
3802d6035798: Pull complete
c314b7cf3e15: Pull complete
e9311cad9737: Pull complete
8825dcf66d36: Pull complete
34e5c4779386: Pull complete
3b178d645c21: Pull complete
177675c40a08: Pull complete
e553b9534450: Pull complete
2defd8698c56: Pull complete
fb515cf11884: Pull complete
f08537117c4d: Pull complete
ruby:2.2.3: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:e68d8d7bb9e2024526656aaf13cabab66b10e52e5f8ca1b1731a161e64a83739
Status: Downloaded newer image for ruby:2.2.3
Fetching: mini_portile-0.6.2.gem (100%)
Successfully installed mini_portile-0.6.2
Fetching: nokogiri-1.6.6.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed nokogiri-1.6.6.2
2 gems installed
lars@netzbuch:~/comcard/nokogiri$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.3.3
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.3.3
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64
lars@netzbuch:~/comcard/nokogiri$ |
I have same problem, it works when I downgrade rubygems to 2.4.8 |
We're experiencing the same issue for some of our users, though I'm not able to reproduce it on my local machine. This is from one of our build machines:
This is from my local machine:
I can also confirm that downgrading to RubyGems 2.4.8 does not have the issue. My guess it has something to do with the Docker version or the storage driver. |
Can you try |
@allenwei that code snippet won't work as the latter part will be run on the host. I did try the following:
|
Same issue here
Looks like it is related to the overlay driver. |
Also: downgrading rubygems solves the issue for me |
We have the same issue with docker 1.8.1 on this box
|
Do you think this might actually be a bug specific to the new version of |
this seems to be fixed with the latest version
I'll go ahead and close this issue. |
@jvshahid I'm still getting the same issue with 1.6.6.4 |
@jvshahid still the same issue here, as I mentioned before, it is probably more a docker and/or overlay fs issue then a nokogiri one |
I just tested it with docker 1.9.1, same issue |
I'm not sure what's going on. I tested installing nokogiri 1.6.6.2 and 1.6.6.4 using docker 1.9.1 and can't reproduce the issue. Can someone provide a way to reproduce this issue ? May be the output from |
Here is some information, I'm not sure on what I can do to help, let me know
Also, this is a Vagrant VM running under Parallels Desktop, but I was able to reproduce the issue on AWS with the same config (both machines provisioned the same way). |
I can reproduce this, after switching from aufs to overlayfs. Same error as above. Interestingly other gems with extensions work (I tried |
I'm sorry, I can't reproduce this:
If the current claim is that the filesystem being used affects Nokogiri installation, then I'd suggest it's not a Nokogiri problem to solve. If there are objections to closing this issue, then please let me know. I'll look into it if someone can convince me with a compelling argument that this is a Nokogiri issue. |
I'm getting this same issue on our CI server with Codeship. Ruby 2.3.0 and nokogiri 1.6.7.1. Anyone else running into this problem can add the line |
I had the same issue on Codeship CI and confirm that the above The same version of Nokogiri (1.6.7.1) worked for me before in the same Codeship environment (which is standard Ubuntu 14.04 "Every build gets a new completely clean virtual machine"). The only thing that I changed was my version of Ruby to 2.3 so surely it is a Nokogiri issue, caused by some change in Ruby? |
As I mentioned in my Nov 29 comment, I can't reproduce this. Unless someone can help me reproduce it, I'm going to close it. Speculation that this is "surely a Nokogiri issue" is meaningless without a reproducible test case, I'm sorry. Help me help you, everyone. |
@flavorjones You need to switch docker to overlayfs. The issue doesn't exist with aufs. On Ubuntu-15.04 it should then be reproducible with: docker pull ruby:2.2.3 && docker run -t -i ruby:2.2.3 gem install nokogiri -v '1.6.6.2' Both Overlayfs and the docker support for it, are still quite new, so that there are a lot of other issues next to nokogiri, that are surely addressed quickly. That's why I didn't investigate it in depth, so far. |
As I've mentioned over in docker-library/ruby#55 (comment), I think this overlayfs failure is really introduced by |
@tianon I narrowed it down to the kernel calls that fail on overlayfs and opened a new issue on docker: moby/moby#19082 ... and opened a proposal to how we can avoid this issue in nokogiri: #1405 |
Deletion of these empty directories is flawed on docker with overlayfs, so we better avoid it. The build artifacts are still removed after gem install. This fixes nokogiri issue sparklemotion#1370 . For further details to the root issue see: moby/moby#19082
@larskanis thank you very much! |
Closing this, since Lars's change is in master and will be in Nokogiri v1.6.8. If anyone desperately needs an RC let me know and I can cut 1.6.8.rc2. |
I'd like to ask for a rc release to be cut as this bug probably keeps our Rails project to be properly built on our CI server. Thank you. |
@balinterdi Curious why you used the work "probably" in that sentence. Are you not sure what's going on? I wouldn't recommend using an RC in production, so please think hard about whether your need is desperate. Keep in mind that this bug is not a Nokogiri bug, we're working around an overlayfs bug with this commit. You could also not use overlayfs in your Docker container to avoid the bug. Regardless, I'll cut an RC today and everyone can decide for themselves whether to use it. |
@flavorjones I used "probably" because it fails on the CI server where they use overlayfs but it does not fail for me locally (more precisely, it fails with something else). Good point about not using an RC in production, and thank you for releasing a new version, I can still make the call after that. |
v1.6.8.rc2 has been unleashed upon the universe. have fun. |
I can confirm what @connorshea said, nokogiri >1.6.7 will throw the same error:
Sounds like a conflict between the system libs and the packaged ones. @flavorjones if you want to reproduce this, use this Dockerfile:
Extra guidance for people not familiar with Docker. Build the image: docker build -t rvmtest . Install nokogiri using either Ruby version: docker run --rm -it rvmtest bash -il -c "rvm use 2.2.4 && gem install -V nokogiri"
#works docker run --rm -it rvmtest bash -il -c "rvm use 2.3.0 && gem install -V nokogiri"
#fails |
@antoineco please read previous comments. This is fixed in the 1.6.8 release candidate. |
Sorry 🙏 I read it but wasn't sure if this actually covers Ruby 2.3, since I could never reproduce on 2.2 Thanks for the quick answer and confirmation! |
I also ran into this problem and using the 1.6.8 release candidate fixed my issue. |
I just hit this and can confirm 1.6.8.rc3 fixes, hopefully it is released soon ❤️ |
Agreed, a final release of 1.6.8 would be very nice for me, too, since I just bumped up against this on a container build. |
Hello,
The following command:
docker pull ruby:2.2.3 && docker run -t -i ruby:2.2.3 gem install nokogiri -v '1.6.6.2'
results in an error.That was not the case a few days ago, so I suspect this commit fro two days ago on the base image may be at fault, but I've not been able to confirm it.
Here is the build log:
The text was updated successfully, but these errors were encountered: