kontena / pharos-cluster

Pharos - The Kubernetes Distribution
https://k8spharos.dev/
Apache License 2.0
311 stars 43 forks source link

dpkg: error: dpkg status database is locked by another process #515

Closed SpComb closed 6 years ago

SpComb commented 6 years ago

Happens randomly during the Configure kubelet phase:

 [Configure kubelet @ 206.189.0.173] Pharos::SSH::RemoteCommand::ExecError: SSH exec failed with code 100: install-kube-packages.sh
+ set -e
+ export DEBIAN_FRONTEND=noninteractive
+ apt-mark unhold kubelet kubectl kubeadm
dpkg: error: dpkg status database is locked by another process
E: Sub-process dpkg --set-selections returned an error code (2)
E: Executing dpkg failed. Are you root?

Most likely caused by earlier apt-get update/install triggering the /etc/apt/apt.conf.d/99update-notifier APT::Update::Post-Invoke-Success or DPkg::Post-Invoke hook => /usr/lib/update-notifier/update-motd-updates-available which runs /usr/lib/update-notifier/apt-check... that locks the dpkg database for a couple seconds in between the apt-get update and apt-mark?

SpComb commented 6 years ago

This can probably be considered fixed by #512

==> Configure kubelet @ terom-pharos-master terom-xenial-test terom-bionic-test terom-centos-test
    [terom-pharos-master] Configuring Kubernetes packages ...
    [terom-pharos-master] got error (Pharos::SSH::RemoteCommand::ExecError): SSH exec failed with code 100: install-kube-packages.sh
+ set -e
+ export DEBIAN_FRONTEND=noninteractive
+ apt-mark unhold kubelet kubectl kubeadm
dpkg: error: dpkg status database is locked by another process
E: Sub-process dpkg --set-selections returned an error code (2)
E: Executing dpkg failed. Are you root?
    [terom-pharos-master] retrying after 1 seconds ...
    [terom-xenial-test] Configuring Kubernetes packages ...
    [terom-bionic-test] Configuring Kubernetes packages ...
    [terom-pharos-master] Configuring Kubernetes packages ...
    [terom-xenial-test] got error (Pharos::SSH::RemoteCommand::ExecError): SSH exec failed with code 100: install-kube-packages.sh
+ set -e
+ export DEBIAN_FRONTEND=noninteractive
+ apt-mark unhold kubelet kubectl kubeadm
dpkg: error: dpkg status database is locked by another process
E: Sub-process dpkg --set-selections returned an error code (2)
E: Executing dpkg failed. Are you root?
    [terom-xenial-test] retrying after 1 seconds ...
    [terom-bionic-test] Configuring kubelet ...
    [terom-xenial-test] Configuring Kubernetes packages ...
    [terom-xenial-test] Configuring kubelet ...
    [terom-pharos-master] Configuring kubelet ...

    [terom-centos-test] Configuring Kubernetes packages ...
    [terom-centos-test] Configuring kubelet ...