[LMA] Elasticsearch/Kibana - Curator cron job does not run correctly

Bug #1535435 reported by Mike Nguyen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StackLight
Fix Released
Medium
guillaume thouvenin

Bug Description

Looking at:

https://github.com/openstack/fuel-plugin-elasticsearch-kibana/blob/da2557fba9b7b266d70dad13537df06584bc8f09/deployment_scripts/puppet/modules/lma_logging_analytics/manifests/curator.pp

It seems there's a small typo in the curator cronjob, making it so the job does not run properly on a daily basis.

Instead of:

0 2 * * * /usr/local/bin/curator --host localhost --port 9200 --debug delete indices --regex '^(log|notification)-.*$' --time-unit days --older-than 16 --timestring "%Y.%m.%d"

The timestring variables need to be escaped for the job to run successfully, else the variables are interpreted:

0 2 * * * /usr/local/bin/curator --host localhost --port 9200 --debug delete indices --regex '^(log|notification)-.*$' --time-unit days --older-than 16 --timestring "\%Y.\%m.\%d"

-----

Otherwise, the job will error with:

From <email address hidden> Thu Dec 17 02:00:01 2015
X-Original-To: root
From: <email address hidden> (Cron Daemon)
To: <email address hidden>
Subject: Cron <root@node-11> /usr/local/bin/curator --host localhost --port 9200 --debug delete indices --regex '^(log|notification)-.*$' --time-unit days --older-than 16 --timestring "
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Date: Thu, 17 Dec 2015 02:00:01 +0000 (UTC)

/bin/sh: 1: Syntax error: Unterminated quoted string

Revision history for this message
Swann Croiset (swann-w) wrote :

Hi,

I didn't manage to reproduce it with the current master branch and MOS 8 (ubuntu).

Could you please indicate the versions of the plugin and MOS ?

Thanks.

Changed in lma-toolchain:
status: New → Incomplete
Revision history for this message
Simon Pasquier (simon-pasquier) wrote :

I've managed to reproduce it with MOS7 and the stable/0.8 version.

Changed in lma-toolchain:
status: Incomplete → Confirmed
assignee: nobody → LMA-Toolchain Fuel Plugins (mos-lma-toolchain)
milestone: none → 0.8.1
importance: Undecided → Medium
Revision history for this message
Mike Nguyen (moozoo) wrote :

Oops, my bad.

Here's the versions I'm on:

# fuel -v
DEPRECATION WARNING: /etc/fuel/client/config.yaml exists and will be used as the source for settings. This behavior is deprecated. Please specify the path to your custom settings file in the FUELCLIENT_CUSTOM_SETTINGS environment variable.
7.0.0

# fuel plugins
DEPRECATION WARNING: /etc/fuel/client/config.yaml exists and will be used as the source for settings. This behavior is deprecated. Please specify the path to your custom settings file in the FUELCLIENT_CUSTOM_SETTINGS environment variable.
id | name | version | package_version
---|-----------------------------|---------|----------------
6 | influxdb_grafana | 0.8.0 | 3.0.0
5 | lma_collector | 0.8.0 | 2.0.0
7 | lma_infrastructure_alerting | 0.8.0 | 3.0.0
8 | elasticsearch_kibana | 0.8.0 | 3.0.0

Changed in lma-toolchain:
assignee: LMA-Toolchain Fuel Plugins (mos-lma-toolchain) → guillaume thouvenin (guillaume-thouvenin)
Swann Croiset (swann-w)
tags: added: elasticsearch
Changed in lma-toolchain:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-plugin-elasticsearch-kibana (master)

Fix proposed to branch: master
Review: https://review.openstack.org/275274

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-plugin-elasticsearch-kibana (master)

Reviewed: https://review.openstack.org/275274
Committed: https://git.openstack.org/cgit/openstack/fuel-plugin-elasticsearch-kibana/commit/?id=19c0edc7ace12055ff9bd230b84783d80de7fbbd
Submitter: Jenkins
Branch: master

commit 19c0edc7ace12055ff9bd230b84783d80de7fbbd
Author: Guillaume Thouvenin <email address hidden>
Date: Tue Feb 2 16:30:56 2016 +0100

    Escape percent in the command of the es-curator

    This change escapes the percentage because it is used in a crontab
    entry. The first percentage denotes the start of the STDIN and the
    others denote a new line if they are not escaped.

    Change-Id: I1eda385939e45937696d9f1c090ebd9d471ac485
    Closes-Bug: #1535435

Changed in lma-toolchain:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-plugin-elasticsearch-kibana (stable/0.8)

Fix proposed to branch: stable/0.8
Review: https://review.openstack.org/275626

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-plugin-elasticsearch-kibana (stable/0.8)

Reviewed: https://review.openstack.org/275626
Committed: https://git.openstack.org/cgit/openstack/fuel-plugin-elasticsearch-kibana/commit/?id=621b47742acdc938336bdf3b4f4ab28df5a9daff
Submitter: Jenkins
Branch: stable/0.8

commit 621b47742acdc938336bdf3b4f4ab28df5a9daff
Author: Guillaume Thouvenin <email address hidden>
Date: Wed Feb 3 12:03:19 2016 +0100

    Escape percent in the command of the es-curator

    This change escapes the percentage because it is used in a crontab
    entry. The first percentage denotes the start of the STDIN and the
    others denote a new line if they are not escaped.

    Change-Id: If385fa65f90735b7b25f6bc820a61a3b69a7529c
    Closes-Bug: #1535435

tags: added: customer-found
Changed in lma-toolchain:
status: Fix Committed → Won't Fix
status: Won't Fix → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.