al-folio: deploy crash with Liquid Exception: Zero vectors can not be normalized in /REPO/_layout/post.html

Acknowledge the following

  • [*] I carefully read and followed the Getting Started guide.
  • [*] I read through FAQ and searched through the past issues, none of which addressed my issue.
  • [*] The issue I am raising is a potential bug in al-folio and not just a usage question.
    [For usage questions, please post in the Discussions instead of raising an issue.]

Describe the bug 1- related posts which has been just recently added causes cibuild and deployment to fail after adding more than one post 2- when i push to gh-pages directly (which i’ve mistakenly done) i see the site doing all fine but posts return no article and any click to tags return me back home (or the about page to be precise) log :

Liquid Exception: Zero vectors can not be normalized in /home/muhammed/development/muhammedsabbagh.github.io/_layouts/post.html ------------------------------------------------ Jekyll 4.3.2 Please append --trace to the build command for any additional information or backtrace. ------------------------------------------------ /home/muhammed/gems/gems/matrix-0.4.2/lib/matrix.rb:2398:in normalize': Zero vectors can not be normalized (Vector::ZeroVectorError) from /home/muhammed/gems/gems/classifier-reborn-2.3.0/lib/classifier-reborn/lsi/content_node.rb:108:in raw_vector_with’ from /home/muhammed/gems/gems/classifier-reborn-2.3.0/lib/classifier-reborn/lsi.rb:386:in node_for_content' from /home/muhammed/gems/gems/classifier-reborn-2.3.0/lib/classifier-reborn/lsi.rb:221:in proximity_array_for_content’ from /home/muhammed/gems/gems/classifier-reborn-2.3.0/lib/classifier-reborn/lsi.rb:296:in find_related' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/related_posts.rb:45:in lsi_related_posts’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/related_posts.rb:22:in build' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/document.rb:403:in related_posts’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/drops/site_drop.rb:58:in related_posts' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/drops/drop.rb:128:in public_send’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/drops/drop.rb:128:in []' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/drops/site_drop.rb:19:in []’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/context.rb:197:in lookup_and_evaluate' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/variable_lookup.rb:48:in block in evaluate’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/variable_lookup.rb:38:in each_index' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/variable_lookup.rb:38:in evaluate’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/context.rb:159:in evaluate' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/for.rb:130:in collection_segment’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/for.rb:74:in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:103:in render_node_to_output’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:82:in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:206:in block in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:240:in with_profiling' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:205:in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:218:in render!' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:39:in block (3 levels) in render!’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:59:in measure_counts' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:38:in block (2 levels) in render!’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:63:in measure_bytes' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:37:in block in render!’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:70:in measure_time' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:36:in render!’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/inclusion.rb:16:in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/tags/include.rb:208:in block in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/context.rb:123:in stack' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/tags/include.rb:206:in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:103:in render_node_to_output' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:91:in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:46:in block (2 levels) in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:44:in each’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:44:in block in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/context.rb:123:in stack’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:43:in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:103:in render_node_to_output’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:82:in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:46:in block (2 levels) in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:44:in each' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:44:in block in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/context.rb:123:in stack' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/tags/if.rb:43:in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:103:in render_node_to_output' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/block_body.rb:82:in render’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:206:in block in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:240:in with_profiling’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:205:in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/liquid-4.0.4/lib/liquid/template.rb:218:in render!’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:39:in block (3 levels) in render!' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:59:in measure_counts’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:38:in block (2 levels) in render!' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:63:in measure_bytes’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:37:in block in render!' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:70:in measure_time’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/liquid_renderer/file.rb:36:in render!' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:129:in render_liquid’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:192:in render_layout' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:161:in place_in_layouts’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:93:in render_document' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/renderer.rb:63:in run’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:572:in render_regenerated' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:557:in block (2 levels) in render_docs’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:556:in each' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:556:in block in render_docs’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:555:in each_value' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:555:in render_docs’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:210:in render' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/site.rb:80:in process’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:28:in process_site' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:65:in build’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:36:in process' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in block in process_with_graceful_fail’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in each' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/command.rb:91:in process_with_graceful_fail’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/commands/build.rb:18:in block (2 levels) in init_with_program' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in block in execute’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in each' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in execute’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in go' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in program’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/jekyll-4.3.2/exe/jekyll:15:in <top (required)>' from /home/muhammed/gems/bin/jekyll:25:in load’ from /home/muhammed/gems/bin/jekyll:25:in <top (required)>' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:58:in load’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:58:in kernel_load' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/cli/exec.rb:23:in run’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/cli.rb:492:in exec' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/cli.rb:34:in dispatch' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/cli.rb:28:in start' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/exe/bundle:45:in block in <top (required)>’ from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/lib/bundler/friendly_errors.rb:117:in with_friendly_errors' from /home/muhammed/.local/share/gem/ruby/3.0.0/gems/bundler-2.4.7/exe/bundle:33:in <top (required)>’ from /home/muhammed/gems/bin/bundle:25:in load' from /home/muhammed/gems/bin/bundle:25:in <main>’

To Reproduce Steps to reproduce the behavior:

  1. have related posts enabled on _config.yml
  2. have 2 or more posts (despite being linting checked)
  3. use /bin/cibuild
  4. See error

Expected behavior 1- deployment should return a pass 2- i should see posts

Screenshots If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: EndeavourOS (Arch Linux) [64 bit x86]
  • chromium 108.0.5359.94 (Official Build) Arch Linux (64-bit)
  • Jekyll version [4.3.2]
  • Ruby version [3.0.5p211]

Additional context disabling related posts fixed the problem image the post pages (despite having 2 posts or more) didn’t show anything

now i have passing deploy i can see posts i can see websites

sorry if i have been rude in any place on this issue, and thank you!

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 29

Commits related to this issue

Most upvoted comments

You don’t need to deploy anything by hand. The whole template is already setup so your only work (after you configured your github repo according to the To enable automatic deployment part) is to create your content and commit in your main branch.

The setup I would recommend (and that I used myself): 1 - create your own repo from this template by clicking Use this template in the main repo page 2 - create your local setup following the instructions from here. Since I struggled myself in the beginning (I never used ruby or jekyll before), I wrote a step-by-step tutorial on how to install rbenv and run your site locally 3 - everything is working locally, then follow the instructions on the deployment section, more specifically the part For personal and organization webpages and To enable automatic deployment 4 - make sure the default template works in your-user.github.io 5 - Then, and only then, you start to make your modifications

The workflow I recommend (and use): 1 - test your changes locally first, preferably making small changes at a time and commiting them 2 - everything works, then push to you main repo

You don’t need to read a manual exhaustively, you just need to try to do small changes, one step at a time, and see how it goes. If it works like intended, great. If not, it is easy to revert. Just try again from scratch, make sure the original template run locally, then start doing the changes.

@MuhammedSabbagh

I have same issue. Finally I find solution. In my case when I changed this option in _config.yml true -> false

related_blog_posts:
  enabled: false
  max_related: 5

Deployment completed successfully.

i actually stated that in additional context aka “disabling related posts fixed the issue” so we are waiting to see if the feature gets fixed or not, the blog how ever works perfectly without it anyway

Also, @dh031200 I believe your related_blog_posts error was due to the same problem as here

here is deployment section. Follow that process and push to main branch.

You don’t need to do these.

(click to expand) Manual deployment to GitHub Pages:
(click to expand) Deployment to another hosting server (non GitHub Pages):
(click to expand) Deployment to a separate repository (advanced users only):

Thank you, that works!

I guess this is the repo you are using right? If this is the case, the problem lies in the announcements.

Internally, the announcements that sit in the _news/ directory use the layout: post. The calculus for similar posts are made for every post, which means every page that uses layout: post. To fix this, you can either add more text to your announcements, to avoid these errors, or add related_posts: false in your announcements. This is the way to avoid getting related posts for only one specific post.