<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:SimSun;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-indent:21.0pt;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1844853998;
        mso-list-type:hybrid;
        mso-list-template-ids:-1564853318 -1456069010 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:SimSun;}
@list l1
        {mso-list-id:1987391386;
        mso-list-type:hybrid;
        mso-list-template-ids:-1147791888 -78585010 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
        {mso-level-text:"\(%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I deployed a ceilometer environment with storage backend of postgresql.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I got into trouble when running the following commands:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1">
<![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">(1)<span style="font:7.0pt "Times New Roman"">    
</span></span></span><![endif]><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333;background:white">ceilometer resource-list</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Logs:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">--><o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">2014-04-09 10:44:05.578 8242 ERROR wsme.api [-] Server-side error: "(ProgrammingError) column "meter.counter_unit" must appear in the GROUP BY clause or be used in an aggregate
 function<br>
LINE 1: SELECT meter.counter_unit AS unit, min(meter.timestamp) AS t...<br>
               ^<br>
 'SELECT meter.counter_unit AS unit, min(meter.timestamp) AS tsmin, max(meter.timestamp) AS tsmax, avg(meter.counter_volume) AS avg, sum(meter.counter_volume) AS sum, min(meter.counter_volume) AS min, max(meter.counter_volume) AS max, count(meter.counter_volume)
 AS count \nFROM meter \nWHERE meter.counter_name = %(counter_name_1)s AND meter.timestamp >= %(timestamp_1)s AND meter.timestamp <= %(timestamp_2)s AND meter.timestamp >= %(timestamp_3)s AND meter.timestamp < %(timestamp_4)s' {'counter_name_1': u'cpu_util',
 'timestamp_4': datetime.datetime(2014, 4, 9, 2, 43, 5, 556125), 'timestamp_2': datetime.datetime(2014, 4, 9, 2, 44, 5, 556125), 'timestamp_3': datetime.datetime(2014, 4, 9, 2, 42, 5, 556125), 'timestamp_1': datetime.datetime(2014, 4, 9, 2, 42, 5, 556125)}".
 Detail:<br>
Traceback (most recent call last):<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib/python2.6/site-packages/wsmeext/pecan.py", line 72, in callfunction<br>
    result = f(self, *args, **kwargs)<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib/python2.6/site-packages/ceilometer/api/controllers/v2.py", line 813, in statistics<br>
    for c in computed]<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib/python2.6/site-packages/ceilometer/storage/impl_sqlalchemy.py", line 569, in get_meter_statistics<br>
    for r in q.all():<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2115, in all<br>
    return list(self)<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2227, in __iter__<br>
    return self._execute_and_instances(context)<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2242, in _execute_and_instances<br>
    result = conn.execute(querycontext.statement, self._params)<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1449, in execute<br>
    params)<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1584, in _execute_clauseelement<br>
    compiled_sql, distilled_params<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1698, in _execute_context<br>
    context)<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1851, in _handle_dbapi_exception<br>
    None, sys.exc_info()[2]<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:14.4pt;margin-left:0cm;line-height:13.5pt;background:white;max-width: 45em;orphans: auto;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333">ProgrammingError: (ProgrammingError) column "meter.counter_unit" must appear in the GROUP BY clause or be used in an aggregate function<br>
LINE 1: SELECT meter.counter_unit AS unit, min(meter.timestamp) AS t...<br>
               ^<br>
 'SELECT meter.counter_unit AS unit, min(meter.timestamp) AS tsmin, max(meter.timestamp) AS tsmax, avg(meter.counter_volume) AS avg, sum(meter.counter_volume) AS sum, min(meter.counter_volume) AS min, max(meter.counter_volume) AS max, count(meter.counter_volume)
 AS count \nFROM meter \nWHERE meter.counter_name = %(counter_name_1)s AND meter.timestamp >= %(timestamp_1)s AND meter.timestamp <= %(timestamp_2)s AND meter.timestamp >= %(timestamp_3)s AND meter.timestamp < %(timestamp_4)s' {'counter_name_1': u'cpu_util',
 'timestamp_4': datetime.datetime(2014, 4, 9, 2, 43, 5, 556125), 'timestamp_2': datetime.datetime(2014, 4, 9, 2, 44, 5, 556125), 'timestamp_3': datetime.datetime(2014, 4, 9, 2, 42, 5, 556125), 'timestamp_1': datetime.datetime(2014, 4, 9, 2, 42, 5, 556125)}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><---<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;mso-list:l1 level1 lfo1">
<![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">(2)<span style="font:7.0pt "Times New Roman"">    
</span></span></span><![endif]><span lang="EN-US"> ceilometer statistics -m disk.read.bytes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Logs:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">---><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">LINE 1: SELECT meter.counter_unit AS unit, min(meter.timestamp) AS t...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">               ^<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">'SELECT meter.counter_unit AS unit, min(meter.timestamp) AS tsmin, max(meter.timestamp) AS tsmax, avg(meter.counter_volume) AS avg, sum(meter.counter_volume) AS sum, min(meter.counter_volume) AS min, max(me<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ter.counter_volume) AS max, count(meter.counter_volume) AS count \nFROM meter \nWHERE meter.counter_name = %(counter_name_1)s AND meter.timestamp >= %(timestamp_1)s AND meter.timestamp <= %(timestamp_2)s AND<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">meter.project_id = %(project_id_1)s' {'counter_name_1': u'disk.read.bytes', 'project_id_1': u'6b3e95ea39f74b2897e6581394fe21ed', 'timestamp_2': datetime.datetime(2014, 4, 9, 19, 26, 28, 119292), 'timestamp_<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">1': datetime.datetime(2014, 3, 10, 19, 26, 28, 119273)}". Detail:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Traceback (most recent call last):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib/python2.6/site-packages/wsmeext/pecan.py", line 72, in callfunction<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    result = f(self, *args, **kwargs)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib/python2.6/site-packages/ceilometer/api/controllers/v2.py", line 813, in statistics<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    for c in computed]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib/python2.6/site-packages/ceilometer/storage/impl_sqlalchemy.py", line 547, in get_meter_statistics<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    for res in self._make_stats_query(sample_filter, groupby):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2227, in __iter__<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    return self._execute_and_instances(context)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2242, in _execute_and_instances<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    result = conn.execute(querycontext.statement, self._params)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1449, in execute<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    params)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1584, in _execute_clauseelement<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    compiled_sql, distilled_params<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1698, in _execute_context<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    context)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1851, in _handle_dbapi_exception<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">    None, sys.exc_info()[2]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ProgrammingError: (ProgrammingError) column "meter.counter_unit" must appear in the GROUP BY clause or be used in an aggregate function<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">LINE 1: SELECT meter.counter_unit AS unit, min(meter.timestamp) AS t...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">               ^<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">'SELECT meter.counter_unit AS unit, min(meter.timestamp) AS tsmin, max(meter.timestamp) AS tsmax, avg(meter.counter_volume) AS avg, sum(meter.counter_volume) AS sum, min(meter.counter_volume) AS min, max(me<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ter.counter_volume) AS max, count(meter.counter_volume) AS count \nFROM meter \nWHERE meter.counter_name = %(counter_name_1)s AND meter.timestamp >= %(timestamp_1)s AND meter.timestamp <= %(timestamp_2)s AND<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">meter.project_id = %(project_id_1)s' {'counter_name_1': u'disk.read.bytes', 'project_id_1': u'6b3e95ea39f74b2897e6581394fe21ed', 'timestamp_2': datetime.datetime(2014, 4, 9, 19, 26, 28, 119292), 'timestamp_<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">1': datetime.datetime(2014, 3, 10, 19, 26, 28, 119273)}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><---<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333;background:white">I tested SQL above in postgres command model and found the above errors were caused by SQL grammatical mistakes.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333;background:white">For problem one, I added anon_2.resource_id AS resource_id, anon_2.max_ts AS max_ts, anon_2.min_ts AS min_ts to 'group by' segment, then
 it ran normal.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333;background:white">For problem two, I added meter.counter_unit to 'group by' segment, then it ran normal.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Courier New";color:#333333;background:white">Can somebody give help about this problem, it was the bug of ceilometer or some mistake configuration?
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>