Audit-template-create with long name returns "Internal Server Error (HTTP 500)"

Bug #1510181 reported by David TARDIVEL
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
watcher
Won't Fix
Low
Unassigned

Bug Description

Audit-template-create with long name returns "Internal Server Error (HTTP 500)"

See the sequence below (first is fine, second crashes with one more char in name).

root@cli:~# watcher audit-template-create -d desc 01234567890123456789012345678901234567890123456789012345678 SERVERS_CONSOLIDATION
+----------------+-------------------------------------------------------------+
| Property | Value |
+----------------+-------------------------------------------------------------+
| goal | SERVERS_CONSOLIDATION |
| extra | {} |
| description | desc |
| name | 01234567890123456789012345678901234567890123456789012345678 |
| host_aggregate | None |
| uuid | c15a5cf5-71bd-4c89-bf59-951c10488794 |
+----------------+-------------------------------------------------------------+
root@cli:~# watcher audit-template-create -d desc 012345678901234567890123456789012345678901234567890123456789 SERVERS_CONSOLIDATION
Internal Server Error (HTTP 500)

Changed in watcher:
importance: Undecided → Low
status: New → Confirmed
Lin Yang (lin-a-yang)
Changed in watcher:
assignee: nobody → Lin Yang (lin-a-yang)
Lin Yang (lin-a-yang)
Changed in watcher:
assignee: Lin Yang (lin-a-yang) → nobody
Revision history for this message
Zhenzan Zhou (zhenzan-zhou) wrote :
Download full text (3.8 KiB)

ptas@devstack02:~$ watcher audit-template-create -d desc 012345678901234567890123456789012345678901234567890123456789 DUMMY
+----------------+--------------------------------------------------------------+
| Property | Value |
+----------------+--------------------------------------------------------------+
| goal | DUMMY |
| extra | {} |
| description | desc |
| name | 012345678901234567890123456789012345678901234567890123456789 |
| host_aggregate | None |
| uuid | 9232893d-083e-439d-94bb-2234d5c02ea0 |
+----------------+--------------------------------------------------------------+
ptas@devstack02:~$ watcher audit-template-create -d desc 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 DUMMY
Internal Server Error (HTTP 500)

============== watcher-api log =====================

2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters [req-53f851f9-4853-4081-9aa2-a40b1092c562 watcher admin - - -] DBAPIError exception wrapped from (DataError) (1406, "Data too long for column 'name' at row 1") 'INSERT INTO audit_templates (created_at, updated_at, deleted_at, deleted, uuid, name, description, host_aggregate, goal, extra, version) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2015, 12, 7, 0, 2, 23, 821978), None, None, 0, '3dcd71aa-0743-4d4b-a672-41a23f9636b2', '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', 'desc', None, 'DUMMY', '{}', None)
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters Traceback (most recent call last):
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1063, in _execute_context
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters context)
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 442, in do_execute
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters cursor.execute(statement, parameters)
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters self.errorhandler(self, exc, value)
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters raise errorclass, errorvalue
2015-12-07 00:02:23.830 64559 ERROR oslo_db.sqlalchemy.exc_filters DataError: (1406, "Data too long for column 'name' at row 1")
2015-12-07 00:0...

Read more...

Changed in watcher:
assignee: nobody → Zhenzan Zhou (zhenzan-zhou)
Changed in watcher:
milestone: none → mitaka-3
Changed in watcher:
assignee: Zhenzan Zhou (zhenzan-zhou) → Taylor Peoples (tpeoples)
Changed in watcher:
milestone: mitaka-3 → mitaka-rc-final
Changed in watcher:
milestone: mitaka-rc-final → newton-1
Revision history for this message
daniel.pawlik (daniel-pawlik) wrote :

I don't see any problem:

watcher audit-template-create 012345678901234567890123456789012345678901234567890123456789 TEST_GOAL

result:
+----------------+--------------------------------------------------------------+
| Property | Value |
+----------------+--------------------------------------------------------------+
| goal | TEST_GOAL |
| extra | {} |
| description | None |
| name | 012345678901234567890123456789012345678901234567890123456789 |
| host_aggregate | None |
| uuid | 3c8ce644-a600-4271-9b97-9b60ec377214 |
+----------------+--------------------------------------------------------------+

Changed in watcher:
status: Confirmed → Triaged
Changed in watcher:
milestone: newton-1 → newton-2
Revision history for this message
Jean-Emile DARTOIS (jed56) wrote :

tpeoples: are still working on this ?

Changed in watcher:
assignee: Taylor Peoples (tpeoples) → nobody
Revision history for this message
Zhai, Edwin (edwin-zhai) wrote :

I can't reproduce it with latest code.

Let's close it and reopen in future if needed.

Changed in watcher:
status: Triaged → Won't Fix
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.