RPC failed; HTTP 403 curl 22 The requested URL returned error: 403 Forbidden

Hello there!

I’m in trial with gitlab and installed it on my dedicated server recently.

Because I’m using Plesk on my server as web host solution, I had to use a special configuration to make it work with gitlab (and disable gitlab integrated nginx). I used that tutorial mainly:

https://www.jonasjuffinger.com/2017/03/26/gitlab-with-plesk-and-lets-encrypt/

Nothing’s so complicated.

I have to say everything was working properly for some days without any problems. But recently (maybe caused by a Debian packages update or so) I got the error that is shown on this thread title each time I want to push on any repository. I did a fresh new install on my server with the exact same results.

Here is the details:
$ git clone https://git.xxx.net/noxen/noxen-web
Cloning into ‘noxen-web’…
Username for ‘https://git.xxx.net’: nox
warning: redirecting to https://git.xxx.net/noxen/noxen-web.git/
warning: You appear to have cloned an empty repository.

$ cd noxen-web/
$ touch README.md
$ git add README.md
$ git commit -m "add README"
[master (root-commit) a2b5f29] add README
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README.md

$ git push -u origin master
Username for 'https://git.xxx.net': nox
warning: redirecting to https://git.xxx.net/noxen/noxen-web.git/
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 208 bytes | 208.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403 Forbidden
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

I tried to search a lot over many websites and found workarounds (one of them for example is to use ssh way to use the repository, instead of https, but for me it’s just a workaround as it don’t resolve my initial problem) or the same error type, but with different errors code (502, etc… not 403) and finally all of this without success.

Because I don’t know what to test and where to go from here, I’m asking some help here.

My dedicated server os is:
Debian GNU/Linux 9.6 (stretch) (4.15.18-9-pve)
Using gitlab-ee and a trial key

Thanks anyway!

I finally managed location problem looking every logs of gitlab & more successfully plesk / apache ones.
The problem was “mod_security” in Apache that was blocking certain types of connection.

Results was:

  • This RPC 403 Forbidden error
  • Impossibility to enable, delete Deploy Keys
  • (Maybe other problems I didn’t noticed)

So it’s now all resolved. Hope this can help.

1 Like

thanks for sharing solution, I’ve just facing this problem when push a repo to gitlab.com, do you have any idea about what I can do?