Background
Idem to Staticman on Framagit.
Besides, the build time for my Staticman + Beautiful Hugo demo on Framagit is half of that for the same project on GitLab.com.
Problem
After the setup, it’s possible that the theme shows “Sorry! There’s an error during submission.” To get an insight into this error, one has to open Web Developer Tools → Network and select the row corresponding to the POST request sent to the Staticman API. A side pane will pop out on the right. Select Response to view the API’s response in JSON.
-
Missing required fields: the “missing fields” error will occur.
-
In case of an incorrect
GIT***_TOKEN
on the server-side, or that the associated GitHub/GitLab account has not been invited as a “Collaborator/Developer”, the API will respond with an “unauthorized” error. -
In case of incorrect scopes of the
GIT***_TOKEN
on the server-side, the API will repond with a 404 errorGITHUB_CREATING_PR
.{ "JSON": { "success": false, "rawError": { "message": "{\"message\":\"Not Found\",\"documentation_url\":\"https:\/\/developer.github.com\/v3\/git\/refs\/#create-a-reference\"}", "statusCode": 404 }, "errorCode": "GITHUB_CREATING_PR" }, "Response payload": { "EDITOR_CONFIG": { "text": "{\"success\":false,\"rawError\":{\"message\":\"{\\\"message\\\":\\\"Not Found\\\",\\\"documentation_url\\\":\\\"https:\/\/developer.github.com\/v3\/git\/refs\/#create-a-reference\\\"}\",\"statusCode\":404},\"errorCode\":\"GITHUB_CREATING_PR\"}", "mode": "application\/json" } } }
-
In case of an incorrect user/repo name, a 404 error will be observed on the left of the entry in Web Developer Tools → Network.
-
In case of an incorrect branch/property name, a “read file” error will be thrown.
-
If the
branch
parameter instaticman.yml
doesn’t match that one specified in the POST URL, a “branch mismatch” error will occur. -
The most difficult case is “500: Internal server error” with
{"success": false}
. This gives no information about what’s going wrong. After two days of experiments withstaticman.yml
while setting up Staticman-powered GitLab Pages on Framagit, I have discovered several possible causes for such error. They are all due to incorrect config parameters instaticman.yml
.allowedFields
doesn’t match the name of the input fields in the POST request. (i.e. blog theme template)- incorrect
reCaptcha
parameters: ifenabled
is set tofalse
, one has to empty thesiteKey
andsecret
with the empty string""
. One can’t directly start a newline after the colon:
.
While testing for my new public Staticman instance for Framagit, I had forgotten that my another instance for GitLab.com was using a different private RSA key for the encryption endpoint.Therefore, the reCaptcha
secret
copied from my demo repos on GitLab.com would not work.
error 400:
INVALID_VERSION
Response payload:
Screenshot: Location: https://slowbreathing.github.io/articles/2019-07/LSTMPart-3
Analysis: missing property name.
Action: submitted PR slowbreathing/slowbreathing.github.io#2.