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

fix: fix an aws s3 sync error when handling special file types during a synchronization operation #51274

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RoseSecurity
Copy link

Why

Note

The following error is also present during systemd operations in ExecStartPre. The sync operation exited with a non-zero exit code (2), breaking the script due to set -e.

  • Encountered the following when executing the following:
[root@hostname]# /usr/local/bin/teleport-all-pre-start
warning: Skipping file /var/lib/teleport/debug.sock. File is character special device, block special device, FIFO, or socket.

[root@hostname]# echo $?
2

What

  • The script checks for the existence of debug.sock in the local /var/lib/teleport directory and removes it before starting the sync operation.
  • The aws s3 sync command now uses the --exclude flag to correctly exclude debug.sock and other socket files from synchronization.
  • Added error-catching mechanisms to gracefully handle aws s3 sync issues and log meaningful error messages.
  • Ensures the script exits with an appropriate error code if critical files are missing after the sync.
  • The script verifies the presence of required files (fullchain.pem and privkey.pem) after synchronization, ensuring a successful pre-start configuration.

Reference

… failing to handle special file types (like sockets) during a synchronization operation
@CLAassistant
Copy link

CLAassistant commented Jan 20, 2025

CLA assistant check
All committers have signed the CLA.

Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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 this pull request may close these issues.

2 participants