Bug of Virtualmin version 7.30.2

SYSTEM INFORMATION
OS type and version Rocky Linux 8.10
Webmin version 2.202
Virtualmin version 7.30.2
Webserver version 2.4.37
Related packages wbm-virtual-server

After upgrading to Virtualmin v7.30.2 , it shows me the error message below when I click “System Settings → Re-Check Configuration”. In last upgrade, it could work without the problem below. I do NOT change anything before upgrading to v7.30.2.

When I click “System Settings → Features and Plugins”, all features are already enabled with no change. When I try to click the “Save” button, it also shows me the SAME error message below.

When I try this command “virtualmin set-global-feature --enable-feature ssl” under console, it also shows me the SAME error message below.

The status of your system is being checked to ensure that all enabled features are available and properly configured …

The plugin MyDomain1.com, MyDomain2.com … Other My Domains cannot be disabled, as it is used by the following virtual servers : $2
… your system is not ready for use by Virtualmin

How can I fix this problem ?
Thanks !.

Hello,

If you compare the /etc/webmin/virtual-server/config and /etc/webmin/virtual-server/last-config files, are they significantly different? If so, try replacing the former with the latter and re-run the config check.

People Hi,
same issue on Debian 11 after latest upgrade to
Virtualmin version 7.30.2 Pro,
Discovered only today after adding with new domain, cant change php version, for some domains PHP script execution mode is disabled , for others can change PHP version from 5.6 to 8.4

The plugin domain1.com, domain2, …, domain3.com cannot be disabled, as it is used by the following virtual servers : $2
Checked /etc/webmin/virtual-server/config and /etc/webmin/virtual-server/last-config and replaced in both ways/sides nothing changes … The error message still the same…
Little help please to fix this issue
Thank you in advance

If you list virtual server, and in the settings show the php version does that show anything weird.
I can’t reproduce that error. Seems like a old deleted server wasn’t deleted properly maybe the fact its displaying a $2 not the virtual servers same.
I think staff maybe the only ones that can help here.
Are both server very old, the fact you talking about php5.6 seem like it is.

Hello
Thank you for your reply.
This is how I see my listed servers
For some domains PHP script execution mode is disabled or missing ??? , for others can change PHP version …
Even more …
sudo apachectl configtest
Syntax OK

virtualmin validate-domains --all-domains --feature web
domain.com
All features are good
subdomain.domain.com
Apache website : No Apache virtual host for subdomain.domain.com found

OK, deleted those subdomains and domains with “No Apache virtual host” then …
virtualmin check-config
ERROR: The plugin domain.com, subdomain.domain.com, cannot be disabled, as it is used by the following virtual servers : $2
What this can be?
Thank you in advance

Just updated Debian 10 > Debian 11 (i know, dist upgrade could fail).

I’m also getting the same The plugin (domains...) cannot be disabled, as it is used by the following virtual servers : $2

I didn’t get the error with sudo apt upgrade --without-new-pkgs, but after sudo apt full-upgrade and reboot.

Just to report here.

I asked a AI to create a compare-script, to compare the files.

Remember to chmod +x the script, before executing it. Start with: ./compare-files.sh /etc/webmin/virtual-server/config /etc/webmin/virtual-server/last-config.

Compare 'config' with 'last-config'
#!/bin/bash

# Function to parse a file into an associative array
parse_file() {
  local file=$1
  declare -A params

  # Read the file line by line and populate the associative array
  while IFS='=' read -r key value; do
    # Remove leading and trailing spaces from the key and value
    key=$(echo "$key" | xargs)
    value=$(echo "$value" | xargs)

    # Handle the case where the value is an empty string (e.g., "key=")
    if [[ -z "$value" ]]; then
      value=""
    fi

    # Store the key-value pair in the associative array
    params["$key"]="$value"
  done < "$file"

  # Return the associative array keys and values
  echo "${!params[@]}" "${params[@]}"
  # Return the associative array keys and values
}

# Compare two files
compare_files() {
  local file1=$1
  local file2=$2

  # Parse both files and store their key-value pairs in associative arrays
  declare -A params1 params2

  # Read key-value pairs from file1
  while IFS='=' read -r key value; do
    key=$(echo "$key" | xargs)
    value=$(echo "$value" | xargs)
    
    # Handle the case where the value is empty (e.g., "key=")
    if [[ -z "$value" ]]; then
      value=""
    fi

    params1["$key"]="$value"
  done < "$file1"

  # Read key-value pairs from file2
  while IFS='=' read -r key value; do
    key=$(echo "$key" | xargs)
    value=$(echo "$value" | xargs)

    # Handle the case where the value is empty (e.g., "key=")
    if [[ -z "$value" ]]; then
      value=""
    fi

    params2["$key"]="$value"
  done < "$file2"

  # Compare the two associative arrays
  # Check for keys in file1 that are missing in file2 or have different values
  for key in "${!params1[@]}"; do
    if [[ -z "${params2[$key]}" && "${params1[$key]}" != "" ]]; then
      echo "Key '$key' is missing in the second file."
    elif [[ "${params1[$key]}" != "${params2[$key]}" ]]; then
      echo "Mismatch for '$key': '${params1[$key]}' (file1) vs '${params2[$key]}' (file2)"
    fi
  done

  # Check for extra keys in file2 that are missing in file1
  for key in "${!params2[@]}"; do
    if [[ -z "${params1[$key]}" && "${params2[$key]}" != "" ]]; then
      echo "Key '$key' is missing in the first file."
    fi
  done
}

# Call the compare_files function with two file paths
compare_files "$1" "$2"

Here’s the difference:

Key 'single_tx' is missing in the second file.
Key 'cgimode' is missing in the second file.
Key 'show_dbs' is missing in the second file.
Key 'proftpd_ssl' is missing in the second file.
Key 'allow_numbers' is missing in the second file.
Key 'show_domains_lastlogin' is missing in the second file.
Key 'err_letsencrypt' is missing in the second file.
Key 'dynip_update' is missing in the second file.
Mismatch for 'last_letsencrypt_mass_renewal': '1734714306' (file1) vs '1680084005' (file2)
Key 'letsencrypt_retry' is missing in the second file.
Key 'dns_secany' is missing in the second file.
Key 'default_domain_ssl' is missing in the second file.
Key 'show_plugins' is missing in the second file.
Key 'avail_logviewer' is missing in the second file.
Mismatch for 'last_check_php_vers': '7.3 8.2 8.3' (file1) vs '7.3 8.2' (file2)
Key 'web_http2' is missing in the second file.
Key 'mysql_ssl' is missing in the second file.
Key 'json_pretty' is missing in the second file.

But I’m not sure how to continue from here. Maybe @Ilia can use the difference for anything useful.

Other info:

> virtualmin validate-domains --all-domains --feature web
(domain)
    All features are good
(domain)
    All features are good
(domain)
    All features are good
(domain)
    All features are good
(domain)
    All features are good
(domain)
    All features are good
(domain)
    All features are good

> sudo apachectl configtest
Syntax OK

> virtualmin check-config

ERROR: The plugin domain, domain, domain cannot be disabled, as it is used by the following virtual servers : $2

If I compare one of the domains listed in the error, with one of the ones, not listed in the error, they:

  • Share the same PHP information

But the following features are enabled on the domain, which are flagged as failed:

  • Mail for domain
  • Spam filtering
  • Virus filtering

So I disabled “Mail for domain” + Spam filtering + Virus filtering, and executed the check-config again, but it’s still listed.

I opened Manage Virtual Server > SSL Certificate > SSL Providers, and here I noticed that the “good domain” had two domains listed in “Domains names listed here” below “Request certificate for”, instead of the default “Domains associated with this server”.

So, for one of the ERROR marked domains, I requested a certificate.

But, it’s still the same situation.

So, just to see what happen, I disabled one of the ERROR marked domains. But, nothing changed.

I’m simply unable to tell, why only three domains are listed as problematic domains.

1 Like

Thank you for the excellent bug report! It’s much appreciated!

Mismatch for ‘last_letsencrypt_mass_renewal’: ‘1734714306’ (file1) vs ‘1680084005’ (file2)

I submitted a new set of patches yesterday, where file locking didn’t occur correctly, potentially leading to this kind of issue.

But I’m not sure how to continue from here.

Just replace /etc/webmin/virtual-server/config with /etc/webmin/virtual-server/last-config, and that’s all.

1 Like

I’ve replaced the file, and restarted Webmin.

I don’t see the blue text anymore, where I need to validate the configuration.

However, three domains are still listed here:

> virtualmin check-config
ERROR: The plugin domain1, domain2, domain3 cannot be disabled, as it is used by the following virtual servers : $2

I’d suggest to add a verbose solution or similar, as I’m unable to tell what I need to look after, in order to get this fixed.

Also, points for the crazy response time!

Also, software.virtualmin.com does not respond right now. Maybe you’ve pulled the service down, while fixing the things we’re just talking about.

> sudo apt update
Hit:1 http://mirror.hetzner.de/debian/packages bullseye InRelease
Hit:2 http://mirror.hetzner.de/debian/packages bullseye-updates InRelease                               
Hit:3 http://mirror.hetzner.de/debian/packages bullseye-backports InRelease                             
Hit:4 http://mirror.hetzner.de/debian/security bullseye-security InRelease                              
Hit:5 http://deb.debian.org/debian bullseye InRelease                                                   
Hit:6 http://security.debian.org/debian-security bullseye-security InRelease                            
Hit:7 http://deb.debian.org/debian bullseye-updates InRelease                                           
Hit:8 https://packages.sury.org/php bullseye InRelease                                                  
Get:9 https://pkgs.tailscale.com/stable/debian bullseye InRelease                                       
Err:10 https://software.virtualmin.com/vm/7/gpl/apt virtualmin InRelease                                
  Could not connect to software.virtualmin.com:443 (2001:bc8:710:9a94:dc00:ff:fe82:8d31), connection timed out Could not connect to software.virtualmin.com:443 (51.158.66.131), connection timed out
Fetched 6581 B in 31s (214 B/s)                           
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch https://software.virtualmin.com/vm/7/gpl/apt/dists/virtualmin/InRelease  Could not connect to software.virtualmin.com:443 (2001:bc8:710:9a94:dc00:ff:fe82:8d31), connection timed out Could not connect to software.virtualmin.com:443 (51.158.66.131), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.

If you’re on Discord and need anything more, fell free to send a DM. I’ll not spam you. I’ve provided my username in a DM.

If you need any kind of tests or whatever, feel free to share a script or whatever. I’ll just roll back, if things doesn’t work as they should.

Fixed now, thanks for the heads up!

Unless the global ACLs for the user have been corrupted—which I believe is possible but highly unlikely—I still think that the last-config was not in the right shape. If you installed Virtualmin using our install script, you should have Etckeeper installed. If so, you can use it to extract the latest files from Etckeeper backups and manually analyze and replace broken configs in the /etc/webmin directory.

Extract Webmin and its module configs from Etckeeper backups.
#!/bin/sh

# Exit immediately if a command fails
set -e

# Check for mandatory parameters
if [ $# -lt 2 ]; then
    echo "Usage: $0 <TARGET_DIR> <SOURCE_DIR> [DEPTH] [GIT_REPO]"
    echo
    echo "Arguments:"
    echo "  TARGET_DIR   Absolute path to directory where extracted files will be stored"
    echo "  SOURCE_DIR   Path (relative to Git repository root) for files to extract"
    echo "  DEPTH        Number of recent backups to extract (optional, defaults to all)"
    echo "  GIT_REPO     Absolute path to Git repository (optional, defaults: /etc/.git)"
    echo
    echo "Examples:"
    echo "  $0 ~/git-backups webmin/virtual-server"
    echo "  $0 ~/git-backups webmin/virtual-server 1"
    echo "  $0 ~/git-backups webmin/virtual-server 0 /path/to/another/git-repo"
    exit 1
fi

# Set directory paths from arguments
TARGET_DIR="$1"
SOURCE_DIR="$2"
DEPTH="${3:-0}"
GIT_REPO="${4:-/etc/.git}"

# If TARGET_DIR is ".", default to the home directory
if [ "$TARGET_DIR" = "." ]; then
    TARGET_DIR="$HOME"
fi

# Check if Git repository exists
if [ ! -d "$GIT_REPO" ]; then
    echo "Error: Git repository not found in $GIT_REPO"
    exit 1
fi

# Create the target directory if it doesn't exist
mkdir -p "$TARGET_DIR"

# Change to the Git repository directory
cd "$GIT_REPO" || exit 1

# Get all commit hashes that modified files in the specified source directory
if [ "$DEPTH" -gt 0 ]; then
    COMMITS=$(git log -n "$DEPTH" --format="%H" -- "$SOURCE_DIR")
else
    COMMITS=$(git log --format="%H" -- "$SOURCE_DIR")
fi

# Loop through each commit
for COMMIT in $COMMITS; do
    # Get the commit date
    COMMIT_DATE=$(git show -s --format="%cd" --date=format:"%Y-%m-%d" "$COMMIT")
    
    # Create a directory for this date if it doesn't exist
    DEST_DIR="$TARGET_DIR/$COMMIT_DATE"
    mkdir -p "$DEST_DIR"
    
    # Extract all files for this commit
    git ls-tree -r "$COMMIT" --name-only "$SOURCE_DIR" | while read -r FILE; do
        # Create subdirectories if needed
        SUBDIR=$(dirname "$FILE")
        mkdir -p "$DEST_DIR/$SUBDIR"

        # Extract the file content
        git show "$COMMIT:$FILE" > "$DEST_DIR/$FILE"
        echo "Extracted $FILE (date: $COMMIT_DATE)"
    done
done

Put this script to /usr/local/sbin/git-extractor.sh and run it as:

sh /usr/local/sbin/git-extractor.sh /root/webmin-configs webmin 5

Then you can use the most recent extracted config files to replace the broken ones.

I did, back in march, 2021, and most have been a Debian 10 installation.

Back then, it was done with:

wget http://software.virtualmin.com/gpl/scripts/install.sh
sudo /bin/sh install.sh

And a result like:

[SUCCESS] Installation Complete!
[SUCCESS] If there were no errors above, Virtualmin should be ready
[SUCCESS] to configure at https://domain.com:10000 (or https://GUESS.WHAT.I.REMOVED:10000).
[SUCCESS] You'll receive a security warning in your browser on your first visit.

Git was not installed on the system, so the script could not run.

Hereafter, I just get a Error: Git repository not found in /etc/.git with your script.

You’re stating that it’s possibly corrupted, but aren’t there a way to spot why three domains are marked like this?

I’m able to navigate around the settings for the domains listed at the “ERROR: The plug domain1 … (and so on)”, so I just can’t really get, why it’s complaning about the configuration, without somehow state, what’s wrong with the configs? But, maybe that’s just as per design?

The simple solution to this issue is to go to the “System Settings ⇾ Features and Plugins” page and double-check that the required plugins are enabled.

They are.

That error doesn’t say what plugin can’t be disabled? That’s a terrible error, unless OP just cut it out without noticing.

We do not have such error messages because we always call plugin_call($f, "feature_name") when generating an error…

As a consumer I agree, but as a free-user, I wouldn’t pick up terrible are a acceptable wording.

However, I see lot of ways to improve this error-situation.

Again; I’m still looking at the same error, and I’m unsure how to progress, even though, I’m a Software Engineer, myself.

I’m still open for inputs, on how to fix it.

Arn’t there any kind of logs where the actual error are rendered? A verbose mode, or something else?

The real problem often lies in understanding what needs to be fixed—currently I cannot fully grasp what is happening as a whole without interacting with the actual system…

I can provide a remote session, if needed.

If you don’t find that interesting, that’s totally fair.

There’s not that critical information on the server, but again, quite a few credentials on it.

No matter what, if anything is interesting, I’d need to restore to a duped server of the Debian 10-snapshot, perform the Debian 11 upgrade again, and make a snapshot hereafter.

With that said, I’d like to check all other things, before doing so; Like, if there’s other places to look.

Sure, I’d be glad to help, and I am particularly interested in finding and fixing any potential bugs.

No worries about it, I don’t care what information you have, and I respect your privacy.

Please do!

I’m only continuing the conversation, for you to catch any bugs. At this point, I’d had a fresh install running, and still saved time, if I simply re-routed yesterday.

I’ll see what I can do.

Ah, thanks! Then, let’s postpone any further efforts for now, as I believe I have fixed all file locking issues for Virtualmin 7.30.3, which could lead to the issue of corrupt config files.