Found a strange behavior if you creating a text file and input a .txt file extension in the File Path field, all works as expected, but if you change extension to yaml, getting an error, see GIF attached. FYI this is self-hosted GitLab 16.6
And related to the GitLab issue:
HTTP Request node with the Predefined Credential Type: Gitlab API
With credentials for self-hosted GitLab Server 16.6
However, if I’m using the same credentials with curl from my computer, as per this GitLab Commits API documentation all works just fine:
echo $PAYLOAD
{
"branch": "main",
"commit_message": "some commit message",
"actions": [
{
"action": "create",
"file_path": "foo/bar",
"content": "some content"
}
]
}
curl --request POST --header "PRIVATE-TOKEN: mytoken" --header "Content-Type: application/json" \
--data "$PAYLOAD" https://git.mywebsite.com/api/v4/projects/9/repository/commits
Hi @Di_B, this looks like your request isn’t actually answered by Gitlab but instead intercepted by Cloudflare and presented with a challenge aimed at browsers.
You might need to update your Cloudflare settings to allow n8n to communicate with your Gitlab server for both the Gitlab node and the HTTP Request to work as expected.
Hi, and thanks for your reply. This is correct. My self-hosted GitLab is behind Cloudflare reverse proxy with the “Security > Bot Fight Mode” enabled. When disabling, the issue disappears. If I just use curl from my computer, there is no problem. Please consider looking into a way to allow HTTP Requests to work with Cloudflare Bot Fight Mode enabled. Thank you!
What about the first issue? Do you have any ideas why yaml files cannot be created on the GitLab server and are only allowed as txt?
What about the first issue? Do you have any ideas why yaml files cannot be created on the GitLab server and are only allowed as txt?
I do not unfortunately. But from looking at your GIF the error also seems to be that Cloudflare is blocking the request, presumably because they consider yaml files more suspicious than txt files. So I suspect the WAF is what’s kicking in here and you might want to check the respective Cloudflare logs for more details.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.