Failed web Discourse upgrade. Web docker upgrade worked

AI-generated summary

The user GetReadyMan experienced issues with a failed web Discourse upgrade, while the web Docker upgrade was successful. The error message indicated that Docker version 19.03.13 is not supported, and an upgrade to at least 20.10.0 is required.

Canapin provided links to relevant topics on the Discourse forum, which may help resolve the issue. GetReadyMan attempted to update the operating system but encountered a lock file issue, where the process 10528 (apt-get) was holding the lock.

The solution, provided by GetReadyMan, involved force killing the stuck process, removing lock files, reconfiguring the package database, and retrying the update. The steps to fix the issue include checking for running apt processes, waiting for the process to finish or force killing it, removing lock files, reconfiguring the package database, and retrying the update. Additionally, disabling unattended upgrades may be necessary to prevent future conflicts.

The web version of the Docker update worked, The web version of the Discourse update failed.
I reset the failed update, but the web application said the update was in progress.

Went to try to update Discourse manually
cd /var/discourse
./launcher rebuild app

Got the following error.
ERROR: Docker version 19.03.13 not supported,please upgrade to at least 20.10.0, or recommend 24.0.7

I tried to upgrade the Docker manually:
wget -qO- https://get.docker.com/ | sh

and got the following error:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is being held by process 10528 (apt-get)
E: Unable to aquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

My discourse website is down with an Oops-Error 500
Any thoughts?

There are a few topics about this docker version error:

Coin, Thanks for the pointers to the topics!

I get the Docker version as 19.03.13. I then go to update the opertaing system with

sudo apt update && sudo apt upgrade -y 3

and the update gets stuck at…

Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 10528 (apt-get)… 454s

with the number of seconds increasing.

Here’s the fix from ChatGPT. The key was to force kill the stuck process in step 3.

The error indicates that another apt or package management process is already running and holding the lock file /var/lib/dpkg/lock-frontend. This situation prevents your apt command from proceeding. Here’s how to resolve the issue:

Steps to Fix the Issue

  1. Check for Running apt Processes
    Run the following command to check for other apt processes:

    ps aux | grep apt
    

    Look for processes like apt-get, apt, or dpkg. If there’s a process running (e.g., apt-get or dpkg), it might be updating or installing something in the background.

  2. Wait for the Process to Finish
    If another process is genuinely running, it’s best to wait for it to complete. Sometimes, unattended upgrades or package installations run in the background.

  3. Force Kill the Stuck Process
    If the process has been running for an abnormally long time, you can terminate it:

    sudo kill -9 <PID>
    

    Replace <PID> with the process ID (e.g., 10528 in your case).

  4. Remove Lock Files
    After killing the process, remove the lock files to ensure no stale locks exist:

    sudo rm /var/lib/dpkg/lock-frontend
    sudo rm /var/lib/dpkg/lock
    
  5. Reconfigure the Package Database
    Run this command to fix any potential issues with the package manager:

    sudo dpkg --configure -a
    
  6. Retry the Update
    Now, retry your update command:

    sudo apt update && sudo apt upgrade -y
    

Notes

  • If this issue occurs frequently, check if unattended upgrades or automated updates are running in the background. These can cause conflicts when manually managing packages.
  • To disable unattended upgrades, you can run:
    sudo systemctl disable --now unattended-upgrades