Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pve/backend.func
Original file line number Diff line number Diff line change
Expand Up @@ -3738,6 +3738,15 @@ create_lxc_container() {
if ! _pct_create "$CTID" "${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE}" $PCT_OPTIONS ${_PW_ARGS[@]+"${_PW_ARGS[@]}"} >"$LOGFILE" 2>&1; then
msg_debug "Container creation failed on ${TEMPLATE_STORAGE}. Checking error..."

# pct create asks timedatectl for the host's time zone; when that fails, every retry fails with it.
if grep -q "command 'timedatectl show" "$LOGFILE"; then
msg_error "pct create could not read this host's time zone: timedatectl does not answer."
msg_custom "🔧" "${YW}" "On the Proxmox host, run 'systemctl restart systemd-timedated' and check that 'timedatectl' works, then retry."
msg_custom "💡" "${YW}" "If timedatectl still fails, D-Bus on the host is stuck; a reboot clears it."
_flush_pct_log
exit 209
fi

if grep -qiE 'Compilation failed|Bareword.*not allowed' "$LOGFILE"; then
msg_error "Container creation failed due to broken Perl modules on the PVE host."
msg_custom "⚠️" "${YW}" "This usually happens after a partial PVE package upgrade."
Expand Down
7 changes: 7 additions & 0 deletions tests/pct-create-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,12 @@ _cs_shield_hangup() { "$@"; }
pveam() { [[ -d "$TEST_DIR/nas/template/cache" ]] && echo saved || echo "No such file or directory"; }
expect "a storage without template/cache gets it before the download" saved "$(_pveam_download nas debian-13-standard_13.6-1_amd64.tar.zst)"

# From the telemetry: five hosts, three futile attempts each.
printf '%s\n' "Failed to parse bus message: Transport endpoint is not connected" \
"unable to create CT 110 - command 'timedatectl show '--property=Timezone' --value' failed: exit code 1" >"$TEST_DIR/pct.log"
expect "a host whose timedatectl fails is named before any retry" 1 \
"$(awk '/First attempt/,/already exists\|already in use/' "$CORE_DIR/pve/backend.func" | grep -c "grep -q \"command 'timedatectl show\" \"\$LOGFILE\"")"
expect "and the pattern matches what pct create prints" 0 "$(grep -q "command 'timedatectl show" "$TEST_DIR/pct.log"; echo $?)"

printf '%s passed, %s failed\n' "$passed" "$failed"
((failed == 0))
Loading