Page rendering errors cause Jekyll to fail silently #46

Closed
jamesarosen opened this Issue May 23, 2009 · 13 comments

Projects

None yet

7 participants

@jamesarosen
Contributor

In server- and auto modes, Jekyll silently fails to build a page that has markup errors. The only error type I've been able to pinpoint so far is a syntax error in the YAML header, like:


---
title: something. with: weird, punctuation
layout: default

---
Some content

Saving that file just causes the following to be spit into the log:

[2009-05-23 15:29:25] regeneration: 1 files changed

but no HTML file is generated. Fixing the header (by putting quotes around the title value) causes the page to generate properly.

@jamesarosen
Contributor

running jekyll --no-auto causes the full stack-trace to bubble up, which is very helpful in debugging.

@jamesarosen
Contributor

But it doesn't always work. I'm getting the following error from GitHub's build:

The page build failed with the following error:
private method `chop!' called for nil:NilClass

But running jekyll --no-auto locally (after cleaning out the _site/ directory) gives this:

Configuration from ./_config.yml
Building site: . -> ./_site
Successfully generated site: . -> ./_site
@qrush
Contributor
qrush commented May 24, 2009

Yeah, I've run into this as well. Definitely needs to be fixed.

@jamesarosen
Contributor

Looking at the Maruku source, chop! is only used in three places. One is for getting rid of trailing whitespace, one is for titles in links (a la [text](url "title")) and one is for titles in images. I think it's important that those titles are bounded by double quotes rather than single quotes.

@jamesarosen
Contributor

Well, I fixed all the single quotes around titles, but that doesn't seem to be it. It must be a whitespace issue, b/c I have no images (except one done explicitly in HTML).

@jamesarosen
Contributor

The underlying error seems to have been a problem in Maruku, since the page built fine once I changed the processor to RDiscount. It would still be nice to have those errors bubble up, though.

@MattHall
Contributor

I've submitted a pull request for this issue:

#249

@ivolo
ivolo commented Jun 25, 2012

+1

@ysim
ysim commented Aug 25, 2012

Yeah, I'm getting the same issue right now (and I've tried jekyll --no-auto too). It's especially frustrating because I've narrowed down which post is causing the problem, but it's such a long post that I don't know where it could be. It would be so much more helpful if the stacktraces would actually tell you the file and line number that it's having trouble parsing.

@ysim
ysim commented Aug 25, 2012

Ah, I think I found the problem -- I think the pycon lexer was having trouble with the regex in my snippet. I'll have to investigate further... puts on debugging hat

@bhardin
Contributor
bhardin commented Aug 30, 2012

I ran into the same problem. I usually am able to find the issue... Something in the YAML... However, this time it looks to be something else.

/Users/bhardin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse': (<unknown>): couldn't parse YAML at line 7 column 42 (Psych::SyntaxError)
    from /Users/bhardin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse_stream'
    from /Users/bhardin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:125:in `parse'
    from /Users/bhardin/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:112:in `load'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:33:in `read_yaml'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/post.rb:39:in `initialize'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/site.rb:163:in `new'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/site.rb:163:in `block in read_posts'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/site.rb:161:in `each'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/site.rb:161:in `read_posts'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/site.rb:128:in `read_directories'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/site.rb:98:in `read'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/lib/jekyll/site.rb:38:in `process'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/gems/jekyll-0.11.2/bin/jekyll:250:in `<top (required)>'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/bin/jekyll:19:in `load'
    from /Users/bhardin/.rvm/gems/ruby-1.9.3-p0/bin/jekyll:19:in `<main>'

Any idea?

@bhardin
Contributor
bhardin commented Aug 30, 2012

Figured my problem out... I had a colon (:) in the yaml

@parkr
Member
parkr commented Jan 1, 2013

Merged in #249.

@parkr parkr closed this Jan 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment