Skip to content

Error executing action `run` on resource 'ruby_block[directory resource: /data/GitLab]'

Hello, I'm running github on my machine :

System information
System:		Ubuntu 16.04
Current User:	git
Using RVM:	no
Ruby Version:	2.3.1p112
Gem Version:	2.6.6
Bundler Version:1.13.1
Rake Version:	10.5.0
Sidekiq Version:4.1.4

GitLab information
Version:	8.12.1
Revision:	ca3c6a4
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
URL:		http://vulcano.local:455/gitlab
HTTP Clone URL:	http://vulcano.local:455/gitlab/some-group/some-project.git
SSH Clone URL:	git@vulcano.local:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	3.6.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:		/opt/gitlab/embedded/bin/git

I have another HDD mounted in /data where i would like to move my data directory, so i modified my gitlab.rb :

external_url "http://vulcano.local:455/gitlab"

git_data_dirs({"default" => "/data/GitLab"})

but when i run sudo gitlab-ctl reconfigure i get :

Starting Chef Client, version 12.12.15
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
  - gitlab (0.0.1)
  - package (0.0.0)
  - runit (0.14.2)
Installing Cookbook Gems:
Compiling Cookbooks...
Recipe: gitlab::default
  * directory[/etc/gitlab] action create (up to date)
/sbin/init: unrecognized option '--version'
-.mount                                                                                   loaded active mounted   /
  Converging 284 resources
  * directory[/etc/gitlab] action create (up to date)
  * directory[Create /var/opt/gitlab] action create (up to date)
  * directory[/opt/gitlab/embedded/etc] action create (up to date)
  * template[/opt/gitlab/embedded/etc/gitconfig] action create (up to date)
Recipe: gitlab::web-server
  * group[gitlab-www] action create (up to date)
  * user[gitlab-www] action create (up to date)
Recipe: gitlab::users
  * directory[/var/opt/gitlab] action create (up to date)
  * group[git] action create (up to date)
  * user[git] action create (up to date)
  * template[/var/opt/gitlab/.gitconfig] action create (up to date)
Recipe: gitlab::gitlab-shell
  * ruby_block[directory resource: /data/GitLab] action run

    ================================================================================
    Error executing action `run` on resource 'ruby_block[directory resource: /data/GitLab]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of stat --printf='%U' /data/GitLab ----
    STDOUT:
    STDERR: stat: cannot stat '/data/GitLab': Permission denied
    ---- End output of stat --printf='%U' /data/GitLab ----
    Ran stat --printf='%U' /data/GitLab returned 1

    Cookbook Trace:
    ---------------
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/storage_directory_helper.rb:35:in `run_command'
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/storage_directory_helper.rb:63:in `get_owner'
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/storage_directory_helper.rb:48:in `ensure_permissions_set'
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/definitions/storage_directory.rb:32:in `block (3 levels) in from_file'

    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/definitions/storage_directory.rb

     26:   ruby_block "directory resource: #{params[:path]}" do
     27:     block do
     28:       # Ensure the directory exists
     29:       storage_helper.ensure_directory_exists(params[:path])
     30:
     31:       # Ensure the permissions are set
     32:       storage_helper.ensure_permissions_set(params[:path])
     33:
     34:       # Error out if we have not achieved the target permissions
     35:       storage_helper.validate!(params[:path])
     36:     end
     37:     not_if { storage_helper.validate(params[:path]) }
     38:   end
     39: end

    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/definitions/storage_directory.rb:26:in `block in from_file'

    ruby_block("directory resource: /data/GitLab") do
      params {:path=>"/data/GitLab", :owner=>"git", :group=>nil, :mode=>"0700", :name=>"/data/GitLab"}
      action [:run]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      block_name "directory resource: /data/GitLab"
      declared_type :ruby_block
      cookbook_name "gitlab"
      recipe_name "gitlab-shell"
      block #<Proc:0x00000005e15668@/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/definitions/storage_directory.rb:27>
      not_if { #code block }
    end

    Platform:
    ---------
    x86_64-linux


Running handlers:
Running handlers complete
Chef Client failed. 0 resources updated in 02 seconds

I can't figure out what I'm doing wrong, please can you help me? :)