Unable to push or pull with deploy key


I followed a guide a few weeks ago to move our puppet code to our gitlab ( https://github.com/bentlema/puppet-tutorial-pe/blob/master/tutorial/vbox/10-Move-Puppet-Code-to-GitLab.md ), and everything was working fine. But we recently noticed that anyone had access to the code, so I changed the project visibility from public to internal, and the git hook does not work anymore.

This is related to the fact that root user was not a member of the project. I tried to correct that, removed the deploy key to set it to root’s public key on Gitlab, but without success.

The hook works like this : when someone pushes some code modification, the hook ssh to the puppet master and executes r10k deploy environment, which pulls the code from the gitlab

The error message from the git hook :
remote: ERROR -> Unable to determine current branches for Git source ‘puppet’ (/etc/puppetlabs/code/environments)
remote: Original exception:
remote: GitLab: The project you were looking for could not be found.

Is there a way to allow push/pull requests with deploy keys to work on an internal or private project ?