Search code examples
gitgitlabpushgit-push

Why am I unable to push changes to repo after updating Gitlab?


After updating the Gitlab from 12.2.1 to 12.4.0 I am unable to push the changes to repo. This problem exists with any branch.

This is the output I'm having when trying to push:

remote: GitLab: This action cannot be performed by internal users
To git.repo.com:repo/main-websites/repo.com.git
 ! [remote rejected] branch -> branch (pre-receive hook declined)
error: failed to push some refs to 'git@git.repo.com:repo/main-websites/repo.com.git'

I have tried the following:

  • Reconfiguring/restarting the Gitlab
  • Deleting my local copy and cloning it from scratch, I am able to pull the project with no problem, but not able to push.
  • I've tried to make changes from another machine, same story there.
  • I've tried to delete my SSH key from Gitlab and regenerate it, but it didn't helped either.

Here is the only piece of log I've found that is related to the issue

{
    "method":"POST",
    "url":"http://127.0.0.1:8080/api/v4/internal/allowed",
    "code":"401",
    "body":"{
        "status":false,
        "message":"This action cannot be performed by internal users"
    }",
    "pid":17255,
    "level":"error",
    "msg":"Call failed",
    "time":"2019-10-23T13:55:33+00:00"
}

Will be thankful for any ideas about what might be causing it as I am completely stuck here.

Thank you!


Solution

  • Apparently the file with keys on GitLab instance was corrupted.

    I've fixed it the following way:

    • I deleted the file: /var/opt/gitlab/.ssh/authorized_keys
    • Deleted all SSH keys from GitLab Web UI
    • Re-added the keys

    And it works fine now...

    Solution have been found here: https://stackoverflow.com/a/29765704/1544230