Three Methods to Suppress the Invalid Subscription Warning Popup in PVE Virtualization System

Introduction

While exploring the correct methods to suppress the invalid subscription warning popup in PVE version 9.x, I reviewed numerous related technical posts online and summarized three methods. Today, I will discuss the principles and differences of these three methods.

Method 1: Modify Subscription Status Detection Logic

This is a method I discovered and summarized myself.

  • Principle: By modifying the condition check for subscription status detection, changing strict not equal<span>!==</span>to strict equal<span>===</span>, essentially replacing just one character. When the system checks the subscription status, it originally required the status to be “active” to avoid displaying a warning. After modification, as long as the status is not “active”, the warning popup will not be triggered, thus suppressing the invalid subscription prompt.
  • Pros and Cons: Perfectly compatible with PVE version 9.x, and will not cause the PVE web backend “Package Version” button to become unresponsive.
  • Applicable PVE Version Range: Tested effective for PVE versions 8.x and 9.x, theoretically compatible with PVE 7.x and earlier versions.
cp /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak

line_num=$(grep -n "res.data.status.toLowerCase() !== 'active'" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js | head -1 | cut -d: -f1)
sed -i "${line_num}s/!==/===/" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

systemctl restart pveproxy

Method 2: Disable Popup Display Function

This method was found in the PVE-Tools-9 project on GitHub.

  • Principle: By replacing the call to the Ext.Msg.show function with a void expression, the popup display function becomes ineffective. The void operator evaluates the expression but returns undefined, thus preventing the actual display of the popup.
  • Pros and Cons: Cannot perfectly adapt to PVE version 9.x, which causes the PVE web backend “Package Version” button to become unresponsive.
  • Applicable PVE Version Range: Theoretically compatible with all versions.
cp /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak

sed -Ezi "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

systemctl restart pveproxy

Method 3: Rewrite Condition Check Expression

This is the most widely circulated method online, and most tutorials are based on this method.

  • Principle: Completely rewrite the subscription detection condition check logic, replacing complex condition checks with a simple false value. By using two sed commands to handle the starting part of the condition statement and the status detection part separately, the entire condition check will always return false, thus skipping the popup display code.
  • Pros and Cons: Like Method 2, cannot perfectly adapt to PVE version 9.x, which will cause the “Package Version” button to become unresponsive.
  • Applicable PVE Version Range: Theoretically compatible with all versions.
cp /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak

sed -i "s/if (res === null || res === undefined || \!res || res/if(/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
sed -i "s/.data.status.toLowerCase() !== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

systemctl restart pveproxy

Postscript

The above three methods are also applicable for suppressing the invalid subscription warning popup in the PBS backup system, namely<span>Proxmox Backup Server</span>. After completing the file modification operations, simply restart the PBS proxy service.

Additionally, for the PBS system, all three methods can effectively achieve the suppression without any other impact.

systemctl restart proxmox-backup-proxy

References

[1] PVE-Tools[EB/OL]. https://github.com/Mapleawaa/PVE-Tools-9/blob/main/PVE-Tools.sh.

#Virtualization System #PVE #Proxmox #HomeLab #Server #PBS #Suppress Subscription Popup

Leave a Comment