geerlingguy / ansible-role-gitlab

Ansible Role - GitLab

Home Page:https://galaxy.ansible.com/geerlingguy/gitlab/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gnupg2 install breaks Ubuntu LTS

lod opened this issue · comments

The addition of gnupg2 in commit 7a53c53 breaks Ubuntu 18.04, the current Ubuntu LTS

Ubuntu 18.04 does not have this package

Pinning to the 2.5.2 as a workaround seems to work fine, but is obviously not ideal

Also impacts the docker role geerlingguy/ansible-role-docker#195

@lod - I added it to fix some issues with Debian 10, and in my own local tests in both a Docker container with a minimal install as well as in a VirtualBox VM with the Ubuntu server install, I haven't had any issues. Can you provide more information about what task, in particular, is failing, along with any associated error messages?

I am getting the same error while running in AWS Ubuntu instance (Ubuntu Server 18.04 LTS (HVM))
Install Gitlab Task is failing
.. Its a really long error message:
fatal: [3.91.181.237]: FAILED! => {"cache_update_time": 1594946904, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" install 'gitlab-ce'' failed: E: Sub-process /usr/bin/dpkg returned an error code (1)\n", "rc": 100, "stderr": "E: Sub-process /usr/bin/dpkg returned an error code (1)\n", "stderr_lines": ["E: Sub-process /usr/bin/dpkg returned an error code (1)"], "stdout": "Reading package lists...\nBuilding dependency tree...\

GitLab requires UTF-8 encoding to function properly. Please check your locale settings.", "", "Running handlers complete", "\u001b[0mChef Client failed. 377 resources updated in 02 minutes 14 seconds\u001b[0m", "", "Warnings:", "Environment variable LC_ALL specifies a non-UTF-8 locale. GitLab requires UTF-8 encoding to function properly. Please check your locale settings.", "", "dpkg: error processing package gitlab-ce (--configure):", " installed gitlab-ce package post-installation script subprocess returned error exit status 1"]}

@npandeya - It looks like that's an unrelated issue: see the warnings:

GitLab requires UTF-8 encoding to function properly. Please check your locale settings.
...
Environment variable LC_ALL specifies a non-UTF-8 locale. GitLab requires UTF-8 encoding to function properly. Please check your locale settings.

That looks like an environment issue on your server.

commented

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

gnupg2 fails to install on Ubuntu 20.04 LTS as well, with this error:

TASK [gitlab : Install GitLab dependencies (Debian).] **************************************************************************************************************
fatal: [10.10.11.177]: FAILED! => {"changed": false, "msg": "No package matching 'gnupg2' is available"}

OS info:

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

I'm using the latest master (cb5981d).

The workaround of running update_cache=yes as noted in geerlingguy/ansible-role-docker#195 works for me fyi.

commented

This issue is no longer marked for closure.

@snobear - It seems if that workaround works, the best option may be to add a task in your playbook that updates the apt caches. I don't like doing that in my roles because if I had 8 roles with each one updating caches as it went, playbooks would be very slow.

@geerlingguy yeah makes sense. Running a cache update before this gitlab playbook is run does the trick. I put this as a pre task in my playbook, e.g.

  pre_tasks:
    - name: Update apt-get repo and cache
      apt: update_cache=yes force_apt_get=yes cache_valid_time=3600

Going to close this for now; please use that option if you run into this issue.