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

recaplog fails to create daily summaries on RHEL 6 #207

Closed
tonodor opened this issue Apr 10, 2019 · 3 comments
Closed

recaplog fails to create daily summaries on RHEL 6 #207

tonodor opened this issue Apr 10, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@tonodor
Copy link

tonodor commented Apr 10, 2019

I've noticed that on RHEL 6, recap 2.0.2 fails to create the daily summaries with the following error:

2019-04-10 01:00:01+01:00 [INFO] --- Starting recaplog[22870] ---
2019-04-10 01:00:01+01:00 [INFO] recaplog (22870): Created lock file: /var/lock/recaplog.lock
2019-04-10 01:00:01+01:00 [INFO] Compressing old log files
2019-04-10 01:00:01+01:00 [INFO] Finding reports from: 20190409
2019-04-10 01:00:01+01:00 [INFO] Reports found: [  ]
2019-04-10 01:00:01+01:00 [ERROR] Unable to archive unexisting reports.
2019-04-10 01:00:01+01:00 [INFO] Deleting log files older than 15 days...
2019-04-10 01:00:01+01:00 [INFO] Deleting: 432 log files.
2019-04-10 01:00:01+01:00 [INFO] Deleting: 0 empty directories.
2019-04-10 01:00:01+01:00 [INFO] recaplog (22870): Caught signal - deleting /var/lock/recaplog.lock
2019-04-10 01:00:01+01:00 [INFO] --- Ending recaplog[22870] ---

The issue seems to be that the awk regex to retrieve the report names it's not interpreted correctly. I've applied the following patch to resolve it but I haven't tested it on any other OS:

*** recaplog-old        2019-04-10 09:32:43.027843716 +0100
--- recaplog    2019-04-10 09:33:07.242570939 +0100
***************
*** 133,139 ****
    log INFO "Finding reports from: ${day}"
    reports=(
      $( ls -1 "${BASEDIR}" 2>/dev/null |
!          awk -F. \
           '
             /'${day}'-[0-9]{6}\.log$/ {sub("_'${day}'-[0-9]{6}","",$1); print $1}
           ' |
--- 133,139 ----
    log INFO "Finding reports from: ${day}"
    reports=(
      $( ls -1 "${BASEDIR}" 2>/dev/null |
!          awk --posix -F. \
           '
             /'${day}'-[0-9]{6}\.log$/ {sub("_'${day}'-[0-9]{6}","",$1); print $1}
           ' |
@tonyskapunk
Copy link
Contributor

Hi @tonodor, thanks for taking the time in reporting this and providing a possible solution.

I'll do some testing to verify if only el6 is affected or if other distros are also affected.

@tonyskapunk
Copy link
Contributor

I confirmed only el6 is affected by this :(

Your suggestion works with all distros, so is good to use it for this case.

@tonyskapunk
Copy link
Contributor

The fix is merged in development

@tonyskapunk tonyskapunk added this to the 2.1.0 milestone Apr 12, 2019
This was referenced Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants