jekyll-docker icon indicating copy to clipboard operation
jekyll-docker copied to clipboard

Not supported - copy_file_range (Errno::ENOTSUP) (possibly EL Kernel & NFS related)

Open Miskerest opened this issue 3 years ago • 7 comments

Issue

I've been encountering this issue in recent builds:

$ docker-compose up
Starting blog_jekyll_1 ... done
Attaching to blog_jekyll_1
jekyll_1  | ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux-musl]
jekyll_1  | Configuration file: _config.yml
jekyll_1  | Configuration file: _config.dev.yml
jekyll_1  |             Source: /srv/jekyll
jekyll_1  |        Destination: /srv/jekyll/_site
jekyll_1  |  Incremental build: disabled. Enable with --incremental
jekyll_1  |       Generating...
jekyll_1  | /usr/local/lib/ruby/2.6.0/fileutils.rb:1387:in `copy_stream': Not supported - copy_file_range (Errno::ENOTSUP)
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:1387:in `block (2 levels) in copy_file'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:1386:in `open'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:1386:in `block in copy_file'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:1385:in `open'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:1385:in `copy_file'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:1353:in `copy'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:478:in `block in copy_entry'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:1484:in `wrap_traverse'
jekyll_1  |     from /usr/local/lib/ruby/2.6.0/fileutils.rb:475:in `copy_entry'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/static_file.rb:159:in `copy_file'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/static_file.rb:105:in `write'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:209:in `block in write'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:332:in `block (2 levels) in each_site_file'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:331:in `each'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:331:in `block in each_site_file'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:330:in `each'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:330:in `each_site_file'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:208:in `write'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/site.rb:73:in `process'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/command.rb:28:in `process_site'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/commands/build.rb:65:in `build'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/commands/build.rb:36:in `process'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/commands/serve.rb:93:in `block in start'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/commands/serve.rb:93:in `each'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/commands/serve.rb:93:in `start'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
jekyll_1  |     from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
jekyll_1  |     from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
jekyll_1  |     from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
jekyll_1  |     from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
jekyll_1  |     from /usr/gem/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
jekyll_1  |     from /usr/gem/gems/jekyll-3.8.6/exe/jekyll:15:in `<top (required)>'
jekyll_1  |     from /usr/gem/bin/jekyll:23:in `load'
jekyll_1  |     from /usr/gem/bin/jekyll:23:in `<main>'
blog_jekyll_1 exited with code 1

Steps to reproduce:

Environment: Up to date installation of CentOS 7

$ cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
$ uname -a
Linux  [removed] 3.10.0-1127.18.2.el7.x86_64 #1 SMP Sun Jul 26 15:27:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  1. Clone the repo
  2. Run $ docker run --rm --volume="$PWD:/srv/jekyll" -it jekyll/jekyll:3.8 jekyll build output:
Ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux-musl]
Configuration file: none
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
jekyll 3.8.6 | Error:  Not supported - copy_file_range

It seems like this is an issue with Ruby not playing nice with NFS per this RHEL Bugzilla issue. Perhaps updating to Ruby 3.7 would help?

Miskerest avatar Aug 13 '20 03:08 Miskerest

It would seem this issue applies to 2.5, 2.6 & 2.6 https://bugs.ruby-lang.org/issues/16965 on that the current image does indeed have Ruby 2.7, we don't generally update past images with newer Rubies, does this happen on the 4.x image (if you are able to use it)

envygeeks avatar Aug 13 '20 03:08 envygeeks

Looks like it does:

$ docker-compose up
Pulling jekyll (jekyll/jekyll:4.0)...
Trying to pull repository docker.io/jekyll/jekyll ...
4.0: Pulling from docker.io/jekyll/jekyll
Digest: sha256:619acd2826c54b67238d9bb7b0473981da4e0f758f24b7d3fe6c614f072e07f3
Status: Downloaded newer image for docker.io/jekyll/jekyll:4.0
Recreating blog_jekyll_1 ... done
Attaching to blog_jekyll_1
jekyll_1  | ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-musl]
jekyll_1  | Configuration file: /srv/jekyll/_config.yml
jekyll_1  | Configuration file: /srv/jekyll/_config.dev.yml
jekyll_1  |             Source: /srv/jekyll
jekyll_1  |        Destination: /srv/jekyll/_site
jekyll_1  |  Incremental build: disabled. Enable with --incremental
jekyll_1  |       Generating...
jekyll_1  | /usr/local/lib/ruby/2.7.0/fileutils.rb:1415:in `copy_stream': Not supported - copy_file_range (Errno::ENOTSUP)
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:1415:in `block (2 levels) in copy_file'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:1414:in `open'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:1414:in `block in copy_file'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:1413:in `open'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:1413:in `copy_file'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:1378:in `copy'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:497:in `block in copy_entry'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:1512:in `wrap_traverse'
jekyll_1  |     from /usr/local/lib/ruby/2.7.0/fileutils.rb:494:in `copy_entry'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/static_file.rb:200:in `copy_file'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/static_file.rb:110:in `write'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:225:in `block in write'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:350:in `block (2 levels) in each_site_file'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:349:in `each'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:349:in `block in each_site_file'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:348:in `each'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:348:in `each_site_file'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:224:in `write'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/site.rb:82:in `process'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/command.rb:28:in `process_site'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/commands/build.rb:65:in `build'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/commands/build.rb:36:in `process'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/command.rb:91:in `each'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
jekyll_1  |     from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
jekyll_1  |     from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
jekyll_1  |     from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
jekyll_1  |     from /usr/gem/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
jekyll_1  |     from /usr/gem/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
jekyll_1  |     from /usr/gem/gems/jekyll-4.1.0/exe/jekyll:15:in `<top (required)>'
jekyll_1  |     from /usr/gem/bin/jekyll:23:in `load'
jekyll_1  |     from /usr/gem/bin/jekyll:23:in `<main>'
blog_jekyll_1 exited with code 1

Miskerest avatar Aug 13 '20 13:08 Miskerest

Here's my docker-compose.yml, in case it helps:

version: "3"

services:
  jekyll:
    image: jekyll/jekyll:latest
    ports:
      - "4000:4000"
    command: jekyll serve --watch --host "0.0.0.0" --trace --config _config.yml,_config.dev.yml
    volumes:
      - .:/srv/jekyll

Miskerest avatar Aug 13 '20 13:08 Miskerest

There isn't much I can do about that error unfortunately. It's mostly up to RedHat to either fix it in the Kernel, or Ruby to fix it.

envygeeks avatar Aug 13 '20 13:08 envygeeks

I figured- at least it's here now for documentation!

I found that it seems to work when I don't specify --config _config.yml. Is that config file not being used anymore? I don't see it in the repo.

Miskerest avatar Aug 13 '20 13:08 Miskerest

In theory jekyll should still be loading your _config.yml if it's in the default (root) location of your source because that's the file it looks for by default if it can find it. Also I noticed that Gitlab has a patch for that problem so I might look into adding that patch to our stuff and making a note of it so that this problem is resolved better.

envygeeks avatar Aug 13 '20 13:08 envygeeks

Gotcha. I'll keep playing with it and update if I find anything helpful. Happy to help test anything.

Miskerest avatar Aug 13 '20 13:08 Miskerest