Installation on openSUSE and SLES platforms warns about unknown key signature
Omnibus GitLab packages are
signed with GPG keys
in
addition to the package repositories providing signed metadata. This ensures
authenticity and integrity of the packages that are distributed to the users.
However, the package manager used in openSUSE and SLES operating systems may
sometime raise false warnings with these signatures, similar to
File 'repomd.xml' from repository 'gitlab_gitlab-ce' is signed with an unknown key '14219A96E15E78F4'. Continue? [yes/no] (no):
File 'repomd.xml' from repository 'gitlab_gitlab-ce' is signed with an unknown key '14219A96E15E78F4'. Continue? [yes/no] (no): yes
This is a known bug with zypper where zypper ignores the
gpgkey
keyword in the
repository configuration file. With later versions of Packagecloud, there may be
improvements regarding this, but currently users have to manually agree to
package installation.
So, in openSUSE or SLES systems, if such a warning is displayed, it is safe to
continue installation.
Try
specifying
an
external_url
in
/etc/gitlab/gitlab.rb
. Also check your firewall settings; port 80 (HTTP) or
443 (HTTPS) might be closed on your GitLab server.
Note that specifying the
external_url
for GitLab, or any other bundled service (Registry and
Mattermost) doesn’t follow the
key=value
format that other parts of
gitlab.rb
follow. Make sure
that you have them set in the following format:
There is a reported workaround described in
this issue
which requires editing the GitLab’ internal recipe by supplying the switch which ignores failures. Ignoring errors can have unexpected side effects on the performance of your GitLab server, so it isn’t recommended to do so.
Another variation of this error reports the file system is read-only and shows following stack trace:
* execute[load sysctl conf] action run
[execute] sysctl: setting key "kernel.shmall": Read-only file system
sysctl: setting key "kernel.shmmax": Read-only file system
================================================================================
Error executing action `run` on resource 'execute[load sysctl conf]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '255'
---- Begin output of cat /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -e -p - ----
STDOUT:
STDERR: sysctl: setting key "kernel.shmall": Read-only file system
sysctl: setting key "kernel.shmmax": Read-only file system
---- End output of cat /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -e -p - ----
Ran cat /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -e -p - returned 255
This error is also reported to occur in virtual machines only, and the recommended workaround is to set the values in the host. The values needed for GitLab can be found inside the file
/opt/gitlab/embedded/etc/90-omnibus-gitlab.conf
in the virtual machine. After setting these values in
/etc/sysctl.conf
file in the host OS, run
cat /etc/sysctl.conf /etc/sysctl.d/*.conf | sysctl -e -p -
on the host. Then try running
gitlab-ctl reconfigure
inside the virtual machine. It should detect that the kernel is already running with the necessary settings, and not raise any errors.
You may have to repeat this process for other lines. For example, reconfigure fails three times, after having added something like this to
/etc/sysctl.conf
:
You may find it easier to look at the line in the Chef output than to find the file (since the file
is different for each error). See the last line of this snippet.
* file[create /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmall.conf kernel.shmall] action create
- create new file /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmall.conf
- update content in file /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmall.conf from none to 6d765d
--- /opt/gitlab/embedded/etc/90-omnibus-gitlab-kernel.shmall.conf 2017-11-28 19:09:46.864364952 +0000
+++ /opt/gitlab/embedded/etc/.chef-90-omnibus-gitlab-kernel.shmall.conf kernel.shmall20171128-13622-sduqoj 2017-11-28 19:09:46.864364952 +0000
@@ -1 +1,2 @@
+kernel.shmall = 4194304
I am unable to install Omnibus GitLab without root access
In principle Omnibus GitLab could do with only 2 user accounts (one
for GitLab and one for Mattermost) if we give each application its own
runit (runsvdir), PostgreSQL and Redis process. But this would be a
major change in the
gitlab-ctl reconfigure
Chef code and it would
probably create major upgrade pain for all existing Omnibus GitLab
installations. (We would probably have to rearrange the directory
structure under
/var/opt/gitlab
.)
Tweaking the operating system for better performance
The GitLab web interface uses CSS and JavaScript files, called ‘assets’ in Ruby
on Rails-speak. In the
upstream GitLab repository
these files are stored in a developer-friendly way: easy to read and edit. When
you are a normal user of GitLab, you do not want these files to be in the
developer friendly format however because that makes GitLab slow. This is why
part of the GitLab setup process is to convert the assets from a
developer-friendly format to an end-user friendly (compact, fast) format; that
is what the
rake assets:precompile
script is for.
When you install GitLab from source (which was the only way to do it before we
had omnibus packages) you need to convert the assets on your GitLab server
every time you update GitLab. People used to overlook this step and there are
still posts, comments and mails out there on the internet where users recommend
each other to run
rake assets:precompile
(which has now been renamed
gitlab:assets:compile
). With the omnibus packages things are different: when
we build the package
we compile the assets for you
.
When you install GitLab with an omnibus package, the converted assets are
already there! That is why you do not need to run
rake assets:precompile
when
you install GitLab from a package.
When
gitlab-rake assets:precompile
fails with a permission error it fails for
a good reason from a security standpoint: the fact that the assets cannot
easily be rewritten makes it harder for an attacker to use your GitLab server
to serve evil JavaScript code to the visitors of your GitLab server.
If you want to run GitLab with custom JavaScript or CSS code you are probably
better off running GitLab from source, or building your own packages.
If you really know what you are doing,
you can execute
gitlab-rake gitlab:assets:compile
like this:
sudo NO_PRIVILEGE_DROP=true USE_DB=false gitlab-rake gitlab:assets:clean gitlab:assets:compile
# user and path might be different if you changed the defaults of# user['username'], user['group'] and gitlab_rails['dir'] in gitlab.rbsudo chown-R git:git /var/opt/gitlab/gitlab-rails/tmp/cache
Starting from GitLab 8.6,
GitLab requires
the PostgreSQL extension
pg_trgm
.
If you are using Omnibus GitLab package with the bundled database, the extension
should be automatically enabled when you upgrade.
If you however, are using an external (non-packaged) database, you will need to
enable the extension manually. The reason for this is that Omnibus GitLab
package with external database has no way of confirming if the extension exists,
and it also doesn’t have a way of enabling the extension.
To fix this issue, you’ll need to first install the
pg_trgm
extension.
The extension is located in the
postgresql-contrib
package. For Debian:
sudo apt-get install postgresql-contrib
Once the extension is installed, access the
psql
as superuser and enable the
extension.
Access
psql
as superuser:
sudo gitlab-psql -d gitlabhq_production
Enable the extension:
CREATE EXTENSION pg_trgm;
Now run migrations again:
sudo gitlab-rake db:migrate
If using Docker, you first need to access your container, then run the commands
above, and finally restart the container.
Access the container:
docker exec-it gitlab bash
Run the commands above
Restart the container:
docker restart gitlab
Errno::ENOMEM: Cannot allocate memory during backup or upgrade
GitLab requires
2GB of available memory to run without errors. Having 2GB of memory installed may
not be enough depending on the resource usage of other processes on your server.
If GitLab runs fine when not upgrading or running a backup, then adding more swap
should solve your problem. If you see the server using swap during normal usage,
you can add more RAM to improve performance.
NGINX error: ‘could not build server_names_hash, you should increase server_names_hash_bucket_size’
To fix this, users can make use of package['systemd_wanted_by'] and
package['systemd_after'] settings in gitlab.rb to specify values needed for
proper ordering and run sudo gitlab-ctl reconfigure. After reconfigure has
completed, restart gitlab-runsvdir service for changes to take effect.
sudo systemctl restart gitlab-runsvdir
Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2)
Pulp 2 or Satellite < 6.10 fails with "Malformed repository: metadata is specified for different set of packages in filelists.xml and in other.xml" error.
Satellite 6.10 fails with "pkgid" error.
Pulp 3 or Satellite > 6.10 seems to succeed, but only the repository metadata is synced.
These sync failures are caused by issues with the metadata in the GitLab yum
mirror repository. This metadata includes a filelists.xml.gz file that
normally includes a list of files for every RPM in the repository. The GitLab
yum repository leaves this file mostly empty to work around a size issue that
would be caused if the file was fully populated.
Each GitLab RPM contains an enormous number of files, which when multiplied by
the large number of RPMs in the repository, would result in a huge
filelists.xml.gz file if it was fully populated. Because of storage and build
constraints, we create the file but do not populate it. The empty file causes
Pulp and RedHat Satellite (which uses Pulp) repository mirroring of the file to
fail.
reposync
and createrepo to sync the GitLab
repository to the local mirror. This local mirror can then be used as a source
for Pulp or RedHat Satellite. You can use other tools like
Cobbler as well.
In this example:
The local mirror is running on a RHEL 8, Rocky 8, or AlmaLinux 8 system.
The host name used for the web-server is mirror.example.com.
If you didn't find what you were looking for,
search the docs
.
If you want help with something specific and could use community support,
post on the GitLab forum
.
For problems setting up or using this feature (depending on your GitLab
subscription).