[stable33] hotfix: 6977 fix ca config loss#6982
Merged
vitormattos merged 8 commits intostable33from Feb 20, 2026
Merged
Conversation
The pki directory should not be deleted as it contains the new PKI structure with CA certificates organized by instance and generation. Related to #6977 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Fixed critical bugs in the migration that could cause CA certificate loss: 1. Replaced buggy empty(glob()) check with file_exists() for essential CA files (ca.pem and ca-key.pem) before copying 2. Only delete source directory after verifying both CA files exist in destination 3. Removed redundant addConfigPathToOpenSsl() from preSchemaChange 4. Removed unnecessary ca_id generation that incremented counter twice 5. Added warning logging when migration cannot verify files The glob() function could return ['.', '..'] on some filesystems, making empty() return false even for truly empty directories. This caused the migration to skip copying files and then delete the source, resulting in complete CA certificate loss. Fixes #6977 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ate20260221000000) Add repair migration to recover CA files for users already affected by the Version13000Date20251031165700 bug. Conservative approach: - Only runs if config_path is empty or doesn't contain CA files - Searches ONLY in old structure (openssl_config/cfssl_config) - Never touches existing pki/ directories - Moves files to correct location based on ca_id - Updates metadata (ca_id, config_path, ca_generation_counter) - Cleanup only removes empty old structure directories This migration safely recovers CA certificates for affected users without interfering with systems that migrated successfully. Related to #6977 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
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.
Backport of PR #6980