public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] pveupdate: do not try to update subscription when using offline key
@ 2025-11-27  9:26 Friedrich Weber
  2025-11-29 19:01 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Friedrich Weber @ 2025-11-27  9:26 UTC (permalink / raw)
  To: pve-devel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-29 19:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-27  9:26 [pve-devel] [PATCH manager] pveupdate: do not try to update subscription when using offline key Friedrich Weber
2025-11-29 19:01 ` [pve-devel] applied: " Thomas Lamprecht

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