Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

2020-04-22: permission error during Jekyll build on github #267

Closed
wawachief opened this issue Apr 22, 2020 · 23 comments
Closed

2020-04-22: permission error during Jekyll build on github #267

wawachief opened this issue Apr 22, 2020 · 23 comments
Labels
bug Something isn't working

Comments

@wawachief
Copy link

wawachief commented Apr 22, 2020

Hi

I am experiencing a problem since today when building the site on github. Yesterday, it worked fine, today I added a new notebook. It builds correctly locally but it fails on github.

https://github.com/wawachief/fastpages/runs/609307981?check_suite_focus=true

The Jekyll build's logs are :

Run docker://jekyll/jekyll
  with:
    args: jekyll build -V
/usr/bin/docker run --name jekylljekyll_d35ae3 --label c27d31 --workdir /github/workspace --rm -e INPUT_ARGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/fastpages/fastpages":"/github/workspace" jekyll/jekyll jekyll build -V
Fetching gem metadata from https://rubygems.org/.......
Using concurrent-ruby 1.1.6
Using i18n 0.9.5
Bundler::PermissionError: There was an error while trying to write to
`/usr/gem/cache`. It is likely that you need to grant write permissions for that
path.
An error occurred while installing minitest (5.14.0), and Bundler cannot
continue.
Make sure that `gem install minitest -v '5.14.0' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  github-pages was resolved to 204, which depends on
    jekyll-mentions was resolved to 1.5.1, which depends on
      html-pipeline was resolved to 2.12.3, which depends on
        activesupport was resolved to 6.0.2.2, which depends on
          minitest
@wawachief wawachief added the bug Something isn't working label Apr 22, 2020
@hamelsmu
Copy link
Member

Please upgrade fastpages

@ScottBrenner
Copy link
Contributor

Hi, have this issue as well and my fastpages is up-to-date - ScottBrenner/asot-jupyter#2 (comment) - any tips?

@hamelsmu
Copy link
Member

hamelsmu commented Apr 27, 2020 via email

@ScottBrenner
Copy link
Contributor

Appreciate the quick reply - sorry, neglected to mention I'm seeing this error locally, when running make build (during docker build --no-cache -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .). I'm on Windows 10 Home, running Docker with Docker Toolbox, in Windows Subsystem for Linux 😅

@hamelsmu
Copy link
Member

hamelsmu commented Apr 27, 2020 via email

@ScottBrenner
Copy link
Contributor

$ docker build --no-cache -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .
Sending build context to Docker daemon  4.085MB
Step 1/5 : FROM jekyll/jekyll:4.0.0
 ---> 422d316c5393
Step 2/5 : COPY . .
 ---> 32039b06caec
Step 3/5 : RUN chmod -R 777 .
 ---> Running in 8bba8200de71
Removing intermediate container 8bba8200de71
 ---> c5aa97da4406
Step 4/5 : RUN gem install bundler
 ---> Running in dae87508ebb4
Successfully installed bundler-2.1.4
1 gem installed
Removing intermediate container dae87508ebb4
 ---> 571b19c730dd
Step 5/5 : RUN jekyll build
 ---> Running in e769c79c14ef
Fetching gem metadata from https://rubygems.org/.......
Using concurrent-ruby 1.1.6
Using i18n 1.8.2
Fetching minitest 5.14.0
Errno::EACCES: Permission denied @ rb_file_s_rename -
(/home/jekyll/.gem/ruby/2.7.0/cache/minitest-5.14.0.gem,
/usr/gem/cache/minitest-5.14.0.gem)
An error occurred while installing minitest (5.14.0), and Bundler cannot
continue.
Make sure that `gem install minitest -v '5.14.0' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  jemoji was resolved to 0.12.0, which depends on
    html-pipeline was resolved to 2.12.3, which depends on
      activesupport was resolved to 6.0.2.2, which depends on
        minitest
The command '/bin/sh -c jekyll build' returned a non-zero code: 5

@hamelsmu
Copy link
Member

hamelsmu commented Apr 27, 2020 via email

@ScottBrenner
Copy link
Contributor

have you tried grant permissions to this file?

Doesn't that happen here?

@hamelsmu
Copy link
Member

hamelsmu commented Apr 27, 2020 via email

@hamelsmu
Copy link
Member

hamelsmu commented Apr 27, 2020 via email

@hamelsmu
Copy link
Member

hamelsmu commented Apr 27, 2020 via email

@juan-carlos-calvo
Copy link

I get the same error on a mac

@ScottBrenner
Copy link
Contributor

ScottBrenner commented Apr 28, 2020

Got it! It's an issue with the upstream jekyll image tagged at 4.0.0 ➡️ envygeeks/jekyll-docker#268 (comment) has the workaround.

So, my _action_files/fastpages-jekyll.Dockerfile looks like this currently:

# Defines https://hub.docker.com/repository/docker/hamelsmu/fastpages-jekyll
FROM jekyll/jekyll:4.0.0

COPY . .

# Pre-load all gems into the environment
RUN gem install bundler
RUN chown jekyll:jekyll -R /usr/gem
RUN jekyll build

This step


is not necessary with this change.

@juan-carlos-calvo
Copy link

juan-carlos-calvo commented Apr 28, 2020

Then I got another error. I would just change the base image to 3.8.6 at least until latest is fixed (this worked for me).

@vsoch
Copy link

vsoch commented Apr 28, 2020

I reproduced this error on Ubuntu 18.04, running jekyll/jekyll:latest (currently 4.0) with docker-compose.yml to deploy a jekyll site. Changing to 3.8 fixed the issue.

@hamelsmu
Copy link
Member

I'm not sure if changing to 4.0 is safe as there were some pretty drastic changes. I am monitoring this issue closely ... will try to fix this soon

@hamelsmu hamelsmu reopened this Apr 28, 2020
@hamelsmu
Copy link
Member

I am having problems reproducing this error, I'm really confused on how to fix this

If anyone is available for pair programming would love to fix this please let me know if there are any volunteers

@juan-carlos-calvo
Copy link

juan-carlos-calvo commented Apr 28, 2020

I am having problems reproducing this error, I'm really confused on how to fix this

If anyone is available for pair programming would love to fix this please let me know if there are any volunteers

happy to. However, just downgrading to 3.8.6 did the trick.

@hamelsmu
Copy link
Member

I am not comfortable with YOLO reverting back to 3.8.6 I am not confident that it won't break something else.

@hamelsmu
Copy link
Member

@juan-carlos-calvo Just to confirm, if you clone a fresh copy of this repo, and then call

make build

do you get this same error?

@juan-carlos-calvo
Copy link

juan-carlos-calvo commented Apr 28, 2020

yes

Step 5/5 : RUN jekyll build
 ---> Running in 1271cd7ad01d
Fetching gem metadata from https://rubygems.org/.......
Using concurrent-ruby 1.1.6
Using i18n 1.8.2
Fetching minitest 5.14.0
Errno::EACCES: Permission denied @ rb_file_s_rename -
(/home/jekyll/.gem/ruby/2.7.0/cache/minitest-5.14.0.gem,
/usr/gem/cache/minitest-5.14.0.gem)
An error occurred while installing minitest (5.14.0), and Bundler cannot
continue.
Make sure that `gem install minitest -v '5.14.0' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  jemoji was resolved to 0.12.0, which depends on
    html-pipeline was resolved to 2.12.3, which depends on
      activesupport was resolved to 6.0.2.2, which depends on
        minitest
The command '/bin/sh -c jekyll build' returned a non-zero code: 5
make: *** [build] Error 5

@wawachief
Copy link
Author

I had the same problems when I upgraded to 4.0. After quite a bit of struggle I got it running.
If I remember well, I changed _action_files/fastpages-jekyll.Dockerfile. Here is the content I use :

_action_files/fastpages-jekyll.Dockerfile
# Defines https://hub.docker.com/repository/docker/hamelsmu/fastpages-jekyll
FROM jekyll/jekyll:4.0.0
ENV BUNDLE_PATH=$GEM_HOME

COPY . .

# Pre-load all gems into the environment
RUN chmod -R 777 .
RUN gem install bundler
RUN chmod -R 777 /home/jekyll /var/jekyll /srv/jekyll /usr/gem/
RUN jekyll build

To get it work I deleted all my docker images and containers relative to jekyll and run a make build.
Now Everything works fine with the latest update, the action file on github and the local server.

@hamelsmu
Copy link
Member

Many thanks to @juan-carlos-calvo for pair programming with me

Given the many issues with the Docker container, we decided to just use a frozen container and use hamelsmu/fastpages-jekyll instead of jekyll/jekyll for now until things are fixed. You can Upgrade to get these changes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants