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

URL should validate output #2834

Closed
parkr opened this issue Aug 27, 2014 · 10 comments · Fixed by #5069
Closed

URL should validate output #2834

parkr opened this issue Aug 27, 2014 · 10 comments · Fixed by #5069
Milestone

Comments

@parkr
Copy link
Member

parkr commented Aug 27, 2014

Colons, for example, should not be allowed

jekyll/jekyll-paginate#8

@tkrotoff
Copy link
Contributor

This is the error you get for using a colon inside a file name (ex: 2014-02-10-Jogging-:-le-pied-amortisseur.md):

Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
Regenerating: 2 files at 2014-11-27 01:42:36 ...done.
E, [2014-11-27T01:42:37.357578 #16614] ERROR -- : run() in thread failed: different prefix: "" and "/Users/tanguy/jekyll":/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:500:in `relative_path_from'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/adapter/darwin.rb:47:in `block in _process_event'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/adapter/darwin.rb:43:in `each'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/adapter/darwin.rb:43:in `_process_event'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/adapter/base.rb:47:in `block (2 levels) in configure'
/Library/Ruby/Gems/2.0.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `call'
/Library/Ruby/Gems/2.0.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `run'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/adapter/darwin.rb:39:in `_run'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/adapter/base.rb:58:in `block in start'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/internals/thread_pool.rb:7:in `call'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.0/lib/listen/internals/thread_pool.rb:7:in `block in add'
  • OK : 2014-02-10-Jogging-le-pied-amortisseur.md
  • KO : 2014-02-10-Jogging-:-le-pied-amortisseur.md

@parkr
Copy link
Member Author

parkr commented Nov 27, 2014

This should be removed via slugify, probably. Also, it should be ignored from source with a loud warning.

@parkr parkr added the Bug label Nov 29, 2014
@kostiakoval
Copy link

I still have this issue what should I do.
Is there any step I can do ti fix it on my pc?

@envygeeks envygeeks added this to the 3.1 milestone Aug 26, 2015
@jimjam-slam
Copy link

I get the same error as @tkrotoff (identical except for the path of the jekyll blog) on Jekyll 2.5.3 (which I've tried uninstalling and reinstalling) when I'm serving and any of my files regenerate. I can't for the life of me work out which file has an illegal character, though.

$ jekyll serve
Configuration file: /Users/rensa/Code/rensa.github.io/_config.yml
            Source: /Users/rensa/Code/rensa.github.io
       Destination: /Users/rensa/Code/rensa.github.io/_site
      Generating... 
                    done.
 Auto-regeneration: enabled for '/Users/rensa/Code/rensa.github.io'
Configuration file: /Users/rensa/Code/rensa.github.io/_config.yml
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.
      Regenerating: 1 files at 2015-10-25 23:44:20 ...done.
E, [2015-10-25T23:44:20.563651 #10604] ERROR -- : run() in thread failed: different prefix: "" and "/Users/rensa/Code/rensa.github.io":/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:500:in `relative_path_from'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:47:in `block in _process_event'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:43:in `each'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:43:in `_process_event'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/base.rb:47:in `block (2 levels) in configure'
/Library/Ruby/Gems/2.0.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `call'
/Library/Ruby/Gems/2.0.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `run'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:39:in `_run'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/base.rb:58:in `block in start'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/internals/thread_pool.rb:7:in `call'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/internals/thread_pool.rb:7:in `block in add'

@parkr
Copy link
Member Author

parkr commented Oct 25, 2015

Can you run with LISTEN_GEM_DEBUGGING=1? That env var will show us more about what Listen thinks is happening.

@jimjam-slam
Copy link

Sure. Here's what I'm getting when I serve:

Configuration file: /Users/rensa/Code/rensa.github.io/_config.yml
            Source: /Users/rensa/Code/rensa.github.io
       Destination: /Users/rensa/Code/rensa.github.io/_site
      Generating... 
                    done.
I, [2015-10-26T20:32:22.635804 #12929]  INFO -- : Celluloid loglevel set to: 1
I, [2015-10-26T20:32:22.635855 #12929]  INFO -- : Listen version: 2.8.4
I, [2015-10-26T20:32:22.681548 #12929]  INFO -- : Record.build(): 0.02466297149658203 seconds
 Auto-regeneration: enabled for '/Users/rensa/Code/rensa.github.io'
Configuration file: /Users/rensa/Code/rensa.github.io/_config.yml
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.

And then when I save an alteration to a file (in this case, I added the word Change! to one my posts):

I, [2015-10-26T20:32:52.988417 #12929]  INFO -- : listen: raw changes: [[:modified, "/Users/rensa/Code/rensa.github.io/_posts/writing/2015-09-01-shell-tut.md"]]
I, [2015-10-26T20:32:52.988552 #12929]  INFO -- : listen: final changes: {:modified=>["/Users/rensa/Code/rensa.github.io/_posts/writing/2015-09-01-shell-tut.md"], :added=>[], :removed=>[]}
      Regenerating: 1 files at 2015-10-26 20:32:52 ...done.
E, [2015-10-26T20:32:53.272593 #12929] ERROR -- : run() in thread failed: different prefix: "" and "/Users/rensa/Code/rensa.github.io":/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:500:in `relative_path_from'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:47:in `block in _process_event'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:43:in `each'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:43:in `_process_event'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/base.rb:47:in `block (2 levels) in configure'
/Library/Ruby/Gems/2.0.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `call'
/Library/Ruby/Gems/2.0.0/gems/rb-fsevent-0.9.4/lib/rb-fsevent/fsevent.rb:45:in `run'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/darwin.rb:39:in `_run'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/adapter/base.rb:58:in `block in start'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/internals/thread_pool.rb:7:in `call'
/Library/Ruby/Gems/2.0.0/gems/listen-2.8.4/lib/listen/internals/thread_pool.rb:7:in `block in add'

EDIT: ah, and I also get the following when I ^C out of the serve:

[2015-10-26T20:35:39.674047 #12929]  WARN -- : Terminating task: type=:finalizer, meta={:method_name=>:__shutdown__}, status=:receiving
    Celluloid::TaskFiber backtrace unavailable. Please try `Celluloid.task_class = Celluloid::TaskThread` if you need backtraces here.

@parkr parkr modified the milestones: 3.1.1, 3.1 Jan 15, 2016
@parkr parkr modified the milestones: 3.2, 3.1.1 Jan 26, 2016
@jekyllbot jekyllbot added the stale Nobody stepped up to work on this issue. label Jun 6, 2016
@Crunch09
Copy link
Member

I'll try to come up with a patch for this in the next few days if no one has already started working on this.

@jekyllbot jekyllbot removed the stale Nobody stepped up to work on this issue. label Jun 30, 2016
@Crunch09
Copy link
Member

Crunch09 commented Jul 6, 2016

I was only able to reproduce the issue when still using the deprecated jekyll-paginate. Just a colon in the url didn't raise an error unless Jekyll::Paginate::Pager.paginate_path was called.
Am i missing something? And does this still need to be fixed in core jekyll?

@parkr
Copy link
Member Author

parkr commented Jul 6, 2016

@Crunch09 The idea is to validate the output of Jekyll::URL.new(params).to_s. If the URL output contains a colon, we should raise an error and let them know that the URL is invalid.

@Crunch09
Copy link
Member

Crunch09 commented Jul 6, 2016

@parkr 👍 Thank you!

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

Successfully merging a pull request may close this issue.

7 participants