Ask when the preselected storage cannot hold the content - #51
Merged
Merged
Conversation
A storage named in default.vars that no longer takes vztmpl left the run
here:
while true; do
if [[ -z "${var_template_storage:-}" ]]; then
if select_storage template; then ...; break; fi
fi
done
The variable is set precisely when default.vars supplied it, so the body
never ran, nothing was asked and nothing broke out. The container branch
had no loop but silently kept the unusable value instead.
Both now go through _storage_preselect_recover: it asks, and when the
stale name came from default.vars it offers to correct the file so the
next run does not stop at the same place. Declining leaves the file
alone; cancelling the dialog exits with the storage code instead of
spinning.
Fixes the hang reported on InvoiceShelf with var_template_storage=local.
Contributor
Try this branchThe engine and the scripts resolve independently, so a production script can COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/community-scripts/core/fix/storage-preselect-invalid \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/ct/debian.sh)"Swap This PR touches Run a script from a fork as wellcurl -fsSL https://raw.githubusercontent.com/community-scripts/core/fix/storage-preselect-invalid/tools/run.sh |
bash -s -- https://raw.githubusercontent.com/YOU/ProxmoxVED/your-branch ct/debian.sh \
https://raw.githubusercontent.com/community-scripts/core/fix/storage-preselect-invalidNote that Useful flags while testing
|
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



✍️ Description
i had issues after rebuild my hdd / ssd storages on my node2 (replaced and ordered).
the default.vars naming a storage that no longer takes vztmpl hangs the run.
Nothing is drawn and nothing exits. The cause:
var_template_storage is non-empty exactly when default.vars supplied it, which is the only way to reach this branch — so the body never runs, select_storage is never called, and there is no break. It spins until Ctrl+C. The container branch has no loop, but it silently keeps the unusable value and fails later.
🔗 Related Issue
None filed — reported directly with the transcript above.
✅ Prerequisites (X in brackets)
_storage_preselect_recoveris internal; no loader snapshot changes🧪 Testing
_storage_preselect_recoverand_write_storage_to_varsextracted from the files,select_storageandwhiptailstubbed, against a syntheticdefault.vars:default.varsin play → selects, writes nothing, rc 0Not run on a Proxmox host.
bash -npasses on both files.🛠️ Type of Change (X in brackets)