gitlab install fails on missing gem file

Bug #1574349 reported by Olli-Pekka Wallin on 2016-04-24
132
This bug affects 31 people
Affects Status Importance Assigned to Milestone
gitlab (Ubuntu)
Undecided
Unassigned

Bug Description

sudo apt-get install gitlab

fails with missing gemfile :

Verifying we have all required libraries...
Could not find gem 'devise-two-factor (~> 2.0.0)' in any of the gem sources
listed in your Gemfile or available on this machine.
dpkg: error processing package gitlab (--configure):
 subprocess installed post-installation script returned error exit status 7
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Errors were encountered while processing:
 gitlab
E: Sub-process /usr/bin/dpkg returned an error code (1)

Server Os:

Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

Server installation

How to fix it ? Where is the Gemfile ?

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gitlab (Ubuntu):
status: New → Confirmed
Flaviu (flaviu-r) wrote :

The gem 'devise-two-factor' is installed but it is not identified by gitlab setup.

Ho Yang (yeticry) wrote :

Workaround:

1. cd /usr/share/gitlab/

2. bundler

you may need install some package first: sudo apt-get install cmake libmysqlclient-dev automake autoconf autogen

Ho Yang (yeticry) wrote :

3. sudo apt-get install gitlab

this will reconfigure gitlab package

Jose L Zabalza (jlz-3008) wrote :

You must install pkg-config package too.

But now another error on [3] step.

$ sudo apt-get install gitlab

...

Using devise-two-factor 2.0.1
Bundle complete! 121 Gemfile dependencies, 261 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Running final rake tasks and tweaks...
Creating secrets.yml...
Initializing database...
fatal: Not a git repository (or any of the parent directories): .git
-- enable_extension("plpgsql")
   -> 0.0093s
-- create_table("abuse_reports", {:force=>:cascade})
   -> 0.0070s
-- create_table("appearances", {:force=>:cascade})

....

- add_index("users_star_projects", ["user_id"], {:name=>"index_users_star_projects_on_user_id", :using=>:btree})
   -> 0.0026s
-- create_table("web_hooks", {:force=>:cascade})
   -> 0.0059s
-- add_index("web_hooks", ["created_at", "id"], {:name=>"index_web_hooks_on_created_at_and_id", :using=>:btree})
   -> 0.0029s
-- add_index("web_hooks", ["project_id"], {:name=>"index_web_hooks_on_project_id", :using=>:btree})
   -> 0.0025s
-- initialize_schema_migrations_table()
   -> 0.0061s
fatal: Not a git repository (or any of the parent directories): .git

== Seed from /usr/share/gitlab/db/fixtures/production/001_admin.rb

Administrator account created:

login.........root
password......5iveL!fe
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
fatal: Not a git repository (or any of the parent directories): .git
mkdir -p /var/lib/gitlab/repositories/: OK
mkdir -p /var/lib/gitlab/.ssh: OK
chmod 700 /var/lib/gitlab/.ssh: OK
touch /var/lib/gitlab/.ssh/authorized_keys: OK
chmod 600 /var/lib/gitlab/.ssh/authorized_keys: OK
chmod ug+rwX,o-rwx /var/lib/gitlab/repositories/: OK
Precompiling assets...
fatal: Not a git repository (or any of the parent directories): .git
I, [2016-05-04T16:07:00.221066 #9140] INFO -- : Writing /usr/share/gitlab/public/assets/print-6939eb32d7a168d8fe54b11c4873498ba343870a6f7d2eb15147f7035a0154e2.css
I, [2016-05-04T16:07:00.223750 #9140] INFO -- : Writing /usr/share/gitlab/public/assets/select2-9e7107dd0b2c552720713e261db7148d19877ccea717d7f4823c7471cd1cdee3.png

...

I, [2016-05-04T16:07:57.258267 #9140] INFO -- : Writing /usr/share/gitlab/public/assets/bootstrap/glyphicons-halflings-regular-42f60659d265c1a3c30f9fa42abcbb56bd4a53af4d83d316d6dd7a36903c43e5.svg
I, [2016-05-04T16:07:57.260178 #9140] INFO -- : Writing /usr/share/gitlab/public/assets/bootstrap/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf
I, [2016-05-04T16:07:57.262032 #9140] INFO -- : Writing /usr/share/gitlab/public/assets/bootstrap/glyphicons-halflings-regular-a26394f7ede100ca118eff2eda08596275a9839b959c226e15439557a5a80742.woff
I, [2016-05-04T16:07:57.263734 #9140] INFO -- : Writing /usr/share/gitlab/public/assets/bootstrap/glyphicons-halflings-regular-fe185d11a49676890d47bb783312a0cda5a44c4039214094e7957b4c040ef11c.woff2
Failed to start gitlab.target: Unit gitlab.target is masked.
dpkg: error processing gitlab package (--configure):

Jose L Zabalza (jlz-3008) wrote :

Note: /usr/share/gitlab owner is root:root so if you execute bundler as user you get a permission error

There was an error while trying to write to '/usr/share/gitlab/Gemfile.lock'

So I execute bundler with sudo

pawelwiejkut (poczta-y) wrote :

Hi guys,

After this, i have this error:

Using devise-async 0.9.0
Using devise-two-factor 2.0.1
Bundle complete! 121 Gemfile dependencies, 261 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Running final rake tasks and tweaks...
Creating secrets.yml...
Initializing database...
Missing `db_key_base` for 'production' environment. The secrets will be generated and stored in `config/secrets.yml`
fatal: Not a git repository (or any of the parent directories): .git
D, [2016-05-10T17:37:37.486540 #21054] DEBUG -- : ** [Raven] Event not sent due to excluded environment: production
rake aborted!
Errno::EACCES: Permission denied @ rb_sysopen - config/secrets.yml
/usr/share/gitlab/config/initializers/secret_token.rb:45:in `initialize'
/usr/share/gitlab/config/initializers/secret_token.rb:45:in `open'
/usr/share/gitlab/config/initializers/secret_token.rb:45:in `<top (required)>'
/usr/share/gitlab/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:schema:load => environment
(See full trace by running task with --trace)
dpkg: błąd przetwarzania pakietu gitlab (--configure):
 podproces zainstalowany skrypt post-installation zwrócił kod błędu 1
Wystąpiły błędy podczas przetwarzania:
 gitlab
E: Sub-process /usr/bin/dpkg returned an error code (1)

Is any solution for this ?

giso (giso-osig) wrote :

Hi Folks,

do we have some new info here?

I have the same problem.

Best
Giso

Olli-Pekka Wallin (hozmaster) wrote :

gitlab will be released new version with with 2.3 ruby support in few days now on. however, you should Onmibus version from gitlab CE until functional gitlab is distributed to Xenial.

Paulo Almeida (palmeida) wrote :

I had the same problem and eventually got it installed by following the tips in these comments. I also unmasked gitlab.target and other gitlab services, as suggested in a Debian bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820991

Lepe (alepe-com) wrote :
Download full text (3.4 KiB)

Using a fresh install of Ubuntu Xenial 64bits (as LXD container).

After the installation failed, I followed the recommended steps here, but `bundler` failed with: "An error occurred while installing eventmachine (1.2.1), and Bundler cannot continue."

I installed the following packages and `bundler` finished without errors (probably the *-dev packages are not required):

apt install ruby-dev zlib1g-dev liblzma-dev build-essential patch pkg-config

After that, gitlab was able to continue the installation, but it fails again with this error:

fatal: Not a git repository (or any of the parent directories): .git
rake aborted!
ExecJS::RuntimeError:
(execjs):1
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/uglifier_compressor.rb:52:in `call'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/uglifier_compressor.rb:28:in `call'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/processor_utils.rb:75:in `call_processor'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/processor_utils.rb:56:in `call_processors'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/loader.rb:60:in `block in load'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/loader.rb:44:in `load'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/cached_environment.rb:47:in `load'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/base.rb:66:in `find_asset'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/manifest.rb:138:in `block in find'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/path_utils.rb:223:in `block in stat_tree'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/path_utils.rb:207:in `block in stat_directory'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/path_utils.rb:204:in `each'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/path_utils.rb:204:in `stat_directory'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/path_utils.rb:222:in `stat_tree'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/legacy.rb:105:in `each'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/legacy.rb:104:in `each'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/legacy.rb:104:in `logical_paths'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/manifest.rb:136:in `find'
/var/lib/gems/2.3.0/gems/sprockets-3.3.5/lib/sprockets/manifest.rb:162:in `compile'
/var/lib/gems/2.3.0/gems/rake-12.0.0/exe/rake:27:...

Read more...

David Banks (amoe) wrote :

This is a pretty serious bug: it's in an LTS release, breaks a completely clean install, and the workarounds involve going around the package manager and negating the distribution. According to the effective 'upstream' -- Debian's Pirate Praveen -- it's been fixed since his -dfsg10 version. So potentially all it would need is a sync of this Debian minor version to resolve this.

Emil Madsen (skeen) wrote :

I agree strongly with David Banks.

Fleish (lasnchpad) wrote :

What a cluster. I agree with the previous two comments this is a serious bug that exists even when you follow https://about.gitlab.com/installation/#ubuntu to the letter. How is this bug still open 2.5 years later?

Fleish (lasnchpad) wrote :

Quick note - I realized later that the omnibus installer means for you to install the "gitlab-ee" package even if you don't plan to purchase the enterprise license and will be using the community edition. I didn't realize the different package name and was assuming the "gitlab" package came from their official repo and was the current community edition version vs. an old version 8 package that is still distributed with Ubuntu. I'd recommend the maintainers just pull their package from Ubuntu so that everyone goes the omnibus route which is clearly what they want everyone to use.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.