Undefined method `each' for "/run":String

When i try update gitlab-ce from version 11.1.4 to 11.2.0 to any upper i get this error:

Relevant File Content:

/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:

113: search_dirs =
114: if Gitlab[‘runtime_dir’]
115: Gitlab[‘runtime_dir’]
116: else
117: [’/run’, ‘/dev/shm’]
118: end
119:
120>> search_dirs.each do |run_dir|
121: fs = Gitlab[‘node’][‘filesystem2’][‘by_mountpoint’][run_dir]
122:
123: if fs && fs[‘fs_type’] == ‘tmpfs’
124: Gitlab[‘runtime_dir’] = run_dir
125: break
126: end
127: end
128:
129: Chef::Log.warn “Could not find a tmpfs in #{search_dirs}” if Gitlab[‘runtime_dir’].nil?

System Info:

chef_version=13.6.4
platform=debian
platform_version=9.5
ruby=ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client

Running handlers:
There was an error running gitlab-ctl reconfigure:

undefined method `each’ for “/run”:String

Any ideas?

Hello,

I just had the same problem.
Fast solution : in your file /etc/gitlab/gitlab.rb, comment the line defining the ‘runtime_dir’.
Explanation : in your gitlab.rb, you defined the runtime_dir as a single sting (from the log, ‘/run’ as it is by default). But now, runtime_dir is expected to be an array of strings. So the script does a .each on the array, and if you put a single string instead of array, it complains because a string doesn’t have the .each method.

Hope it helps.

Works!!

In alternative i have add a “,’’” at the end of runtime_dirs to force to be an array instead an string

runtime_dir ‘/run’,’’

Thanks