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

2020-04-05: Permission denied on make build #242

Closed
zevarela opened this issue Apr 5, 2020 · 2 comments · Fixed by #243
Closed

2020-04-05: Permission denied on make build #242

zevarela opened this issue Apr 5, 2020 · 2 comments · Fixed by #243
Labels
bug Something isn't working

Comments

@zevarela
Copy link

zevarela commented Apr 5, 2020

Required Prerequisites for filing a bug

You must check both boxes

  • [ X] Have you searched opened / closed issues on this repo for a similar problem?
  • [ X] Have you searched the fastai forums for a similar problem?

Required information

Failure to provide this information or going through these steps will result in automatic closing of the issue

  1. Steps to reproduce the problem
git clone https://github.com/zevarela/blog
cd blog
make build 
  1. A link to the notebook or markdown file where the error is occuring

The error happens during the jekyll build command in the creation of the server docker image:

docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .
  1. If the error is happening in GitHub Actions, a link to the specific error along with how you are able to reproduce this error. You must provide this in addition to the link to the notebook or markdown file.

  2. This will help expedite troubleshooting: the A screenshot / dump of relevant logs or error messages you are receiving from your local development environment. the local development server as indicated in the [development guide (https://github.com/fastai/fastpages/blob/master/_fastpages_docs/DEVELOPMENT.md)?

Here is the output of the reproduction instructions:

(fastai2) jav@miramonte:/tmp$ git clone https://github.com/zevarela/blog
Cloning into 'blog'...
remote: Enumerating objects: 240, done.
remote: Counting objects: 100% (240/240), done.
remote: Compressing objects: 100% (179/179), done.
remote: Total 240 (delta 42), reused 116 (delta 31), pack-reused 0
Receiving objects: 100% (240/240), 2.43 MiB | 4.69 MiB/s, done.
Resolving deltas: 100% (42/42), done.
(fastai2) jav@miramonte:/tmp$ cd blog
(fastai2) jav@miramonte:/tmp/blog$ make build
docker-compose stop || true; docker-compose rm || true;
No stopped containers
docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .
Sending build context to Docker daemon  4.117MB
Step 1/4 : FROM jekyll/jekyll:4.0.0
 ---> 2754bfa01869
Step 2/4 : COPY . .
 ---> f73609e26bf9
Step 3/4 : RUN gem install bundler
 ---> Running in 522e52faa227
Successfully installed bundler-2.1.4
1 gem installed
Removing intermediate container 522e52faa227
 ---> a57eb318f6bc
Step 4/4 : RUN jekyll build
 ---> Running in 022b47d810f7
touch: /var/jekyll/con: Permission denied
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-musl]
`/home/jekyll` is not writable.
Bundler will use `/tmp/bundler20200405-15-1mdram915' as your home directory temporarily.
/usr/gem/gems/bundler-2.1.4/lib/bundler/spec_set.rb:86:in `block in materialize': Could not find public_suffix-4.0.3 in any of the sources (Bundler::GemNotFound)
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in `map!'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in `materialize'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/definition.rb:237:in `specs_for'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/definition.rb:226:in `requested_specs'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/runtime.rb:101:in `block in definition_method'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/runtime.rb:20:in `setup'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
	from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
	from /usr/gem/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
	from /usr/gem/bin/jekyll:23:in `load'
	from /usr/gem/bin/jekyll:23:in `<main>'
The command '/bin/sh -c jekyll build' returned a non-zero code: 1
make: *** [Makefile:17: build] Error 1
(fastai2) jav@miramonte:/tmp/blog$ 

and also all the packages that are installed in my environment:

(fastai2) jav@miramonte:~/1d/blog/blog$ pip freeze
adal==1.2.2
altair==4.1.0
asn1crypto==1.3.0
attrs==19.3.0
azure-cognitiveservices-search-imagesearch==2.0.0
azure-common==1.1.25
backcall==0.1.0
bcrypt==3.1.7
beautifulsoup4==4.8.2
bleach==3.1.3
blis==0.2.4
Bottleneck==1.3.2
cached-property==1.5.1
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
click==7.1.1
configparser==4.0.2
contextlib2==0.5.5
cryptography==2.8
cycler==0.10.0
cymem==2.0.2
Cython==0.29.6
dataclasses==0.7
decorator==4.4.2
defusedxml==0.6.0
docker==4.2.0
docker-compose==1.25.4
docker-pycreds==0.4.0
dockerpty==0.4.1
docopt==0.6.2
entrypoints==0.3
fastai==1.0.60
fastai2==0.0.12
fastcore==0.1.15
fastprogress==0.2.2
fastscript==0.1.4
feather-format==0.4.0
gitdb==4.0.2
GitPython==3.1.0
gql==0.2.0
graphql-core==1.1
graphviz==0.13.2
idna==2.9
importlib-metadata==1.5.0
ipykernel==5.1.4
ipython==7.13.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isodate==0.6.0
jedi==0.16.0
Jinja2==2.11.1
joblib==0.14.1
jsonschema==3.2.0
jupyter-client==6.1.2
jupyter-core==4.6.3
kiwisolver==1.1.0
kornia==0.2.0
MarkupSafe==1.1.1
matplotlib==3.1.3
mistune==0.8.4
mkl-fft==1.0.15
mkl-random==1.1.0
mkl-service==2.3.0
msrest==0.6.11
msrestazure==0.6.2
murmurhash==1.0.2
nbconvert==5.6.1
nbdev==0.2.14
nbformat==5.0.4
notebook==6.0.3
numexpr==2.7.1
numpy==1.16.2
nvidia-ml-py3==7.352.0
oauthlib==3.1.0
olefile==0.46
packaging==20.3
pandas==1.0.3
pandocfilters==1.4.2
paramiko==2.7.1
parso==0.6.2
pathtools==0.1.2
pexpect==4.8.0
pickleshare==0.7.5
Pillow==6.2.1
plac==0.9.6
preshed==2.0.1
prometheus-client==0.7.1
promise==2.3
prompt-toolkit==3.0.4
psutil==5.7.0
ptyprocess==0.6.0
pyarrow==0.16.0
pycparser==2.20
Pygments==2.6.1
PyJWT==1.7.1
PyNaCl==1.3.0
pyOpenSSL==19.1.0
pyparsing==2.4.6
pyrsistent==0.16.0
PySocks==1.7.1
python-dateutil==2.8.1
pytz==2019.3
PyYAML==5.3.1
pyzmq==18.1.1
requests==2.23.0
requests-oauthlib==1.3.0
scikit-learn==0.22.2.post1
scipy==1.4.1
seaborn==0.10.0
Send2Trash==1.5.0
sentencepiece==0.1.85
sentry-sdk==0.14.2
shortuuid==1.0.1
six==1.12.0
smmap==3.0.1
soupsieve==2.0
spacy==2.1.8
srsly==0.1.0
subprocess32==3.5.4
terminado==0.8.3
testpath==0.4.4
texttable==1.6.2
thinc==7.0.8
toolz==0.10.0
torch==1.4.0
torchvision==0.2.1
tornado==6.0.4
tqdm==4.44.1
traitlets==4.3.3
urllib3==1.25.8
vega-datasets==0.8.0
wandb==0.8.29
wasabi==0.2.2
watchdog==0.10.2
wcwidth==0.1.9
webencodings==0.5.1
websocket-client==0.57.0
widgetsnbextension==3.5.1
zipp==2.2.0

@zevarela zevarela added the bug Something isn't working label Apr 5, 2020
@zevarela zevarela changed the title [DATE]: [FEATURE NAME] 2020-04-05: Permission denied on make build Apr 5, 2020
@zevarela
Copy link
Author

zevarela commented Apr 5, 2020

Found a work around from the info on jekyll issue 7591.
I needed to create _site and .jekyll-cache folders in the Makefile location:

mkdir .jekyll-cache
mkdir _site

Then edit _action_files/fastpages-jekyll.Dockerfile to give the missing write permissions. I did that by adding the chmod line just before jekyll build below:

# 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 chmod a+w /home/jekyll /var/jekyll /srv/jekyll
RUN jekyll build

Hope this helps you.

Here's the full log of repo and solution:

(fastai2) jav@miramonte:/tmp$ git clone https://github.com/zevarela/blog
Cloning into 'blog'...
remote: Enumerating objects: 240, done.
remote: Counting objects: 100% (240/240), done.
remote: Compressing objects: 100% (179/179), done.
remote: Total 240 (delta 42), reused 116 (delta 31), pack-reused 0
Receiving objects: 100% (240/240), 2.43 MiB | 4.83 MiB/s, done.
Resolving deltas: 100% (42/42), done.
(fastai2) jav@miramonte:/tmp$ cd blog
(fastai2) jav@miramonte:/tmp/blog$ make build 
docker-compose stop || true; docker-compose rm || true;
Stopping blog_jekyll_1  ... done
Stopping blog_watcher_1 ... done
Going to remove blog_jekyll_1, blog_converter_1, blog_watcher_1, blog_fastpages_1
Are you sure? [yN] y
Removing blog_jekyll_1    ... done
Removing blog_converter_1 ... done
Removing blog_watcher_1   ... done
Removing blog_fastpages_1 ... done
docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .
Sending build context to Docker daemon  4.117MB
Step 1/4 : FROM jekyll/jekyll:4.0.0
 ---> 2754bfa01869
Step 2/4 : COPY . .
 ---> 62e9b5f91856
Step 3/4 : RUN gem install bundler
 ---> Running in 5427c2ac0b22
Successfully installed bundler-2.1.4
1 gem installed
Removing intermediate container 5427c2ac0b22
 ---> ba753d590e99
Step 4/4 : RUN jekyll build
 ---> Running in 3cf1c61047f7
touch: /var/jekyll/con: Permission denied
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-musl]
`/home/jekyll` is not writable.
Bundler will use `/tmp/bundler20200405-15-1b6yp4715' as your home directory temporarily.
/usr/gem/gems/bundler-2.1.4/lib/bundler/spec_set.rb:86:in `block in materialize': Could not find public_suffix-4.0.3 in any of the sources (Bundler::GemNotFound)
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in `map!'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/spec_set.rb:80:in `materialize'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/definition.rb:170:in `specs'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/definition.rb:237:in `specs_for'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/definition.rb:226:in `requested_specs'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/runtime.rb:101:in `block in definition_method'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler/runtime.rb:20:in `setup'
	from /usr/gem/gems/bundler-2.1.4/lib/bundler.rb:149:in `setup'
	from /usr/gem/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
	from /usr/gem/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
	from /usr/gem/bin/jekyll:23:in `load'
	from /usr/gem/bin/jekyll:23:in `<main>'
The command '/bin/sh -c jekyll build' returned a non-zero code: 1
make: *** [Makefile:17: build] Error 1

##################################################################

(fastai2) jav@miramonte:/tmp/blog$ mkdir .jekyll-cache
(fastai2) jav@miramonte:/tmp/blog$ mkdir _site
(fastai2) jav@miramonte:/tmp/blog$ vi _action_files/fastpages-jekyll.Dockerfile 
(fastai2) jav@miramonte:/tmp/blog$ make build 
docker-compose stop || true; docker-compose rm || true;
No stopped containers
docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile .
Sending build context to Docker daemon  4.118MB
Step 1/5 : FROM jekyll/jekyll:4.0.0
 ---> 2754bfa01869
Step 2/5 : COPY . .
 ---> e67ad7bc2698
Step 3/5 : RUN gem install bundler
 ---> Running in 8b03cdf8f7e9
Successfully installed bundler-2.1.4
1 gem installed
Removing intermediate container 8b03cdf8f7e9
 ---> b14fc4ac1886
Step 4/5 : RUN chmod a+w /home/jekyll /var/jekyll /srv/jekyll
 ---> Running in 1726d5f4528e
Removing intermediate container 1726d5f4528e
 ---> 2b8535aaf755
Step 5/5 : RUN jekyll build
 ---> Running in 3ada506d5e57
Fetching gem metadata from https://rubygems.org/........
Fetching public_suffix 4.0.3
Installing public_suffix 4.0.3
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using bundler 2.1.4
Fetching colorator 1.1.0
Installing colorator 1.1.0
Fetching concurrent-ruby 1.1.6
Installing concurrent-ruby 1.1.6
Fetching eventmachine 1.2.7
Installing eventmachine 1.2.7 with native extensions
Fetching http_parser.rb 0.6.0
Installing http_parser.rb 0.6.0 with native extensions
Fetching em-websocket 0.5.1
Installing em-websocket 0.5.1
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching multipart-post 2.1.1
Installing multipart-post 2.1.1
Fetching faraday 0.17.3
Installing faraday 0.17.3
Fetching ffi 1.12.2
Installing ffi 1.12.2 with native extensions
Fetching forwardable-extended 2.6.0
Installing forwardable-extended 2.6.0
Fetching i18n 1.8.2
Installing i18n 1.8.2
Fetching sassc 2.2.1
Installing sassc 2.2.1 with native extensions
Fetching jekyll-sass-converter 2.1.0
Installing jekyll-sass-converter 2.1.0
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching listen 3.2.1
Installing listen 3.2.1
Fetching jekyll-watch 2.2.1
Installing jekyll-watch 2.2.1
Fetching kramdown 2.1.0
Installing kramdown 2.1.0
Fetching kramdown-parser-gfm 1.1.0
Installing kramdown-parser-gfm 1.1.0
Fetching liquid 4.0.3
Installing liquid 4.0.3
Fetching mercenary 0.3.6
Installing mercenary 0.3.6
Fetching pathutil 0.16.2
Installing pathutil 0.16.2
Fetching rouge 3.16.0
Installing rouge 3.16.0
Fetching safe_yaml 1.0.5
Installing safe_yaml 1.0.5
Fetching unicode-display_width 1.6.1
Installing unicode-display_width 1.6.1
Fetching terminal-table 1.8.0
Installing terminal-table 1.8.0
Fetching jekyll 4.0.0
Installing jekyll 4.0.0
Fetching jekyll-feed 0.13.0
Installing jekyll-feed 0.13.0
Fetching sawyer 0.8.2
Installing sawyer 0.8.2
Fetching octokit 4.16.0
Installing octokit 4.16.0
Fetching jekyll-gist 1.5.0
Installing jekyll-gist 1.5.0
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching nokogiri 1.10.9
Installing nokogiri 1.10.9 with native extensions
Fetching octicons 9.5.0
Installing octicons 9.5.0
Fetching jekyll-octicons 9.5.0
Installing jekyll-octicons 9.5.0
Fetching jekyll-paginate 1.1.0
Installing jekyll-paginate 1.1.0
Fetching jekyll-relative-links 0.6.1
Installing jekyll-relative-links 0.6.1
Fetching rubyzip 2.2.0
Installing rubyzip 2.2.0
Fetching jekyll-remote-theme 0.4.2
Installing jekyll-remote-theme 0.4.2
Fetching jekyll-seo-tag 2.6.1
Installing jekyll-seo-tag 2.6.1
Fetching jekyll-toc 0.13.1
Installing jekyll-toc 0.13.1
Fetching jekyll-twitter-plugin 2.1.0
Installing jekyll-twitter-plugin 2.1.0
Fetching katex 0.6.0
Installing katex 0.6.0
Fetching kramdown-math-katex 1.0.1
Installing kramdown-math-katex 1.0.1
Fetching minima 2.5.1
Installing minima 2.5.1
Bundle complete! 16 Gemfile dependencies, 48 gems now installed.
Bundled gems are installed into `/usr/local/bundle`
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-musl]
Configuration file: /srv/jekyll/_config.yml
      Remote Theme: Using theme jekyll/minima
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
      Remote Theme: Using theme jekyll/minima
       Jekyll Feed: Generating feed for posts
                    done in 0.323 seconds.
 Auto-regeneration: disabled. Use --watch to enable.
Removing intermediate container 3ada506d5e57
 ---> 52664890ba13
Successfully built 52664890ba13
Successfully tagged hamelsmu/fastpages-jekyll:latest
docker-compose build --force-rm --no-cache
jekyll uses an image, skipping
Building fastpages
Step 1/6 : FROM hamelsmu/fastpages-nbdev
 ---> ebc4ab43eb57
Step 2/6 : WORKDIR /fastpages
 ---> Running in fdaf9dc10907
Removing intermediate container fdaf9dc10907
 ---> b37ac5b0f6d8
Step 3/6 : COPY . .
 ---> 53fbfd0a50f4
Step 4/6 : RUN chmod u+x action_entrypoint.sh
 ---> Running in f3e82c8ce77c
Removing intermediate container f3e82c8ce77c
 ---> 343ed9bb4448
Step 5/6 : RUN chmod u+x word2post.sh
 ---> Running in d5c8c7b8f1d9
Removing intermediate container d5c8c7b8f1d9
 ---> 5da66a3a7d9a
Step 6/6 : CMD [ "/fastpages/action_entrypoint.sh" ]
 ---> Running in 0a06936c5582
Removing intermediate container 0a06936c5582
 ---> 23be8f5bec68
Successfully built 23be8f5bec68
Successfully tagged fastpages-dev:latest
Building converter
Step 1/6 : FROM hamelsmu/fastpages-nbdev
 ---> ebc4ab43eb57
Step 2/6 : WORKDIR /fastpages
 ---> Running in 3edd5608c07a
Removing intermediate container 3edd5608c07a
 ---> 69e774bc21d6
Step 3/6 : COPY . .
 ---> 4a4e6ce23667
Step 4/6 : RUN chmod u+x action_entrypoint.sh
 ---> Running in 2a3bf122c0a8
Removing intermediate container 2a3bf122c0a8
 ---> f4c63b09f5c9
Step 5/6 : RUN chmod u+x word2post.sh
 ---> Running in 98715e1577b7
Removing intermediate container 98715e1577b7
 ---> 879b88e8af09
Step 6/6 : CMD [ "/fastpages/action_entrypoint.sh" ]
 ---> Running in ccd0284c56d1
Removing intermediate container ccd0284c56d1
 ---> fa4139623113
Successfully built fa4139623113
Successfully tagged fastpages-dev:latest
Building watcher
Step 1/6 : FROM hamelsmu/fastpages-nbdev
 ---> ebc4ab43eb57
Step 2/6 : WORKDIR /fastpages
 ---> Running in e7019fbfbfc6
Removing intermediate container e7019fbfbfc6
 ---> 70f640b6e866
Step 3/6 : COPY . .
 ---> 7283d14355cb
Step 4/6 : RUN chmod u+x action_entrypoint.sh
 ---> Running in 05e0ef6cc373
Removing intermediate container 05e0ef6cc373
 ---> 9d415d263909
Step 5/6 : RUN chmod u+x word2post.sh
 ---> Running in 8597403388ef
Removing intermediate container 8597403388ef
 ---> 424eea632e94
Step 6/6 : CMD [ "/fastpages/action_entrypoint.sh" ]
 ---> Running in 511be01eba12
Removing intermediate container 511be01eba12
 ---> 84c63ea21ea1
Successfully built 84c63ea21ea1
Successfully tagged fastpages-dev:latest

@hamelsmu
Copy link
Member

hamelsmu commented Apr 6, 2020

Thanks I fixed this

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

Successfully merging a pull request may close this issue.

2 participants