INFO Generating website...
INFO [update] </blog/>
INFO [update] </blog/2003.html>
webgen encountered a problem:
Error at path_handler.copy while creating a node from </blog/2003.en.html#blog-entries--2003>:
Can't have two nodes with same alcn: /blog/2003.en.html#blog-entries--2003
make[2]: *** [CMakeFiles/Website] Error 1
make[1]: *** [CMakeFiles/Website.dir/all] Error 2
make: *** [all] Error 2
---
title: "2003"
routed_title: "Blog entries 2003"
in_menu: false
---
Every time a page gets written and this page has the "fragments"
content processor enabled, fragment nodes (i.e. the ones for the
in-page header anchors) for the in-page links are created. However, if
an equivalent node already exists (e.g. from a cached previous run) this
node should normally be reused.
There seems to be a bug somewhere in that logic.
Can you create a small example site that reproduces the bug? Or are the
source for you website publicly available?
That is certainly not satisfactory. However, to fix this I first need
to reproduce this somehow.
I tried reproducing this in the source for the webgen documentation
website but failed so far.
What may also help is if you send me the debug output (webgen --debug)
of the main run (ie. one with no cache file) and then the debug output
of the run where the error happens.
What may also help is if you send me the debug output (webgen --debug)
of the main run (ie. one with no cache file) and then the debug output
of the run where the error happens.
INFO Populating node tree took 30.58 seconds
INFO [update] </blog/>
INFO [timing] </blog/> rendered in 0.00 seconds
DEBUG Using default template in language 'en' for </blog/2003.en.html>
DEBUG Using default template in language 'en' for </default.template>
INFO [update] </blog/2003.html>
DEBUG Replacing tag lang with data nil and body '' in </default.template>
DEBUG Replacing tag lang with data nil and body '' in </default.template>
DEBUG Replacing tag relocatable with data "andreas01.css" and body '' in </default.template>
DEBUG Replacing tag relocatable with data "print.css" and body '' in </default.template>
DEBUG Replacing tag title with data nil and body '' in </default.template>
DEBUG Replacing tag relocatable with data "/index.html" and body '' in </default.template>
DEBUG Replacing tag menu with data {"options"=>{"mi"=>{"in_menu"=>true}, "sort"=>true, "siblings"=>[0, -1]}} and body '' in </default.template>
DEBUG Using default template in language '' for </templates/tag.template>
DEBUG Using default template in language '' for </default.template>
DEBUG Replacing tag menu with data {"options"=>{"sort"=>true, "absolute_levels"=>[0, 2], "mi"=>{"in_menu"=>true}}} and body '' in </default.template>
DEBUG Replacing tag relocatable with data "/blog/index.html" and body '' in </default.template>
DEBUG Replacing tag breadcrumb_trail with data nil and body '' in </default.template>
DEBUG Replacing tag date with data {"format"=>"%Y"} and body '' in </default.template>
DEBUG Replacing tag title with data nil and body '' in </blog/2003.en.html>
DEBUG Creating node version 'default' from path </blog/2003.en.html#blog-entries--2003> with copy handler
webgen encountered a problem:
Error at path_handler.copy while creating a node from </blog/2003.en.html#blog-entries--2003>:
Can't have two nodes with same alcn: /blog/2003.en.html#blog-entries--2003
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/tree.rb:103:in `register_node'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/node.rb:99:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/base.rb:135:in `new'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/base.rb:135:in `create_node'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/copy.rb:32:in `create_nodes'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:401:in `block in create_nodes_with_path_handler'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:392:in `each'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:392:in `map'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:392:in `create_nodes_with_path_handler'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:353:in `create_secondary_nodes'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/fragments.rb:73:in `block in create_fragment_nodes'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/fragments.rb:65:in `each'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/fragments.rb:65:in `create_fragment_nodes'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/fragments.rb:18:in `call'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor.rb:104:in `call'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/page_utils.rb:46:in `block in render_block'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/page_utils.rb:45:in `each'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/page_utils.rb:45:in `render_block'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/blocks.rb:89:in `render_block'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/blocks.rb:26:in `block in call'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/blocks.rb:21:in `gsub!'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor/blocks.rb:21:in `call'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/content_processor.rb:104:in `call'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/page_utils.rb:46:in `block in render_block'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/page_utils.rb:45:in `each'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/page_utils.rb:45:in `render_block'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/page.rb:28:in `content'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler/base.rb:66:in `content'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:307:in `block in write_node'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:307:in `write_node'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:280:in `block in write_tree'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:271:in `each'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/path_handler.rb:271:in `write_tree'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/task/generate_website.rb:23:in `block in call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/task/generate_website.rb:20:in `call'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/task.rb:89:in `execute'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/website.rb:209:in `execute_task'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/cli/commands/generate.rb:29:in `execute'
/Library/Ruby/Gems/2.0.0/gems/cmdparse-2.0.6/lib/cmdparse.rb:464:in `parse'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/lib/webgen/cli.rb:192:in `parse'
/Library/Ruby/Gems/2.0.0/gems/webgen-1.2.1/bin/webgen:5:in `<top (required)>'
/usr/bin/webgen:23:in `load'
/usr/bin/webgen:23:in `<main>'
Thanks for the link to the sources and the explanation on how to
reproduce the bug! I think that I have located the problem and I'm
working on a fix.
On 2015-02-22 19:37 -0800 Lars Bähren wrote:
>
>
> On Sunday, February 22, 2015 at 11:22:26 PM UTC+1, Thomas Leitner
> wrote:
> >
> > Thanks for the link to the sources and the explanation on how to
> > reproduce the bug! I think that I have located the problem and I'm
> > working on a fix.
> >
>
> Hi Thomas - good look with the fix, looking forward to pull an update
> once this is resolved.
INFO Generating website...
INFO [update] </blog/>
INFO [update] </blog/2015.html>
INFO [update] </blog/2015/01/index.html>
INFO [update] </blog/2015/02/>
INFO [create] </blog/2015/02/2015-02-24_07-59.html>
INFO [update] </blog/2015/02/index.html>
INFO [update] </blog/2015/index.html>
INFO [update] </blog/index.html>
INFO [update] </blog/upcoming/>
INFO [update] </blog/upcoming/index.html>
INFO ... done in 477.85 seconds
I have found what is the bottleneck during website (re-)generation but
I still need to further investigate on how to optimize it.
However, what I have found is that your making webgen do much more work
than necessary. Since the menu statement at
https://github.com/lbaehren/Website/blob/master/ext/templates/data/lars01/default.template#L59
is commented out, the result will not appear on the website itself but
webgen still processes it, creating two menus instead of one.
After commenting out the menu (just place a backslash in front of it,
i.e. \{menu:...}), I cut the first time generation down by about 66%
(from 300 seconds to 100 seconds on my machine).
After commenting out the menu (just place a backslash in front of it,
i.e. \{menu:...}), I cut the first time generation down by about 66%
(from 300 seconds to 100 seconds on my machine).
[100%] Rendering website from sources ...
INFO Generating website...
INFO [update] </blog/>
INFO [update] </blog/2003.html>
INFO [update] </blog/2003/2003-11/2003-11-03_20-47.html>
INFO [update] </blog/2003/2003-11/2003-11-03_20-54.html>
INFO [update] </blog/2003/2003-11/2003-11-03_20-57.html>
...
INFO [update] </writing/book_reviews/moondial.html>
INFO [update] </writing/book_reviews/red_rabbit.html>
INFO [update] </writing/book_reviews/the_divine_secrets_of_the_ya-ya-sisterhood.html>
INFO [update] </writing/book_reviews/the_last_year_of_being_married.html>
INFO [update] </writing/book_reviews/the_undutchables.html>
INFO [update] </writing/index.html>
INFO ... done in 256.40 seconds
[100%] Built target Website
Yeah, the reason why this works on your website is that the statement
that really generates your menu doesn't use any information from the
node in which the menu is generated. Therefore the menu can be created
once and used on every page without going through the node_finder again.
What I'm trying to do now is to get more of the node finder options to
produce good cacheable results. This won't reduce the number to 1 but
it should be reducable to a few combinations of parameters (like node
level, node language) in most cases.
By the way: I saw that you manually create menus in many files, for
example in src/blog/pages/2010.page. By using a template (that
itself gets applied into the main default.template) that contains a
"{menu: ...}" you could automatically generate those.