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

Error on adding Hashnode RSS: Liquid Exception: Numerical argument is out of domain - "sqrt" (Math::DomainError) #1828

Closed
SwayamInSync opened this issue Oct 13, 2023 · 7 comments

Comments

@SwayamInSync
Copy link

SwayamInSync commented Oct 13, 2023

One can make these changes to re-create the error

# External sources.
# If you have blog posts published on medium.com or other external sources,
# you can display them in your blog by adding a link to the RSS feed.
external_sources:
  - name: Hashnode.com
    rss_url: https://swayam-blog.hashnode.dev/rss.xml

Error in the Installing workflow

Liquid Exception: Numerical argument is out of domain - sqrt in /SwayamInSync.github.io/_layouts/post.html
@SwayamInSync SwayamInSync changed the title On Adding Hashnode RSS: Liquid Exception: Numerical argument is out of domain - sqrt in /SwayamInSync.github.io/_layouts/post.html Error on adding Hashnode RSS: Liquid Exception: Numerical argument is out of domain - sqrt in /SwayamInSync.github.io/_layouts/post.html Oct 13, 2023
@pskadasi
Copy link

when this template is used for the first time, we are getting similar error directing to _layouts/post.html, due to this webpage is not being deployted. can some one please tackle this bug.

@rahulkumar-aws
Copy link

rahulkumar-aws commented Oct 14, 2023

Hi,
Hope it's the right place to report, I am also facing a similar issue.

external_sources:
  - name: medium.com
    rss_url: https://medium.com/@rahulkumar.aws/feed

error:

Liquid Exception: Numerical argument is out of domain - "sqrt" in /Users/rahulkumar/Documents/GitHub/rahulkumar-aws.io/_layouts/post.html
/Users/rahulkumar/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/classifier-reborn-2.3.0/lib/classifier-reborn/extensions/vector.rb:64:in `sqrt': Numerical argument is out of domain - "sqrt" (Math::DomainError)

This error stops the server from running.

@SwayamInSync SwayamInSync changed the title Error on adding Hashnode RSS: Liquid Exception: Numerical argument is out of domain - sqrt in /SwayamInSync.github.io/_layouts/post.html Error on adding Hashnode RSS: Liquid Exception: Numerical argument is out of domain - "sqrt" (Math::DomainError) Oct 15, 2023
@rudresh-v
Copy link

rudresh-v commented Oct 15, 2023

Same Issue! I'm trying it with Medium.com RSS Feed, still the same.

@YifanJiang233
Copy link
Contributor

I find this issue is caused by the related_blog_post with the usage of --lsi (latent semantic indexing) option. If there is no need for related posts, one can simply fix the issue by setting enable as false in _config.yml.

Otherwise, it is rather tricky to fix this issue. After tracing back the out of domain error, I find it is due to the accumulated numerical error of SVD used in classfier-reborn. In short, they self-crafted a pure Ruby SVD algorithm and it is not very robust. The orthonormal matrices they introduced might not be exact due to floating-point error and this could lead to a negative value inside the square root of line 64 here. One can fix the issue locally by changing line 64 to
s << Math.sqrt(qrot[r, r].abs)
See jekyll/classifier-reborn#153 for more discussion.

On the other hand, the official classifier-reborn does recommend to use other linear algebra solvers like LAPACK or GSL. These methods can be run locally and significantly increase the running speed, but I am not sure if it is possible to deploy them on GitHub page as well.

@pinshuai
Copy link

pinshuai commented Nov 7, 2023

Same issue here when redirecting to a pdf in the blog post.

@george-gca
Copy link
Collaborator

@YifanJiang233 have you made a PR with this change in the classfier-reborn plugin repo?

Meanwhile the best solution for someone with this problem is indeed disabling LSI. As for using other solvers, currently jekyll only support the LSI, as can be seen in jekyll options.

Nikronic added a commit to Nikronic/nikronic.github.io that referenced this issue Jan 16, 2024
Copy link

stale bot commented Feb 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 13, 2024
xlcbingo1999 added a commit to xlcbingo1999/xlcbingo1999.github.io that referenced this issue Feb 20, 2024
…h::DomainError)问题,可能是因为删除了cv对应的pdf, 然后还保留着xiaolinchang_cv.md,导致相似度计算出现0值

issue: alshedivat#1828
@stale stale bot closed this as completed Feb 23, 2024
SatpreetMakhija added a commit to SatpreetMakhija/satpreetmakhija.github.io that referenced this issue Mar 17, 2024
Github Action for deployment fails with error Liquid Exception: Numerical argument is out of domain - sqrt in /home/runner/work/satpreetmakhija.github.io/satpreetmakhija.github.io/_layouts/post.html. Following the issue, alshedivat#1828, fixing it following post by YifanJiang233
NeoNeuron added a commit to NeoNeuron/neoneuron.github.io that referenced this issue Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants