<div class="gmail_quote">On Mon, Aug 6, 2012 at 1:21 PM, John Tran <span dir="ltr"><<a href="mailto:njhtran@gmail.com" target="_blank">njhtran@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'm having trouble getting all the tests to pass locally.  I'm using<br>
the run_tests.sh as well as tox -epy27 the same results.  I attempted<br>
to look into the console output for all 3 daemons to see why I'm<br>
getting a 500 internal server error on the first few fails but didn't<br>
see any output.  I can dig into it deeper but I'm hoping someone else<br>
has run into this and know off the top of their head a quick fix.<br>
<br>
======================================================================<br>
ERROR: test_empty (tests.api.v1.test_list_users.TestListUsers)<br>
----------------------------------------------------------------------<br>
Traceback (most recent call last):<br>
  File "/opt/stack/ceilometer/tests/api/v1/test_list_users.py", line<br>
35, in test_empty<br>
    data = self.get('/users')<br>
  File "/opt/stack/ceilometer/ceilometer/tests/api.py", line 82, in get<br>
    data = json.loads(rv.data)<br>
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads<br>
    return _default_decoder.decode(s)<br>
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode<br>
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())<br>
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode<br>
    raise ValueError("No JSON object could be decoded")<br>
ValueError: No JSON object could be decoded<br>
-------------------- >> begin captured stdout << ---------------------<br>
RAW DATA: <Response 291 bytes [500 INTERNAL SERVER ERROR]><br>
<br>
--------------------- >> end captured stdout << ----------------------<br>
-------------------- >> begin captured logging << --------------------<br>
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017<br>
ceilometer.tests.api: DEBUG: Unable to connect to mongod, falling back to MIM<br>
test: ERROR: Exception on /users [GET]<br>
Traceback (most recent call last):<br>
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line<br>
1687, in wsgi_app<br>
    response = self.full_dispatch_request()<br>
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line<br>
1360, in full_dispatch_request<br>
    rv = self.handle_user_exception(e)<br>
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line<br>
1358, in full_dispatch_request<br>
    rv = self.dispatch_request()<br>
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line<br>
1344, in dispatch_request<br>
    return self.view_functions[rule.endpoint](**req.view_args)<br>
  File "/opt/stack/ceilometer/ceilometer/api/v1.py", line 49, in list_users<br>
    users = flask.request.storage_conn.get_users(source=source)<br>
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",<br>
line 261, in get_users<br>
    return self.db.user.distinct('_id')<br>
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line<br>
1011, in distinct<br>
    return self.find().distinct(key)<br>
AttributeError: 'Cursor' object has no attribute 'distinct'<br></blockquote><div><br></div><div>Are you running the tests against a real MongoDB instance or with the MiM (Mongo in Memory) implementation from Ming?</div>
<div><br></div><div>Which version of PyMongo do you have and how was it installed?</div><div><br></div><div><div>Doug<br></div></div><div><br></div></div>