xapi: Improve error reporting when pool join fails on TLS verification#7112
Open
LucienLassalle wants to merge 1 commit into
Open
xapi: Improve error reporting when pool join fails on TLS verification#7112LucienLassalle wants to merge 1 commit into
LucienLassalle wants to merge 1 commit into
Conversation
psafont
reviewed
Jun 3, 2026
| Server_error | ||
| (pool_joining_pool_bundle_empty_after_import, [bundle_path]) | ||
| ) | ||
| ) |
Member
There was a problem hiding this comment.
Can this check be done inside the import_joining_pool_certs?
bb4364e to
4b1b34e
Compare
last-genius
requested changes
Jun 4, 2026
| D.error | ||
| "import_joining_pool_certs: pool bundle '%s' is empty or missing after \ | ||
| certificate import. The bundle generation script \ | ||
| (/opt/xensource/bin/update-ca-bundle.sh) likely failed silently." |
Contributor
There was a problem hiding this comment.
Does the script leave some errors in daemon.log to be able to investigate? or is the failure actually silent?
Author
There was a problem hiding this comment.
#!/bin/bash
#
# Copyright (c) Citrix Systems 2008. All rights reserved.
#
set -e
regen_bundle () {
CERTS_DIR="$1"
BUNDLE="$2"
mkdir -p "$CERTS_DIR"
CERTS=$(find "$CERTS_DIR" -not -name '*.new.pem' -name '*.pem')
NEW_CERTS=$(find "$CERTS_DIR" -name '*.new.pem')
rm -f "$BUNDLE.tmp"
touch "$BUNDLE.tmp"
for NEW_CERT in $NEW_CERTS; do
# If cat new cert command fails, do not error and exit, just skip it
if cat "$NEW_CERT" >> "$BUNDLE.tmp"; then
echo "" >> "$BUNDLE.tmp"
fi
done
for CERT in $CERTS; do
cat "$CERT" >> "$BUNDLE.tmp"
echo "" >> "$BUNDLE.tmp"
done
mv "$BUNDLE.tmp" "$BUNDLE"
}
regen_bundle "/etc/stunnel/certs" "/etc/stunnel/xapi-stunnel-ca-bundle.pem"
regen_bundle "/etc/stunnel/certs-pool" "/etc/stunnel/xapi-pool-ca-bundle.pem"
This script is silent...
Contributor
There was a problem hiding this comment.
looks like a fairly simple script, I wonder why would cat new cert possibly fail???
verification When a host joins a pool (pool.join_force), the process has two phases: 1. An unverified TLS connection is used to run pre-join checks and exchange host certificates. The joiner imports the pool bundle. 2. A verified TLS connection (verifyPeer=yes, SNI=pool) is opened using the freshly-generated pool bundle. Previously, any failure at Phase 2 surfaced as: INTERNAL_ERROR(Stunnel.Stunnel_verify_error( This error is opaque and gives no actionable information to the administrator. The idea is to improve error handling in order to obtain something more precise. Signed-off-by: Lucas RAVAGNIER <ravagnierlucas@gmail.com>
4b1b34e to
f941a71
Compare
last-genius
approved these changes
Jun 4, 2026
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.
When a host joins a pool (pool.join_force), the process has two phases:
Previously, any failure at Phase 2 surfaced as:
INTERNAL_ERROR(Stunnel.Stunnel_verify_error(
This error is opaque and gives no actionable information to the administrator. The idea is to improve error handling in order to obtain something more precise.