From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 979CC1FF0A7 for ; Wed, 30 Sep 2026 09:47:07 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id E1B8821661; Wed, 30 Sep 2026 09:46:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1790689734; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding; bh=torok5gFmQgAJIlSt9oYUqCueLScUdZkoTVRo6nWw/w=; b=LuTwibrNx2tSwo4PuNdNbXONnxkF7W3wKqU4d5cfnZlEygvW5nOy172saOyeeRa8mkNXZ6 PJgrBFNftjbn5FzKA7tTlK778ReB0v+e8aqgd6aQyeKvMHgZFMxVbMpzP6rOy6/SOUOgs8 Z0+hEfU9UTUndvRR8WLZnrAdxzm+4tZLerwpdq/2PAlTdxHsq6vrq/VSTZG+FMO4fIqUhW XgK4Keap6AufzCv5UtFYMknZPCKHeK4ttnmmct1VU7Du1jQDut/LvKKB20BIOVaQFrWRUL DwPa7MFeUVpA22C4egTUbcD/e46Jqrl/Wab+35zrdGM5bnxqCGgc1h1iFYcr0g== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH guest-common] fix #7408: guest helpers: activate storage before checking hookscript Date: Tue, 29 Sep 2026 15:48:52 +0200 Message-ID: <20260929134852.2660793-1-me@dualfroz.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.045 Adjusted score from AWL reputation of From: address DKIM_INVALID 0.1 DKIM or DK signature exists, but is not valid DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DMARC_PASS -0.1 DMARC pass policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: me@dualfroz.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: DGF3AN55YFRD6WGBOF4EH2SAKVNBLXFN X-Message-ID-Hash: DGF3AN55YFRD6WGBOF4EH2SAKVNBLXFN X-Mailman-Approved-At: Wed, 30 Sep 2026 09:46:15 +0200 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The hookscript is looked up on its storage without activating it first. If the snippets live on a network storage like CIFS or NFS that is not mounted yet, for example when a guest is started on boot, the check fails with "script ... does not exist" and the guest does not start, even though the storage would be mounted on its first regular use. Activate the storage of the hookscript volume before checking the file, as is done for any other volume used by a guest. Signed-off-by: Michal Fox --- src/PVE/GuestHelpers.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PVE/GuestHelpers.pm b/src/PVE/GuestHelpers.pm index f8d112b..ccd00b9 100644 --- a/src/PVE/GuestHelpers.pm +++ b/src/PVE/GuestHelpers.pm @@ -105,6 +105,9 @@ sub check_hookscript { die "'$volid' is not in the snippets directory\n" if $type ne 'snippets'; + my ($storeid) = PVE::Storage::parse_volume_id($volid); + PVE::Storage::activate_storage($storecfg, $storeid); + die "script '$volid' does not exist\n" if !-f $path; -- 2.43.0