Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #7341

Closed
Open
Created Jul 21, 2014 by Administrator@rootOwner

newline added to repo path in update hook (hook declined to update [...])

Created by: FewKinG

I installed gitlab manually (not the package) and everything seemed to work fine at first, but whenever I tried to push a branch to my remote origin it failed giving the following error message:

remote: GitLab: You are not allowed to access [...]!
remote: error: hook declined to update [...]

After some research I found that the problem occurs in /home/git/gitlab-shell/hooks/update where the repo path is determined by

repo_path = `pwd`

However, for me (using Ubuntu 14.04 and Ruby 2.1.2p95) this results in the repo_path having a trailing newline in it. This newline is also kept in the api call which determines if the user is allowed access to that repository. The API thus fails to find the repository, returning false, which will result in the error given above.

The solution for me was to change the line in the update hook to

repo_path = `pwd`.strip

Now everythings working fine. Anybody else ever had that problem?

Assignee
Assign to
Time tracking