Skip to content

[native debian package] gitlab 13.1 fails to start with ruby 2.5 - syntax error, unexpected ']' (SyntaxError) ... pre = pre[m[0].length..]

Summary

gitlab 13.1 does not start with ruby 2.5 on debian buster (works on debian unstable with ruby 2.7). Did we drop support for ruby 2.5? This is also with unicorn (moving to puma is planned). If ruby 2.5 can't be supported, we probably have to move to ruby 2.7 on debian buster.

Steps to reproduce

Install the native debian package from debian fasttrack

Example Project

(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)

(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)

What is the current bug behavior?

gitlab fails to start with syntax error

What is the expected correct behavior?

(What you should see instead)

Relevant logs and/or screenshots

unicorn.stderr.log has this

I, [2020-06-29T20:26:38.326226 #161]  INFO -- : Refreshing Gem list
Attention: used pure ruby version of MurmurHash3
DEPRECATION WARNING: ActionDispatch::Http::ParameterFilter is deprecated and will be removed from Rails 6.1. Use ActiveSupport::ParameterFilter instead. (called from <top (required)> at /usr/lib/ruby/vendor_ruby/grape_logging/util/parameter_filter.rb:2)
/usr/share/gitlab/lib/gitlab.rb:38: warning: already initialized constant Gitlab::COM_URL
/usr/share/gitlab/lib/gitlab.rb:38: warning: previous definition of COM_URL was here
/usr/share/gitlab/lib/gitlab.rb:39: warning: already initialized constant Gitlab::STAGING_COM_URL
/usr/share/gitlab/lib/gitlab.rb:39: warning: previous definition of STAGING_COM_URL was here
/usr/share/gitlab/lib/gitlab.rb:40: warning: already initialized constant Gitlab::APP_DIRS_PATTERN
/usr/share/gitlab/lib/gitlab.rb:40: warning: previous definition of APP_DIRS_PATTERN was here
/usr/share/gitlab/lib/gitlab.rb:41: warning: already initialized constant Gitlab::SUBDOMAIN_REGEX
/usr/share/gitlab/lib/gitlab.rb:41: warning: previous definition of SUBDOMAIN_REGEX was here
/usr/share/gitlab/lib/gitlab.rb:42: warning: already initialized constant Gitlab::VERSION
/usr/share/gitlab/lib/gitlab.rb:42: warning: previous definition of VERSION was here
/usr/share/gitlab/lib/gitlab.rb:43: warning: already initialized constant Gitlab::INSTALLATION_TYPE
/usr/share/gitlab/lib/gitlab.rb:43: warning: previous definition of INSTALLATION_TYPE was here
/usr/share/gitlab/lib/gitlab.rb:44: warning: already initialized constant Gitlab::HTTP_PROXY_ENV_VARS
/usr/share/gitlab/lib/gitlab.rb:44: warning: previous definition of HTTP_PROXY_ENV_VARS was here
/usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require': /usr/share/gitlab/lib/gitlab/golang.rb:36: syntax error, unexpected ']' (SyntaxError)
...       pre = pre[m[0].length..]
...                              ^
/usr/share/gitlab/lib/gitlab/golang.rb:99: syntax error, unexpected end-of-input, expecting keyword_end
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:411:in `block in require_or_load'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:40:in `block in load_interlock'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:13:in `loading'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:40:in `load_interlock'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:389:in `require_or_load'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:544:in `load_missing_constant'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:214:in `const_missing'
	from /usr/share/gitlab/lib/gitlab/dependency_linker/go_mod_linker.rb:6:in `<class:GoModLinker>'
	from /usr/share/gitlab/lib/gitlab/dependency_linker/go_mod_linker.rb:5:in `<module:DependencyLinker>'
	from /usr/share/gitlab/lib/gitlab/dependency_linker/go_mod_linker.rb:4:in `<module:Gitlab>'
	from /usr/share/gitlab/lib/gitlab/dependency_linker/go_mod_linker.rb:3:in `<top (required)>'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:411:in `block in require_or_load'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:40:in `block in load_interlock'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:13:in `loading'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:40:in `load_interlock'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:389:in `require_or_load'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:544:in `load_missing_constant'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:214:in `const_missing'
	from /usr/share/gitlab/lib/gitlab/dependency_linker.rb:17:in `<module:DependencyLinker>'
	from /usr/share/gitlab/lib/gitlab/dependency_linker.rb:4:in `<module:Gitlab>'
	from /usr/share/gitlab/lib/gitlab/dependency_linker.rb:3:in `<top (required)>'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `block in require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:291:in `load_dependency'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:324:in `require'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:411:in `block in require_or_load'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:40:in `block in load_interlock'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies/interlock.rb:13:in `loading'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:40:in `load_interlock'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:389:in `require_or_load'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:367:in `depend_on'
	from /usr/share/rubygems-integration/all/gems/activesupport-6.0.3.1/lib/active_support/dependencies.rb:280:in `require_dependency'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/engine.rb:481:in `block (2 levels) in eager_load!'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/engine.rb:480:in `each'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/engine.rb:480:in `block in eager_load!'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/engine.rb:477:in `each'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/engine.rb:477:in `eager_load!'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/application.rb:509:in `eager_load!'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/engine.rb:356:in `eager_load!'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/application/finisher.rb:123:in `each'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/application/finisher.rb:123:in `block in <module:Finisher>'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/initializable.rb:32:in `instance_exec'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/initializable.rb:32:in `run'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /usr/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
	from /usr/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /usr/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /usr/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /usr/lib/ruby/2.5.0/tsort.rb:347:in `each'
	from /usr/lib/ruby/2.5.0/tsort.rb:347:in `call'
	from /usr/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
	from /usr/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
	from /usr/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/initializable.rb:60:in `run_initializers'
	from /usr/share/rubygems-integration/all/gems/railties-6.0.3.1/lib/rails/application.rb:363:in `initialize!'
	from /usr/share/gitlab/config/environment.rb:5:in `<top (required)>'
	from config.ru:19:in `require'
	from config.ru:19:in `block in <main>'
	from /usr/lib/ruby/vendor_ruby/rack/builder.rb:71:in `instance_eval'
	from /usr/lib/ruby/vendor_ruby/rack/builder.rb:71:in `initialize'
	from config.ru:1:in `new'
	from config.ru:1:in `<main>'
	from /usr/lib/ruby/vendor_ruby/unicorn.rb:54:in `eval'
	from /usr/lib/ruby/vendor_ruby/unicorn.rb:54:in `block in builder'
	from /usr/bin/unicorn_rails:139:in `block in rails_builder'
	from /usr/lib/ruby/vendor_ruby/unicorn/http_server.rb:794:in `build_app!'
	from /usr/lib/ruby/vendor_ruby/unicorn/http_server.rb:141:in `start'
	from /usr/bin/unicorn_rails:209:in `<main>'

Output of checks

(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		Debian 10
Current User:	gitlab
Using RVM:	no
Ruby Version:	2.5.5p157
Gem Version:	2.7.6.2
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
Bundler Version:1.17.3
Rake Version:	12.3.1
Redis Version:	6.0.5
Git Version:	2.26.2
Sidekiq Version:5.2.7
Go Version:	unknown

GitLab information
Version:	13.1.0
Revision:	Unknown
Directory:	/usr/share/gitlab
DB Adapter:	PostgreSQL
DB Version:	11.7
URL:		http://localhost
HTTP Clone URL:	http://localhost/some-group/some-project.git
SSH Clone URL:	gitlab@localhost:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	13.3.0
Repository storage paths:
- default: 	/var/lib/gitlab/repositories
GitLab Shell path:		/usr/share/gitlab-shell
Git:		/usr/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.3.0 ? ... OK (13.3.0) Running /usr/share/gitlab-shell/bin/check Internal API available: FAILED - Internal API unreachable gitlab-shell self-check failed Try fixing it: Make sure GitLab is running; Check the gitlab-shell configuration file: sudo -u gitlab -H editor /usr/share/gitlab-shell/config.yml Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... no Try fixing it: sudo -u gitlab -H RAILS_ENV=production bin/background_jobs start For more information see: doc/install/installation.md in section "Install Init Script" see log/sidekiq.log for possible errors Please fix the error above and rerun the checks.

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet) Init script exists? ... yes Init script up-to-date? ... yes Projects have namespace: ... Pirate Praveen / hello-test ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.5.5) Git version >= 2.22.0 ? ... yes (2.26.2) Git user has default SSH configuration? ... yes Active users: ... 1 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Possible fixes

Fix syntax for ruby 2.5 or move to ruby 2.7