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
  • #8521

Closed
Open
Created Dec 30, 2014 by Administrator@rootOwner

Pre-receive hook fails with gitlab-omnibus if /var/opt is a symlink

Created by: FooBarWidget

We have a rather unique server setup where /var/opt is symlinked to /home/system/var_opt. The reason why we do this is because the server is partially encrypted. The base system is unencrypted, and most of the actual data lives in the encrypted partition. /opt and /var/opt are thus symlinked to directories within the encrypted partition.

However this causes gitlab-omnibus's pre-receive hook to fail. In the pre-receive hook, repo_path evaluates to /home/system/var_opt/gitlab/git-data/repositories/... -- the expanded version of the path. This causes GitlabAccess.new(repo_path, key_id, refs).exec to fail. Whatever command it executes, it outputs:

GitLab: No such project

We solved this problem locally by adding the following line to the pre-release hook which fixes up the path:

# In /opt/gitlab/embedded/service/gitlab-shell/hooks/pre-receive:
repo_path.sub!("/home/system/var_opt/", "/var/opt/")
Assignee
Assign to
Time tracking