public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Friedrich Weber <f.weber@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] pveupdate: do not try to update subscription when using offline key
Date: Thu, 27 Nov 2025 10:26:01 +0100	[thread overview]
Message-ID: <20251127092617.60723-1-f.weber@proxmox.com> (raw)

pveupdate is run daily by pve-daily-update.service and, among other
things, it tries to update the subscription. Updating a subscription
fails early when an offline key is installed, hence, pveupdate will
currently log the following to the syslog with severity level "error":

> update subscription info failed: Updating offline key not possible -
> please remove and re-add subscription key to switch to online key.

This may be confusing to users, because it sounds like an action is
needed on their part to resolve an error.

To avoid that, skip the subscription update if an offline key is
installed.

Reported in enterprise support.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---

Notes:
    This will result in pveupdate calling read_etc_subscription three times
    in the non-offline key case, which is certainly not optimal, but
    considering this is done once a day, maybe not that bad either, so I
    opted for this simple patch for now.

 bin/pveupdate | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/pveupdate b/bin/pveupdate
index c5356c88..50ca60a1 100755
--- a/bin/pveupdate
+++ b/bin/pveupdate
@@ -39,7 +39,13 @@ $rpcenv->set_user('root@pam');
 
 my $nodename = PVE::INotify::nodename();
 
-eval { PVE::API2::Subscription->update({ node => $nodename }); };
+eval {
+    my $subscription_info = PVE::API2::Subscription::read_etc_subscription();
+    return if !$subscription_info;
+    # no need to update offline subscription keys
+    return if $subscription_info->{signature};
+    PVE::API2::Subscription->update({ node => $nodename });
+};
 if (my $err = $@) {
     syslog('err', "update subscription info failed: $err");
 }
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-11-27  9:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27  9:26 Friedrich Weber [this message]
2025-11-29 19:01 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251127092617.60723-1-f.weber@proxmox.com \
    --to=f.weber@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal