sql backend problem on alarm update

Bug #1260776 reported by Mehdi Abaakouk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Mehdi Abaakouk

Bug Description

From https://review.openstack.org/#/c/59489/ , http://logs.openstack.org/89/59489/12/check/gate-ceilometer-python27/aa9d57e/console.html.gz

FAIL: tests.api.v2.test_alarm_scenarios.TestAlarms.test_post_invalid_alarm_have_multiple_rules(mysql)
2013-12-04 16:23:28.491 | tags: worker-2
2013-12-04 16:23:28.492 | ----------------------------------------------------------------------
2013-12-04 16:23:28.492 | Empty attachments:
2013-12-04 16:23:28.492 | pythonlogging:'ceilometer.openstack.common'
2013-12-04 16:23:28.492 |
2013-12-04 16:23:28.492 | Traceback (most recent call last):
2013-12-04 16:23:28.492 | File "ceilometer/tests/base.py", line 60, in skip_if_not_implemented
2013-12-04 16:23:28.492 | return func(*args, **kwargs)
2013-12-04 16:23:28.493 | File "/home/jenkins/workspace/gate-ceilometer-python27/ceilometer/tests/api/v2/test_alarm_scenarios.py", line 149, in setUp
2013-12-04 16:23:28.493 | self.conn.update_alarm(alarm)
2013-12-04 16:23:28.493 | File "ceilometer/storage/impl_sqlalchemy.py", line 722, in update_alarm
2013-12-04 16:23:28.493 | session.flush()
2013-12-04 16:23:28.493 | File "ceilometer/openstack/common/db/sqlalchemy/session.py", line 549, in _wrap
2013-12-04 16:23:28.493 | raise exception.DBError(e)
2013-12-04 16:23:28.493 | DBError: (IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (`ceilometer_3c9b8879_fe38_4777_b7d1_ad5f1a3edbf2`.`alarm`, CONSTRAINT `fk_alarm_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`))') 'INSERT INTO alarm (id, enabled, name, type, description, timestamp, user_id, project_id, state, state_timestamp, ok_actions, alarm_actions, insufficient_data_actions, repeat_actions, rule) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' ('a', 1, 'name1', 'threshold', 'a', datetime.datetime(2013, 12, 4, 16, 23, 28, 423006), 'ad29eebf-56e4-411f-95d1-e05703dba68d', 'dc3e36ac-c998-4d5b-b478-1e2bf30d20db', 'insufficient data', datetime.datetime(2013, 12, 4, 16, 23, 28, 423016), '[]', '[]', '[]', 1, '{"meter_name": "meter.test", "evaluation_periods": 60, "threshold": 2.0, "query": [{"field": "project_id", "value": "dc3e36ac-c998-4d5b-b478-1e2bf30d20db", "op": "eq"}], "statistic": "avg", "period": 1, "comparison_operator": "gt"}')
2013-12-04 16:23:28.

Mehdi Abaakouk (sileht)
Changed in ceilometer:
status: New → Confirmed
assignee: nobody → Mehdi Abaakouk (sileht)
milestone: none → icehouse-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/62021
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=3fb11bd84cc0796776f861bf1b5891247d78f41e
Submitter: Jenkins
Branch: master

commit 3fb11bd84cc0796776f861bf1b5891247d78f41e
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Dec 13 16:56:43 2013 +0100

    Ensure that the user/project exist on alarm update

    This patch ensure that the user and project exists before updating the
    alarm.

    Closes bug #1260776

    Change-Id: I25cf55d91b78a32bda671426972b7f418bf85e21

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-2 → 2014.1
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.