CI: Add unreadable files to check-logs.sh

fluentd emits a warn message when it can't read a file
"unreadable. It is excluded and would be examined next time."

Depends-On: https://review.opendev.org/c/openstack/kolla/+/939055
Depends-On: https://review.opendev.org/c/openstack/kolla/+/939088

Change-Id: I4313b6918c381ec5e79e78df2f9a0cbaf25df53e
This commit is contained in:
Michal Nasiadka 2024-12-23 17:35:32 +01:00
parent b4e9022a8e
commit 891568d6d7
2 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@ set -o pipefail
# Enable unbuffered output for Ansible in Jenkins.
export PYTHONUNBUFFERED=1
declare -a fluentchecks=("got incomplete line before first line" "pattern not matched:")
declare -a fluentchecks=("got incomplete line before first line" "pattern not matched:" "unreadable. It is excluded and would be examined next time." "Permission denied @ rb_sysopen")
function check_openstack_log_file_for_level {
# $1: file
@ -26,7 +26,7 @@ function check_fluentd_log_file_for_level {
function check_fluentd_log_file_for_content {
# $1: file
# $2: content
sudo egrep " $2 " $1
sudo egrep "$2" $1
}
function check_docker_log_file_for_sigkill {
@ -96,7 +96,7 @@ for string in "${fluentchecks[@]}"; do
if check_fluentd_log_file_for_content $fluentd_log_file "$string" >/dev/null; then
any_critical=1
echo "(critical) Found some error log messages in fluentd logs. Matches in $fluentd_file"
echo "$string" >> $fluentd_file
echo "Check: $string" >> $fluentd_file
check_fluentd_log_file_for_content $fluentd_log_file "$string" >> $fluentd_file
echo >> $fluentd_file
fi

View File

@ -28,6 +28,8 @@ copy_logs() {
elif [ "$CONTAINER_ENGINE" = "podman" ]; then
cp -rL /etc/containers/ ${LOG_DIR}/system_configs/
fi
# List all permissions to log files
ls -lLR /var/log/kolla > ${LOG_DIR}/system_logs/ls_lr_var_log_kolla.txt
# Remove /var/log/kolla link to not double the data uploaded
unlink /var/log/kolla
cp -rvnL /var/log/* ${LOG_DIR}/system_logs/