shopwareArchive / shopware-platform-vagrant

DEPRECATED: A Vagrant setup ready for shopware platform development
22 stars 14 forks source link

Provisioning is broken #3

Closed ascheider closed 5 years ago

ascheider commented 5 years ago

System: macOS Mojave 10.14.5 Provisioning of the vagrant box does not work anymore. Output on vagrant up or vagrant provision:

==> default: Running provisioner: ansible_local... default: Installing Ansible... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! add-apt-repository ppa:ansible/ansible -y && apt-get update -y -qq && apt-get install -y -qq ansible Stdout from the command: Get:1 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic InRelease [15.9 kB] Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease Get:4 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main amd64 Packages [528 B] Get:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:6 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main i386 Packages [528 B] Get:7 http://ppa.launchpad.net/ansible/ansible/ubuntu bionic/main Translation-en [344 B] Get:8 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages [331 kB] Get:9 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [548 kB] Get:11 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [434 kB] Get:12 http://security.ubuntu.com/ubuntu bionic-security/main Translation-en [152 kB] Get:13 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [4,296 B] Get:14 http://security.ubuntu.com/ubuntu bionic-security/restricted i386 Packages [4,280 B] Get:15 http://security.ubuntu.com/ubuntu bionic-security/restricted Translation-en [2,192 B] Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages [562 kB] Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [568 kB] Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [663 kB] Get:19 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [184 kB] Get:20 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [4,008 B] Get:21 http://security.ubuntu.com/ubuntu bionic-security/multiverse i386 Packages [4,152 B] Get:22 http://security.ubuntu.com/ubuntu bionic-security/multiverse Translation-en [2,060 B] Get:23 http://archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [245 kB] Get:24 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [6,996 B] Get:25 http://archive.ubuntu.com/ubuntu bionic-updates/restricted i386 Packages [6,960 B] Get:26 http://archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [945 kB] Get:27 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [961 kB] Get:28 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [284 kB] Get:29 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [6,644 B] Get:30 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages [6,792 B] Get:31 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [3,556 B] Get:32 http://archive.ubuntu.com/ubuntu bionic-backports/main i386 Packages [2,516 B] Get:33 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [2,512 B] Get:34 http://archive.ubuntu.com/ubuntu bionic-backports/main Translation-en [1,644 B] Get:35 http://archive.ubuntu.com/ubuntu bionic-backports/universe i386 Packages [3,740 B] Get:36 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3,736 B] Get:37 http://archive.ubuntu.com/ubuntu bionic-backports/universe Translation-en [1,696 B] Fetched 6,215 kB in 3s (1,872 kB/s) Reading package lists... (Reading database ... 42086 files and directories currently installed.) Preparing to unpack .../00-libssl-dev_1.1.1-1ubuntu2.1~18.04.3_amd64.deb ... Unpacking libssl-dev:amd64 (1.1.1-1ubuntu2.1~18.04.3) over (1.1.0g-2ubuntu4.3) ... Preparing to unpack .../01-libssl1.1_1.1.1-1ubuntu2.1~18.04.3_amd64.deb ... Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.3) over (1.1.0g-2ubuntu4.3) ... Selecting previously unselected package python-markupsafe. Preparing to unpack .../02-python-markupsafe_1.0-1build1_amd64.deb ... Unpacking python-markupsafe (1.0-1build1) ... Selecting previously unselected package python-jinja2. Preparing to unpack .../03-python-jinja2_2.10-1ubuntu0.18.04.1_all.deb ... Unpacking python-jinja2 (2.10-1ubuntu0.18.04.1) ... Selecting previously unselected package python-yaml. Preparing to unpack .../04-python-yaml_3.12-1build2_amd64.deb ... Unpacking python-yaml (3.12-1build2) ... Selecting previously unselected package python-asn1crypto. Preparing to unpack .../05-python-asn1crypto_0.24.0-1_all.deb ... Unpacking python-asn1crypto (0.24.0-1) ... Selecting previously unselected package python-cffi-backend. Preparing to unpack .../06-python-cffi-backend_1.11.5-1_amd64.deb ... Unpacking python-cffi-backend (1.11.5-1) ... Selecting previously unselected package python-enum34. Preparing to unpack .../07-python-enum34_1.1.6-2_all.deb ... Unpacking python-enum34 (1.1.6-2) ... Selecting previously unselected package python-idna. Preparing to unpack .../08-python-idna_2.6-1_all.deb ... Unpacking python-idna (2.6-1) ... Selecting previously unselected package python-ipaddress. Preparing to unpack .../09-python-ipaddress_1.0.17-1_all.deb ... Unpacking python-ipaddress (1.0.17-1) ... Selecting previously unselected package python-six. Preparing to unpack .../10-python-six_1.11.0-2_all.deb ... Unpacking python-six (1.11.0-2) ... Selecting previously unselected package python-cryptography. Preparing to unpack .../11-python-cryptography_2.1.4-1ubuntu1.3_amd64.deb ... Unpacking python-cryptography (2.1.4-1ubuntu1.3) ... Selecting previously unselected package python-pyasn1. Preparing to unpack .../12-python-pyasn1_0.4.2-3_all.deb ... Unpacking python-pyasn1 (0.4.2-3) ... Selecting previously unselected package python-paramiko. Preparing to unpack .../13-python-paramiko_2.0.0-1ubuntu1.2_all.deb ... Unpacking python-paramiko (2.0.0-1ubuntu1.2) ... Selecting previously unselected package python-httplib2. Preparing to unpack .../14-python-httplib2_0.9.2+dfsg-1ubuntu0.1_all.deb ... Unpacking python-httplib2 (0.9.2+dfsg-1ubuntu0.1) ... Selecting previously unselected package python-pkg-resources. Preparing to unpack .../15-python-pkg-resources_39.0.1-2_all.deb ... Unpacking python-pkg-resources (39.0.1-2) ... Selecting previously unselected package python-setuptools. Preparing to unpack .../16-python-setuptools_39.0.1-2_all.deb ... Unpacking python-setuptools (39.0.1-2) ... Selecting previously unselected package sshpass. Preparing to unpack .../17-sshpass_1.06-1_amd64.deb ... Unpacking sshpass (1.06-1) ... Selecting previously unselected package ansible. Preparing to unpack .../18-ansible_2.8.1-1ppa~bionic_all.deb ... Unpacking ansible (2.8.1-1ppa~bionic) ... Setting up python-idna (2.6-1) ... Setting up python-yaml (3.12-1build2) ... Setting up python-asn1crypto (0.24.0-1) ... Setting up python-pyasn1 (0.4.2-3) ... Setting up python-pkg-resources (39.0.1-2) ... Setting up python-markupsafe (1.0-1build1) ... Setting up python-httplib2 (0.9.2+dfsg-1ubuntu0.1) ... Setting up python-cffi-backend (1.11.5-1) ... Setting up python-six (1.11.0-2) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... Setting up sshpass (1.06-1) ... Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.3) ... Checking for services that may need to be restarted...done. Checking for services that may need to be restarted...done. Checking init scripts... dpkg: error processing package libssl1.1:amd64 (--configure): installed libssl1.1:amd64 package post-installation script subprocess returned error exit status 10 Setting up python-enum34 (1.1.6-2) ... dpkg: dependency problems prevent configuration of python-cryptography: python-cryptography depends on libssl1.1 (>= 1.1.1); however: Package libssl1.1:amd64 is not configured yet.

dpkg: error processing package python-cryptography (--configure): dependency problems - leaving unconfigured Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Setting up python-ipaddress (1.0.17-1) ... Setting up python-setuptools (39.0.1-2) ... Setting up python-jinja2 (2.10-1ubuntu0.18.04.1) ... dpkg: dependency problems prevent configuration of libssl-dev:amd64: libssl-dev:amd64 depends on libssl1.1 (= 1.1.1-1ubuntu2.1~18.04.3); however: Package libssl1.1:amd64 is not configured yet.

dpkg: error processing package libssl-dev:amd64 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python-paramiko: python-paramiko depends on python-cryptography (>= 1.1); however: Package python-cryptography is not configured yet.

dpkg: error processing package python-paramiko (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of ansible: ansible depends on python-paramiko; however: Package python-paramiko is not configured yet. ansible depends on python-cryptography; however: Package python-cryptography is not configured yet.

dpkg: error processing package ansible (--configure): dependency problems - leaving unconfigured Processing triggers for libc-bin (2.27-3ubuntu1) ... Errors were encountered while processing: libssl1.1:amd64 python-cryptography libssl-dev:amd64 python-paramiko ansible

Stderr from the command:

dpkg-preconfigure: unable to re-open stdin: No such file or directory No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already E: Sub-process /usr/bin/dpkg returned an error code (1)

Gugiman commented 5 years ago

can confirm on Ubuntu 18.04 and Vagrant version 2.2.5

ascheider commented 5 years ago

@Gugiman please try to change the line 15 in ansible/roles/common/tasks/main.yml from upgrade: full to upgrade: dist. It worked for me.

mitelg commented 5 years ago

@f0x7C0 could you confirm this issue and fix it please? :blush: :+1:

flohessling commented 5 years ago

In my case the bento/ubuntu-18.04 box was missing updates and therefore the ansible installation inside the box fails. The apt update is performed after ansible installation when using ansible_local provisioning. Keep in mind, that the box is cached locally and not pulled everytime you perform vagrant destroy and vagrant up. There should be output after performing vagrant up that informs about and old version of the box.

Output: ==> default: A newer version of the box 'bento/ubuntu-18.04' for provider 'virtualbox' is ==> default: available! You currently have version '201812.27.0'. The latest is version ==> default: '201906.18.0'. Run vagrant box update to update.

After destroying and updating the box the issue was fixed for me and the provisioning worked again.

flohessling commented 5 years ago

This is the error, that is causing the ansible installation to fail: installed libssl1.1:amd64 package post-installation script subprocess returned error exit status 10

audaki commented 5 years ago

I don't understand why this was closed without a fix. It's kinda industry standard to fix the problem of provisioners running on outdated packages by doing a dist-upgrade pre-provision. I've attached a pull-request for this, otherwise your users could run into problems every day and be forced to redownload the whole linux image multiple times.

PS: Often the linux base images aren't up-to-date, even right now I've just downloaded the box and it has 53 updates open, so your users might even run into a situation where not even deleting and redownloading the base image would help without doing a pre-provision dist-upgrade.

flohessling commented 5 years ago

Thank you for your contribution, audaki! I've merged your pull-request and included the pre-provision update in the Vagrantfile.