keystone-manage token_flush cron job fails with: expr: division by zero sleep

Bug #1708584 reported by Juan Antonio Osorio Robles on 2017-08-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Juan Antonio Osorio Robles

Bug Description

The cron job ends up like this:

[root@controller-0 heat-admin]# cat /var/spool/cron/keystone
# HEADER: This file was autogenerated at 2017-07-31 11:50:18 +0000 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: keystone-manage token_flush
PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
1 * * * * sleep `expr ${RANDOM} \% 0`; keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1
# Puppet Name: cinder-manage db purge
PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh
1 0 * * * cinder-manage db purge 0 >>/var/log/cinder/cinder-rowsflush.log 2>&1

which results in an error.

Related fix proposed to branch: master
Review: https://review.openstack.org/490748

Changed in tripleo:
assignee: nobody → Juan Antonio Osorio Robles (juan-osorio-robles)
status: New → In Progress
Changed in tripleo:
importance: Undecided → High
milestone: none → pike-rc1

Reviewed: https://review.openstack.org/490748
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=79aca264fff6126edd98d480c2233cbddac64432
Submitter: Jenkins
Branch: master

commit 79aca264fff6126edd98d480c2233cbddac64432
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Fri Aug 4 08:36:42 2017 +0300

    Use number for KeystoneCronTokenFlushMaxDelay instead of string

    Using a string results in an erroneous check in puppet-keystone, which
    sets up a zero where it shouldn't. So we change it to number to avoid
    that. Note that there will also be a puppet-keystone fix for this.
    Changing the value here assures that deployers only give valid values to
    this parameter.

    Change-Id: I00823e23358df91ce54f421c12636f05d4196e15
    Closes-Bug: #1708584

Changed in tripleo:
status: In Progress → Fix Released

Change abandoned by Alex Schultz (<email address hidden>) on branch: stable/ocata
Review: https://review.openstack.org/492023
Reason: Need to clear out the queue as this is going to fail. Will restore momentarily

Change abandoned by Juan Antonio Osorio Robles (<email address hidden>) on branch: stable/ocata
Review: https://review.openstack.org/492023

Reviewed: https://review.openstack.org/492023
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=564e3feeb9c518851afde9ed778360e4032e9213
Submitter: Jenkins
Branch: stable/ocata

commit 564e3feeb9c518851afde9ed778360e4032e9213
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Fri Aug 4 08:36:42 2017 +0300

    Use number for KeystoneCronTokenFlushMaxDelay instead of string

    Using a string results in an erroneous check in puppet-keystone, which
    sets up a zero where it shouldn't. So we change it to number to avoid
    that. Note that there will also be a puppet-keystone fix for this.
    Changing the value here assures that deployers only give valid values to
    this parameter.

    Change-Id: I00823e23358df91ce54f421c12636f05d4196e15
    Closes-Bug: #1708584
    (cherry picked from commit 79aca264fff6126edd98d480c2233cbddac64432)

tags: added: in-stable-ocata

This issue was fixed in the openstack/puppet-keystone 11.3.0 release.

This issue was fixed in the openstack/tripleo-heat-templates 7.0.0.0rc1 release candidate.

This issue was fixed in the openstack/tripleo-heat-templates 6.2.1 release.

This issue was fixed in the openstack/puppet-keystone 10.4.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers