I'm the owner of private repo. My repo has 'master' branch as protected, but developers can push to it. Once my devs started to push their changes to master branch, I've noticed that I'm not able to push my changes any more. The output looks like the following:
private-repo$ git pushCounting objects: 3, done.Delta compression using up to 4 threads.Compressing objects: 100% (2/2), done.Writing objects: 100% (3/3), 261 bytes | 0 bytes/s, done.Total 3 (delta 1), reused 0 (delta 0)remote: GitLab: No such projectTo git@gitlab.com:[my-username]/private-repo.git ! [remote rejected] master -> master (pre-receive hook declined)error: failed to push some refs to 'git@gitlab.com:[my-username]/private-repo.git'
My Gitlab dashboard shows me that I'm still the project owner. I can create branch and tags from UI. I've tried to use branches, created in UI, but no luck -can't push. I can even clone my project again. But it's not possible to push anything to any branch. Please help.
Designs
An error occurred while loading designs. Please try again.
Child items
0
Show closed items
GraphQL error: Variable $iid of type ID! was provided invalid value
No child items are currently open.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
There are issues with permissions (thats why its says no such project) , i think it will be solved soon ... For now you can work around by forking the project , push your commits (to a non protected branch or as a developer), merge request and set to auto merge for your account
@rptracker-dev@fadsel Do you have any other relevant info you could share? Is this only occurring for protected branches? Only for the master branch? Only with developers-can-push enabled? Only with a master account? Is this happening always, or only with selected repo's? What makes those repo's different? Answers to those questions should help us get a little further :)
Initially, I looked at protected branch and found out default master as protected.
I added some devs with 'allow push' checkbox set
I pushed some changes at Jan,26
After that, one of devs pushed his changes in master (from Feb 4 to March,16). I didn't make changes after his first commit
I tried to push my changes on March,16 with no luck, getting "Gitlab: No such project error"
After that, I unprotect master branch. Problem still exists
I re-cloned the project, and tried to push again. Problem still exists
I added branch to my project via UI, pulled changes and tried to push new changes. Got the same error.
In the same time, my dev has full access to the repo with no problems.
So, the problem is only with project owner and push action.
Is it possible to restore full access to my project? Sure, I can create new project and transfer code to it, but we have some wiki pages and issues, which is also necessary to migrate also. So, please advice. Let me know, if you need more details.
BTW, today, I found out that activity tab on my project becomes empty(yesterday it shows pushes and create/remove branch events).
The fact that it is saying "No such project" means it is getting to this code in internal.rb:
ifproject&&status&&status.allowed?statuselseGitlab::GitAccessStatus.new(false,'No such project')end
That means GitLab either can't find the project, can't find your username, or thinks your user account doesn't have permission. I'm inclined to guess the latter, but I haven't been able to reproduce this issue myself.
I'm not sure if there is a better way, but would one of you be willing to insert print statements to help figure out what's going on? I would recommend:
In /var/opt/embedded/service/gitlab-rails/lib/api/internal.rb:
Rails.logger.info("!!! TEST #{actor}#{params}#{project}#{status}#{status.try(:allowed?)}")# Addifproject&&status&&status.allowed?statuselseRails.logger.info("!!! Status is #{status}")# AddGitlab::GitAccessStatus.new(false,'No such project')end
Check /var/log/gitlab/production.log for these messages.
Hi,
I did push with no success several times today. Got the same error "remote: GitLab: No such project" . I tried to use branch 'test','dev', and then 'master'
@rptracker-dev Could you please let me know the exact user and project you are having this problem with? And the username for a user on the project who isn't having the problem?
You can email them to douwe@gitlab.com if you don't feel comfortable posting them here publicly.
@rptracker-dev We have so far been unable to reproduce the issue you're describing. If we replay the authorization request for your user account and the project in question, we are getting a successful response every time.
@fadsel Are you still having trouble pushing as well? Could you let me know the relevant user, project, key (if using SSH) and branch?
@DouweM ,
Can you advice anything for me? Is there any special environment variable used for project name determination?
Should I provide my ssh key(private/public part) via email?
I'm going to re-create my project this week, if problem won't be solved.
@rptracker-dev Have you tried pushing over HTTPS to see if that works? Otherwise I have now ideas right now. I'm working on making the error message more descriptive so you'll see something useful rather than "Project not found", which should help you (and us) track down the issue.
@rptracker-dev Well, at least it's consistent and apparently not a problem with your SSH key. We'll continue looking into it, sorry about the inconvenience.
@DouweM I have unchecked protected branch , Now I can only merge requests from a forked copy which is a temporary solution for me (cant push directly though )... for pushing directly I had to create a dublicate dev account which I push via my other machine ... but as owner still no luck , currently sticking to the merge request seems to work for now ,
PS : 🚶 just wondering why gravatars are not showing up , we are using GitLab 7.8.4 019ffd9a - but thats for another issue :)
@fadsel I did the exact step you mentioned and I wasn't able to get the error. Any chance you could create a test repository on gitlab.com that reproduces this problem and share it with us?
@rptracker-dev I'm thinking the same thing, but I'd like to eliminate all other possibilities first. It's really weird, there's something keeping you two from pushing, but everything works when we try to copy your steps, and no one else seems to be having any problems.
If anyone can get pushing failing consistently with a repo and account on GitLab.com, and if they provide us with the exact commands, commits, files they're using, that would be incredibly useful.
I did the same steps but in gitlab.com ... luckily no errors , thats weird 🚶 and I am kinda smiling right now 😃@marin@DouweM do you think its because we are using GitLab 7.8.4 , or perhaps we need to hard reboot our server?
Hello,
I've the same problem with some projects on our GitLab instance at work. But this problem appears only with HTTPS; I switch to SSH when it happens, then it works fine. I'm always the owner of the projects where this problem occurs. It concerns the version 7.9.4.
@schroeterm With 7.10.0, we've made the error messages a bit more descriptive to help us (and you) debug this. Is it possible for you to upgrade and try again then? If that's not possible, adding those debug logging commands and sharing the results with us would be very helpful.
$ git pushCounting objects: 7, done.Delta compression using up to 8 threads.Compressing objects: 100% (4/4), done.Writing objects: 100% (4/4), 352 bytes | 0 bytes/s, done.Total 4 (delta 3), reused 0 (delta 0)remote: GitLab: No such projectTo https://__COMPANYURL___/MS/mail.git ! [remote rejected] master -> master (pre-receive hook declined)error: failed to push some refs to 'https://__COMPANYURL__/MS/mail.git'
Production.log
Started GET "/MS/mail.git/info/refs?service=git-receive-pack" for __IPADDRESS__ at 2015-04-23 09:08:14 +0200Started GET "/MS/mail.git/info/refs?service=git-receive-pack" for __IPADDRESS__ at 2015-04-23 09:08:14 +0200Started GET "/MS/mail.git/info/refs?service=git-receive-pack" for __IPADDRESS__ at 2015-04-23 09:08:15 +0200Started POST "/MS/mail.git/git-receive-pack" for __IPADDRESS__ at 2015-04-23 09:08:15 +0200Started POST "//api/v3/internal/allowed" for __IPADDRESS__ at 2015-04-23 09:08:15 +0200!!! TEST #<User:0x0000000f040fd8> #<Hashie::Mash action="git-receive-pack" changes="c3c0d39baaa034b4cbd4d8cc2cdac9cc5791bdcc 1d3ebb9d7ce06816ab69ad21cad75a7cfee4cc8b refs/heads/master\n" project="MS/mail" route_info=#<Grape::Route:0x000000063a0920 @options={:prefix=>nil, :version=>"v3", :namespace=>"/internal", :method=>"POST", :path=>"/:version/internal/allowed(.:format)", :params=>{}, :compiled=>/\A\/(?<version>v3)\/internal\/allowed(?:\.(?<format>[^\/.?]+))?\Z/}> secret_token="__SECRETTOKEN__" user_id="11"> #<Project:0x0000000f0340f8> #<Gitlab::GitAccessStatus:0x0000000ef8cf88> false!!! Status is #<Gitlab::GitAccessStatus:0x0000000ef8cf88>
@schroeterm All right, thanks. It appears though that those log commands didn't actually give as much information as I was hoping for. Could you try again with the below log commands instead?
Rails.logger.info("!!! TEST #{actor.inspect}#{params.inspect}#{project.inspect}#{status.inspect}")# Addifproject&&status&&status.allowed?statuselseGitlab::GitAccessStatus.new(false,'No such project')end
In this log, it's the user Xcraft, but it's not right because I'm not this user. This one is used sometimes by a program on my computer which uses https://Xcraft:password@__SERVER__/blabla in order to clone some repositories. But on my system I've a cache credential enabled. Then when I work, this program changes my credential for the Xcraft user and this one can not push.
Then I've removed the cache, and everything works fine now.
@schroeterm - Could you be more specific about which cache you cleared? I seem to have a very similar problem that has persisted across multiple versions of gitlab.
Cloning the project works just fine, just not pushing.
That's really odd. Project access is checked before the type of command (download or push) is taken into account (source), so either both should work, or both shouldn't.
Can you reproduce this with a repo on gitlab.com, or just locally?
It's been at least 2 weeks (and a new release) since we heard from you. I'm closing this issue but if you still experience this problem, please open a new issue (but also reference the old issue(s)). Make sure to also include the necessary debugging information conforming to the issue tracker guidelines found in our contributing guidelines.
I have the same problem. I am the owner, but unable to push it for some reason. Please help
remote: GitLab: You are not allowed to push code to protected branches on this project.
To git@gitlab.com:balavishnu/PunjabSchoolNew.git
! [remote rejected] master -> master (pre-receive hook declined)
Nothing worked in my case. I don't know why but at last I was stuck. Finally I removed by myself. Please take a look on my answer https://gitlab.com/gitlab-com/support-forum/issues/40. I hope it may help some one.