Skip to content
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

Pagination for collection and dir_s_mkdir error #150

Open
baszczewski opened this issue Jan 17, 2019 · 10 comments
Open

Pagination for collection and dir_s_mkdir error #150

baszczewski opened this issue Jan 17, 2019 · 10 comments

Comments

@baszczewski
Copy link

I am using this plugin in newest version: 2.1.0. Unfortunately after jekyll serve I've got error:

jekyll 3.8.5 | Error:  File exists @ dir_s_mkdir - /media/data/projects/test/_site/freebies/index.html

Important part of my _config.yml:

plugins:
  - jekyll-paginate-v2

collections:
  freebies:
    output: true
    permalink: /freebies/:path/

pagination:
  enabled: true
  permalink: '/page/:num/'
  sort_reverse: true
  per_page: 3
  trail: 
    before: 2
    after: 2

autopages:
  enabled: true
  collections:
    enabled: true
    title: 'Posts in collection :coll' # :coll is replaced by the collection name
    permalink: '/:coll'

defaults:
  - scope:
      path: ""
      type: "freebies"
    values:
      layout: "freebies-post"

My freebies posts are located in "_freebies" directory (I've got 4 files here - only markdowns). I don't have in my project file described in error log like: "freebies/index.html".

What is weird here is that structure work's until option pagination->per_page is bigger than count of files inside my collection.

Do you have any idea what I can do here?

@ashmaroli
Copy link
Contributor

@baszczewski Hi, can you post the backtrace generated by running bundle exec jekyll build --trace
Thanks.

@baszczewski
Copy link
Author

Shure @ashmaroli:

Configuration file: /media/data/projects/test/_config.yml
            Source: /media/data/projects/test
       Destination: /media/data/projects/test/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
         AutoPages: Generating tags pages
         AutoPages: Generating categories pages
         AutoPages: Generating collections pages
                    
        Pagination: Complete, processed 1 pagination page(s)
Traceback (most recent call last):
	27: from /usr/local/bin/jekyll:23:in `<main>'
	26: from /usr/local/bin/jekyll:23:in `load'
	25: from /usr/local/share/gems/gems/jekyll-3.8.5/exe/jekyll:15:in `<top (required)>'
	24: from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	23: from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	22: from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	21: from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	20: from /usr/local/share/gems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	19: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	18: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:36:in `process'
	17: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/commands/build.rb:65:in `build'
	16: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/command.rb:28:in `process_site'
	15: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:73:in `process'
	14: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:208:in `write'
	13: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:330:in `each_site_file'
	12: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:330:in `each'
	11: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:331:in `block in each_site_file'
	10: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:331:in `each'
	 9: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:332:in `block (2 levels) in each_site_file'
	 8: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/site.rb:209:in `block in write'
	 7: from /usr/local/share/gems/gems/jekyll-3.8.5/lib/jekyll/convertible.rb:226:in `write'
	 6: from /usr/share/ruby/fileutils.rb:193:in `mkdir_p'
	 5: from /usr/share/ruby/fileutils.rb:193:in `each'
	 4: from /usr/share/ruby/fileutils.rb:208:in `block in mkdir_p'
	 3: from /usr/share/ruby/fileutils.rb:208:in `reverse_each'
	 2: from /usr/share/ruby/fileutils.rb:210:in `block (2 levels) in mkdir_p'
	 1: from /usr/share/ruby/fileutils.rb:232:in `fu_mkdir'
/usr/share/ruby/fileutils.rb:232:in `mkdir': File exists @ dir_s_mkdir - /media/data/projects/test/_site/freebies/index.html (Errno::EEXIST)

@ashmaroli
Copy link
Contributor

Okay, can you check if the error is reproducible with v2.0.0 of this plugin..? I don't see a trace pointing
to jekyll-paginate-v2..

@baszczewski
Copy link
Author

@ashmaroli
That's right. The problem is probably inside v2.1.0. Downgrade resolve this issue.

@thomasvaeth
Copy link

Pagination: Complete, processed 6 pagination page(s)
jekyll 3.8.5 | Error:  File exists @ dir_s_mkdir - /Users/thomasvaeth/barber-jekyll/_site/tag/squid/index.html

Just wanted to say that I got the same error. Pagination was set at 6 posts per page, but I had 12 posts. Downgrading to v2.0.0 worked for me.

@HorlogeSkynet
Copy link

HorlogeSkynet commented Mar 4, 2019

Same problem over here, downgrading to v2.0.0 is the current workaround o/

EDIT : Incredible plugin, mostly the autopage feature. Thanks 🙇‍♂️ 👋

fl3a added a commit to fl3a/florian.latzel.io that referenced this issue Mar 5, 2019
'jekyll 3.8.5 | Error:  File exists @ dir_s_mkdir - /home/florian/jekyll.netzaffe.de/_site/tags/koln/index.html'
Sources:
- http://talk.jekyllrb.com/t/jekyll-3-8-5-error-file-exists-dir-s-mkdir-home-travis-build/2546/2
- sverrirs/jekyll-paginate-v2#150
@rebeccathedev
Copy link

I just pulled @ashmaroli's PR as a patch into a branch off master and can confirm that it fixes this issue.

I am running Jekyll 4 (and thus master since I need e3cc120 from 10 days ago), so downgrading isn't an option.

@sverrirs
Copy link
Owner

sverrirs commented Feb 8, 2020

Could you please upgrade to https://rubygems.org/gems/jekyll-paginate-v2/versions/3.0.0 and test again for me?

@HorlogeSkynet
Copy link

Works like a charm for me, thanks @sverrirs 👌 💯

@minhtran1309
Copy link

The problem seems to happened again with the error message:
mkdir': File exists @ dir_s_mkdir

jekyll-3.9.2 and ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux-musl]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants