Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Backup failing in pulp-secret-key #1098

Closed
git-hyagi opened this issue Oct 2, 2023 · 1 comment · Fixed by #1104
Closed

[BUG] Backup failing in pulp-secret-key #1098

git-hyagi opened this issue Oct 2, 2023 · 1 comment · Fixed by #1104
Labels

Comments

@git-hyagi
Copy link
Collaborator

Describe the bug
Pulpbackup is failing to handle special chars from pulp_secret_key.

To Reproduce
Create a pulp_secret_key Secret with the following content:

secret: '&6--z68!&m%c!%1dgqm__j!6%&cma=*cxi#k7h=rx+w7*e(082'

Expected behavior
The backup should be able to handle the special chars and not fail.

Additional context
From a quick investigation, I believe, one of the issues (not sure if it can have others), can be related with the contiguous chars !&:

# echo "pulp_secret_key: pulp-secret-key\nsecret_key: '&6--z68!&m%c!%1dgqm__j!6%&cma=*cxi#k7h=rx+w7*e(082'\n"
bash: !: event not found

# echo "pulp_secret_key: pulp-secret-key\nsecret_key: '&6--z68\!&m%c!%1dgqm__j!6%&cma=*cxi#k7h=rx+w7*e(082'\n"
pulp_secret_key: pulp-secret-key\nsecret_key: '&6--z68\!&m%c1dgqm__j&cma=*cxi#k7h=rx+w7*e(082'\n     
@git-hyagi git-hyagi added the Issue label Oct 2, 2023
@git-hyagi
Copy link
Collaborator Author

This error is probably impacting the execution of our pipeline.
Sometimes it fails in the Backup & Restore job. Checking the logs:
https://pipelinesghubeus23.actions.githubusercontent.com/1Lwo4Fb5DjyurMJDeqU9gfUecpElEZcw7d5EWtmMNm7eWF3cBc/_apis/pipelines/1/runs/6393/signedlogcontent/15?urlExpires=2023-10-03T14%3A53%3A37.0957919Z&urlSigningMethod=HMACV1&urlSignature=pQW68Wd%2BrQG4qYHNJ1C2b8vVGe6dwlpQDAXGzn66jmA%3D

...
2023-09-29T03:27:19.3717364Z 2023-09-29T03:14:21Z	�[34mINFO�[0m	backup/database.go:52	Database Backup finished!
2023-09-29T03:27:19.3717683Z 2023-09-29T03:14:21Z	�[34mINFO�[0m	backup/cr.go:29	Starting galaxy CR backup process ...
2023-09-29T03:27:19.3718183Z 2023-09-29T03:14:22Z	�[31mERROR�[0m	backup/secret.go:164	Failed to backup galaxy-example-secret-key secret	{"error": "command terminated with exit code 2"}
2023-09-29T03:27:19.3718575Z github.com/pulp/pulp-operator/controllers/backup.(*RepoManagerBackupReconciler).createBackupFile
2023-09-29T03:27:19.3718926Z 	/home/runner/work/pulp-operator/pulp-operator/controllers/backup/secret.go:164
...

git-hyagi added a commit to git-hyagi/pulp-operator that referenced this issue Oct 3, 2023
Instead of using the `createBackupFile` method (that stores the
Secret data in plain text) using the `createSecretBackupFile`
method (which stores the entire Secret object in YAML format and
without decoding it) fixed the issue with the special chars.

fixes: pulp#1098
git-hyagi added a commit that referenced this issue Oct 3, 2023
Instead of using the `createBackupFile` method (that stores the
Secret data in plain text) using the `createSecretBackupFile`
method (which stores the entire Secret object in YAML format and
without decoding it) fixed the issue with the special chars.

fixes: #1098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant