How to remove subscription notification from Proxmox VE 5

This guide will show you how to easily remove the “No Valid Subscription” nag from Proxmox VE 5.* that pops up every time you log in.

Introduction and Disclaimer

NOTE: THIS GUIDE IS DEPRECIATED.
Refer to the comments section below for more up-to-date information.

In order to apply this “hack” to a Proxmox installation, you require SSH or console access with administrative/sudo privileges. This guide assumes that you have the appropriate privileges. (If you’re reading this guide then, let’s face it, you probably do).

By following this guide you agree that you do so at your own risk. I take no responsibility for any damage that occurs as a result of this guide.

Steps

1) Log in to your Proxmox machine via SSH or via the VNC console available from within the web UI.

2) Navigate to the following directory where the PVE manager configuration files are stored

/usr/share/pve-manager/js/

3) Make a backup of the Javascript file pvemanagerlib.js

cp pvemanagerlib.js pvemanagerlib.js.bkp

4) Now open the file you just backed up with your favourite editor and find the following lines of code:

if (data.status === 'Active') {
    Ext.Msg.show({
      title: gettext('No valid subscription'),
      icon: Ext.Msg.WARNING,
      msg: PVE.Utils.noSubKeyHtml,
      buttons: Ext.Msg.OK,
      callback: function(btn) {
          if (btn !== 'ok') {
              return;
          }
          orig_cmd();
      }
    });
} else {
    orig_cmd();
}

5) Replace the first if() string with if(false), like so:

if (false) {
    Ext.Msg.show({
      title: gettext('No valid subscription'),
      icon: Ext.Msg.WARNING,
      msg: PVE.Utils.noSubKeyHtml,
      buttons: Ext.Msg.OK,
      callback: function(btn) {
          if (btn !== 'ok') {
              return;
          }
          orig_cmd();
      }
    });
} else {
    orig_cmd();
}

6) Restart the node – make sure you shut down your running VMs properly first!

7) Navigate back to your web UI (log out first if you’re still logged in) and hard refresh your browser. Log back in, no more nag! Do note that this may be overwritten by subsequent updates. If you update your machine and the nag returns simply follow this guide again.

20 thoughts on “How to remove subscription notification from Proxmox VE 5

  1. You don’t need to restart the node! This is only a Javascript change so it doesn’t really change anything on the server, just how your browser renders it. Clearing the cache on your browser so the JS file is re-downloaded is all that’s required.

  2. I changed if (data.status === ‘Active’) {

    to

    if (data.status === ‘false’) {

    then applied updates. After a reboot, the subscription notification was still there. I tried a couple of different browsers (even in private mode in case there was some cached version being loaded) but it didn’t go away.

    During the 5th time looking at the Active to false change, I noticed the following:

    if (data.status !== ‘false’) {

    There is an exclamation point in the place of the first equal sign. Once I changed that back to an equal sign and rebooted, the subscription notification went away.

  3. Thats not what the file looks like in PVE 5.1 anyways. The only occurance of that If statement looks like this
    if (data.status === ‘Active’) {
    if (data.level === ‘c’) {
    me.updateCommunity(data);
    } else {
    me.updateActive(data);
    }
    } else {
    me.updateInactive(data);
    }

    1. It is now in /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js inside the function “checked_command”.
      The code you copied is for the update screen. Right above it, you can add these two lines:
      data.state = ‘Active’;
      data.level = ‘c’;

  4. Since Version 5.1-46 of Proxmox the relevant code snippet was moved to /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

  5. Copied from JustMe: “Since Version 5.1-46 of Proxmox the relevant code snippet was moved to /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js”

  6. For Proxmox 5.1, comment this line :

    Proxmox.Utils.checked_command(function() {}); // display subscription status

    (near line #30609)

  7. Here is how to remove the nag screen in 5.1:
    sed -i.bak ‘s/me\.updateInactive/me.updateCommunity/’ /usr/share/pve-manager/js/pvemanagerlib.js

  8. Here is how you can stop the nag screen in 5.1:
    sed -i.sav ‘s/me\.updateInactive/me.updateCommunity/’ /usr/share/pve-manager/js/pvemanagerlib.js

  9. New Proxmox 5.1:
    Line: 30608

    Proxmox.Utils.checked_command(function() {}); // display subscription status

    Disable:

    // Proxmox.Utils.checked_command(function() {}); // display subscription status

    Code:

    30603: if (!me.login) {
    30604: me.login = Ext.create(‘PVE.window.LoginWindow’, {
    30605: handler: function(data) {
    30606: me.login = null;
    30607: me.updateLoginData(data);
    30608: Proxmox.Utils.checked_command(function() {}); // display subscription status
    30609: }
    30610: });
    30611: }

    Working !

  10. As of pve 5.1-46, you can remove the subscription message commenting out the line that has the function “Proxmox.Utils.checked_command”

  11. If you have a 5.x proxmox instance, use the following instruction instead :

    sed -i.bak ‘s/NotFound/Active/g’ /usr/share/perl5/PVE/API2/Subscription.pm && systemctl restart pveproxy.service

  12. In version 5.1-49 you have to coment the line 31771 (Proxmox.Utils.checked_command(function() {}); // display subscription status) to get rid of the ‘No valid subscription’ message

  13. Nice quick fix! After saving the file, I did not have to restart anything (maybe due to version of chrome, Proxmox, or both).

    For new people (not you :-), here’s what I did a little differently.

    I’m running 5.1 BTW. Followed your directions to navigate to the file, then copied/changed/commented the line so it looks this way (so 3 lines where there were one):

    // if (data.status !== ‘Active’) {

    if (data.status == ‘Active’) {

    This, close to what you did, simply flips the boolean. Commented so it’s pretty obvious what happened. (Never trust somebody to remember to diff a file at 3am for troubleshooting).

    Why bother to do this on my home rig, and why post about it here? I figure a lot of new people building their own dev labs (I’m getting back into the game myself) are learning habits, and I want them to be the right ones in case I have to follow them onto a site, and do aforementioned 3am troubleshooting 🙂

  14. On 5.1-X this is now /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js line #352, the rest is the same.

  15. On newer versions you have to patch proxmoxlib.js, very similar function, in /usr/share/javascript/proxmox-widget-toolkit

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.