I’m using MathJax for jekyll blog, and seems like it occurs Travis CI error with SSL certificate. I do not know much about SSL certificate, but the external link does work for sure.
I tried sudo apt-get install libcurl4-openssl-dev and installed it, but error still happens.
Does anyone know how to fix this?
$ script/cibuild
Configuration file: C:/Users/user/Desktop/Jwmc999.github.io/_config.yml
Source: C:/Users/user/Desktop/Jwmc999.github.io
Destination: C:/Users/user/Desktop/Jwmc999.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 2.179 seconds.
Auto-regeneration: disabled. Use --watch to enable.
Running ["ScriptCheck", "LinkCheck", "ImageCheck", "HtmlCheck"] on ["./_site"] on *.html...
Checking 1 external link...
Ran on 43 files!
- ./_site/Recursion/index.html
* External link https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js failed: response code 0 means something's wrong.
It's possible libcurl couldn't connect to the server or perhaps the request timed out.
Sometimes, making too many requests at once also breaks things.
Either way, the return message (if any) from the server is: SSL peer certificate or SSH remote key was not OK
HTML-Proofer found 1 failure!
@MichaelCurrin, thanks for always answering my questions!
The thing is, this html-proofer error does not occur when I push to remote
Run sh script/cibuild
Configuration file: /home/runner/work/Jwmc999.github.io/Jwmc999.github.io/_config.yml
Source: /home/runner/work/Jwmc999.github.io/Jwmc999.github.io
Destination: /home/runner/work/Jwmc999.github.io/Jwmc999.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 0.897 seconds.
Auto-regeneration: disabled. Use --watch to enable.
Running ["ScriptCheck", "LinkCheck", "ImageCheck", "HtmlCheck"] on ["./_site"] on *.html...
Checking 1 external link...
Ran on 44 files!
HTML-Proofer finished successfully.
Inspecting 3 files
..W
Offenses:
script/validate-html:1:1: W: Lint/ScriptPermission: Script file validate-html doesn't have execute permission.
#!usr/bin/env ruby
^^^^^^^^^^^^^^^^^^^
3 files inspected, 1 offense detected
So I thought maybe I ignore it, but this time, the Action shows False Warning for shebang in first line.
Though shebang error does not appear when I run rubocop -a in local
$ rubocop -a
Inspecting 3 files
...
3 files inspected, no offenses detected
Tried
Lint/ScriptPermission:
Enabled: false
Then I cannot execute script/validate-html at all. Says bundler: unexecuatble script/valid-html
I really don’t know how to solve this false warning problem, because in local, it’s already working! Shouldn’t local and remote work simultaneously??
The problem is not the shebang but what the error says - that the script is not executable and therefore the shebang is useless.
Also it is just “W” for warning so you can get by without changes if you want.
Make the script executable.
chmod +x scripts/valid-html
Or remove the shebang.
And commit it.
I don’t know why you need that ScriptPermission script to check script permissions. You’d get an error when running the script if there wasn’t permissions or it wouldn’t matter because you use ruby scripts/valid-html instead.
If you want to make them all executable (also must add shebangs where missing):
chmod +x scripts/*
As for different environment behavior :
Your local and remote environments might use something different for sh (dash on ubuntu but bash on mac) plus bash and ruby etc. could have different versions on environments.
Also your CI flow might be different. I have to see the exact set of commands on CI and what you run locally to check they are indeed the same.
After I changed to chmod +x, my ruby still accepts only sh script/cibuild and script/cibuild, not chmod +x script/cibuild. Same for script/bootstrap.
user@DESKTOP-NJK3JG0 MINGW64 ~/Desktop/Jwmc999.github.io (main)
$ chmod +x script/cibuild
user@DESKTOP-NJK3JG0 MINGW64 ~/Desktop/Jwmc999.github.io (main)
$ chmod +x script/bootstrap
user@DESKTOP-NJK3JG0 MINGW64 ~/Desktop/Jwmc999.github.io (main)
$ sh script/cibuild
Configuration file: C:/Users/user/Desktop/Jwmc999.github.io/_config.yml
Source: C:/Users/user/Desktop/Jwmc999.github.io
Destination: C:/Users/user/Desktop/Jwmc999.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 2.01 seconds.
Auto-regeneration: disabled. Use --watch to enable.
Running ["ScriptCheck", "LinkCheck", "ImageCheck", "HtmlCheck"] on ["./_site"] on *.html...
Checking 1 external link...
Ran on 44 files!
- ./_site/Recursion/index.html
* External link https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js failed: response code 0 means something's wrong.
It's possible libcurl couldn't connect to the server or perhaps the request timed out.
Sometimes, making too many requests at once also breaks things.
Either way, the return message (if any) from the server is: SSL peer certificate or SSH remote key was not OK
HTML-Proofer found 1 failure!
user@DESKTOP-NJK3JG0 MINGW64 ~/Desktop/Jwmc999.github.io (main)
$ script/cibuild
Configuration file: C:/Users/user/Desktop/Jwmc999.github.io/_config.yml
Source: C:/Users/user/Desktop/Jwmc999.github.io
Destination: C:/Users/user/Desktop/Jwmc999.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 1.854 seconds.
Auto-regeneration: disabled. Use --watch to enable.
Running ["ScriptCheck", "LinkCheck", "ImageCheck", "HtmlCheck"] on ["./_site"] on *.html...
Checking 1 external link...
Ran on 44 files!
- ./_site/Recursion/index.html
* External link https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js failed: response code 0 means something's wrong.
It's possible libcurl couldn't connect to the server or perhaps the request timed out.
Sometimes, making too many requests at once also breaks things.
Either way, the return message (if any) from the server is: SSL peer certificate or SSH remote key was not OK
HTML-Proofer found 1 failure!
Don’t use sh to execute your scripts. It is different on each system. It’s an alias. plus using sh scriptname will ignore your executable permission status and shebang
Rather use this once off.
chmod +x scripts/my-script
And the shebang would be
#!/usr/bin/env ruby
Or
#!/usr/bin/env bash
# or if you prefer
#!/bin/bash
Then when you execute locally directly or in another script or GH actions, use this style.
Thanks Million! I installed ubuntu 20.04 and reinstalled ruby and jekyll and run chmod +x on script. also revised CI files and script (.travis.yml, ci.yml, and files under script directory) as you commented. Now the page finally build! Also, no SSL error at all. The problem was CI of my theme set for ubuntu but I didn’t have it local so making script executable was not possible, every time when I pushed to remote. Thanks again for your help.