Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1214 (closed defect: fixed)

Opened 12 years ago

Last modified 12 years ago

nosetests fresh quickstarted project: Failed to create client object: Daemon not running

Reported by: jeffk Owned by: anonymous
Priority: normal Milestone:
Component: Tests Version: trunk
Severity: normal Keywords: quickstart nosetests daemon client object
Cc:

Description

 http://groups.google.com/group/turbogears-trunk/browse_thread/thread/f40123adad2a9e91

Updated bug report to trunk r2262, satisfied recent FormEncode==dev dependencies etc.

Running nosetests on a fresh quickstarted project (r2262 trunk) gives the following error. The quickstarted project itself runs (except that I now notice the same error in the startup message), as does toolbox.

/software/tgprojects $ tg-admin quickstart -p tgtest tgtest
Do you need Identity (usernames/passwords) in this project? [no] 
(...)
writing dependency_links to tgtest.egg-info/dependency_links.txt
reading manifest file 'tgtest.egg-info/SOURCES.txt'
writing manifest file 'tgtest.egg-info/SOURCES.txt'
/software/tgprojects/tgtest $ python start-tgtest.py 
2006-12-22 13:02:23,100 cherrypy.msg INFO CONFIG: Server parameters:
2006-12-22 13:02:23,101 cherrypy.msg INFO CONFIG:   server.environment: development
2006-12-22 13:02:23,101 cherrypy.msg INFO CONFIG:   server.log_to_screen: True
2006-12-22 13:02:23,102 cherrypy.msg INFO CONFIG:   server.log_file: 
2006-12-22 13:02:23,102 cherrypy.msg INFO CONFIG:   server.log_tracebacks: True
2006-12-22 13:02:23,102 cherrypy.msg INFO CONFIG:   server.log_request_headers: True
2006-12-22 13:02:23,103 cherrypy.msg INFO CONFIG:   server.protocol_version: HTTP/1.0
2006-12-22 13:02:23,103 cherrypy.msg INFO CONFIG:   server.socket_host: 
2006-12-22 13:02:23,104 cherrypy.msg INFO CONFIG:   server.socket_port: 8080
2006-12-22 13:02:23,104 cherrypy.msg INFO CONFIG:   server.socket_file: 
2006-12-22 13:02:23,104 cherrypy.msg INFO CONFIG:   server.reverse_dns: False
2006-12-22 13:02:23,105 cherrypy.msg INFO CONFIG:   server.socket_queue_size: 5
2006-12-22 13:02:23,105 cherrypy.msg INFO CONFIG:   server.thread_pool: 10
Failed to create client object: Daemon not running
2006-12-22 13:02:23,492 cherrypy.msg INFO HTTP: Serving HTTP on http://localhost:8080/
/software/tgprojects/tgtest $ nosetests
.Failed to create client object: Daemon not running
F
======================================================================
FAIL: tgtest.tests.test_controllers.test_indextitle
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/nose-0.9.1-py2.4.egg/nose/case.py", line 52, in runTest
    self.testFunc()
  File "/software/tgprojects/tgtest/tgtest/tests/test_controllers.py", line 16, in test_indextitle
    assert "<TITLE>Welcome to TurboGears</TITLE>" in cherrypy.response.body[0]
AssertionError

----------------------------------------------------------------------
Ran 2 tests in 2.430s

FAILED (failures=1)
I'm running turbogears trunk on linux python 2.4.4:

/software/svn/turbogears $ svn info
URL: http://www.turbogears.org/svn/turbogears/trunk
Revision: 2262

and it seems the dependencies are satisfied. Same error with
nose-0.9.0, FWIW. 

# grep -E 'TurboJson|(...)|nose'
/usr/lib/python2.4/site-packages/easy-install.pth
/software/svn/FormEncode
./setuptools-0.6c3-py2.4.egg
./cElementTree-1.0.5_20051216-py2.4-linux-i686.egg
./elementtree-1.2.6_20050316-py2.4.egg
./simplejson-1.4-py2.4.egg
./SQLObject-0.7.1-py2.4.egg
./TurboKid-0.9.9-py2.4.egg
./TurboCheetah-0.9.5-py2.4.egg
./TurboJson-0.9.9-py2.4.egg
./PasteScript-1.0-py2.4.egg
./CherryPy-2.2.1-py2.4.egg
./Genshi-0.3.6-py2.4.egg
./RuleDispatch-0.5a0.dev_r2247-py2.4-linux-i686.egg
./nose-0.9.1-py2.4.egg 
(from TurboGears-trunk list) Karl Guertin wrote:
> I believe kid changed their serializer recently to output lowercase
> tags rather than uppercase. That looks like the reason for the
> assertion error. I never figured out why they did this. 

I think it's missing the cherrypy.response object. Editing the quickstarted test to subsitute <title> in place of <TITLE>: 

/software/tgprojects/tgtest $ nosetests
.Failed to create client object: Daemon not running
F
======================================================================
FAIL: tgtest.tests.test_controllers.test_indextitle
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/nose-0.9.1-py2.4.egg/nose/case.py", line 52, in runTest
    self.testFunc()
  File "/software/tgprojects/tgtest/tgtest/tests/test_controllers.py", line 16, in test_indextitle
    assert "<title>Welcome to TurboGears</title>" in cherrypy.response.body[0]
AssertionError

----------------------------------------------------------------------
Ran 2 tests in 1.807s

FAILED (failures=1)
/software/tgprojects/tgtest $ cat tgtest/tests/test_controllers.py
from turbogears import testutil
from tgtest.controllers import Root
import cherrypy

cherrypy.root = Root()

def test_method():
    "the index method should return a string called now"
    import types
    result = testutil.call(cherrypy.root.index)
    assert type(result["now"]) == types.StringType

def test_indextitle():
    "The mainpage should have the right title"
    testutil.createRequest("/")
    assert "<title>Welcome to TurboGears</title>" in cherrypy.response.body[0]
/software/tgprojects/tgtest $ ipython
Python 2.4.4 (#1, Nov  4 2006, 18:38:54) 
Type "copyright", "credits" or "license" for more information.

IPython 0.7.2 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: from turbogears import testutil
22/Dec/2006:12:59:24 CONFIG INFO Server parameters:
22/Dec/2006:12:59:24 CONFIG INFO   server.environment: development
22/Dec/2006:12:59:24 CONFIG INFO   server.log_to_screen: True
22/Dec/2006:12:59:24 CONFIG INFO   server.log_file: 
22/Dec/2006:12:59:24 CONFIG INFO   server.log_tracebacks: True
22/Dec/2006:12:59:24 CONFIG INFO   server.log_request_headers: True
22/Dec/2006:12:59:24 CONFIG INFO   server.protocol_version: HTTP/1.0
22/Dec/2006:12:59:24 CONFIG INFO   server.socket_host: 
22/Dec/2006:12:59:24 CONFIG INFO   server.socket_port: 8080
22/Dec/2006:12:59:24 CONFIG INFO   server.socket_file: 
22/Dec/2006:12:59:24 CONFIG INFO   server.reverse_dns: False
22/Dec/2006:12:59:24 CONFIG INFO   server.socket_queue_size: 5
22/Dec/2006:12:59:24 CONFIG INFO   server.thread_pool: 10

In [2]: from tgtest.controllers import Root 

In [3]: import cherrypy

In [4]: cherrypy.root = Root()

In [5]: def test_method():
   ...:     "the index method should return a string called now" 
   ...:     import types
   ...:     result = testutil.call(cherrypy.root.index)
   ...:     assert type(result["now"]) == types.StringType
   ...:     
   ...:     

In [6]: test_method() 

In [7]: def test_indextitle():
   ...:     "The mainpage should have the right title"
   ...:     testutil.createRequest("/") 
   ...:     assert "<title>Welcome to TurboGears</title>" in cherrypy.response.body[0]
   ...:     
   ...:     

In [8]: test_indextitle()
Failed to create client object: Daemon not running
---------------------------------------------------------------------------
exceptions.AssertionError                            Traceback (most recent call last)

/software/tgprojects/tgtest/<ipython console> 

/software/tgprojects/tgtest/<ipython console> in test_indextitle()

AssertionError: 

In [9]: testutil.createRequest("/")

In [10]: print cherrypy.response.body[0]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
    <title>500 Internal error</title>
    <style type="text/css">
    #powered_by {
        margin-top: 20px;
        border-top: 2px solid black;
        font-style: italic;
    }

    #traceback {
        color: red;
    }
    </style>
</head>
    <body>
        <h2>500 Internal error</h2>
        <p>The server encountered an unexpected condition which prevented it from fulfilling the request.</p>
        <pre id="traceback">Page handler: &lt;bound method Root.index of &lt;tgtest.controllers.Root object at 0x86c280c&gt;&gt;
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 105, in _run
    self.main()
  File "/usr/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/cherrypy/_cphttptools.py", line 254, in main
    body = page_handler(*virtual_path, **self.params)
  File "&lt;string&gt;", line 3, in index
  File "/software/svn/turbogears/turbogears/controllers.py", line 284, in expose
    output = database.run_with_transaction(
  File "&lt;string&gt;", line 5, in run_with_transaction
  File "/software/svn/turbogears/turbogears/database.py", line 246, in so_rwt
    retval = func(*args, **kw)
  File "&lt;string&gt;", line 5, in _expose
  File "/software/svn/turbogears/turbogears/controllers.py", line 301, in &lt;lambda&gt;
    mapping, fragment, args, kw)))
  File "/software/svn/turbogears/turbogears/controllers.py", line 341, in _execute_func
    return _process_output(output, template, format, content_type, mapping, fragment)
  File "/software/svn/turbogears/turbogears/controllers.py", line 81, in _process_output
    mapping=mapping, content_type=content_type,fragment=fragment)
  File "/software/svn/turbogears/turbogears/view/base.py", line 126, in render
    return adapt_call(engine.render, **dict(info=info, format=format, fragment=fragment, template=template, mapping=mapping))
  File "/software/svn/turbogears/turbogears/util.py", line 166, in adapt_call
    return func(*args, **kw)
  File "/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 158, in render
    tclass = self.load_template(template)
  File "/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 128, in load_template
    mod = _compile_template(package, basename, tfile, classname)
  File "/usr/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/turbokid/kidsupport.py", line 15, in _compile_template
    mod = kid.load_template(tfile, name=classname)
  File "/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/__init__.py", line 112, in load_template
    raise Exception, "Template not found: %s (in %s)" % (
Exception: Template not found: /software/tgprojects/tgtest/tgtest/templates/welcome.kid (in /software/tgprojects/tgtest, /)
</pre>
    <div id="powered_by">
    <span>Powered by <a href="http://www.cherrypy.org">CherryPy 2.2.1</a></span>
    </div>
    </body>
</html>

Change History

comment:1 Changed 12 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [2264].

Alberto

comment:2 Changed 12 years ago by jeffk

  • Status changed from closed to reopened
  • Resolution fixed deleted

Reopening (hope that's OK TurboGears etiquette):

Tests pass (fresh quickstarted project) thanks to Alberto (r2264), but the "Failed to create client object" error message still displays on nosetest and start-projectname.py

/software/tgprojects/tgtest $ nosetests 
.Failed to create client object: Daemon not running
.
----------------------------------------------------------------------
Ran 2 tests in 1.941s

OK
/software/tgprojects/tgtest $ python start-tgtest.py 
2006-12-22 15:29:32,998 cherrypy.msg INFO CONFIG: Server parameters:
2006-12-22 15:29:32,999 cherrypy.msg INFO CONFIG:   server.environment: development
2006-12-22 15:29:33,000 cherrypy.msg INFO CONFIG:   server.log_to_screen: True
2006-12-22 15:29:33,000 cherrypy.msg INFO CONFIG:   server.log_file: 
2006-12-22 15:29:33,000 cherrypy.msg INFO CONFIG:   server.log_tracebacks: True
2006-12-22 15:29:33,001 cherrypy.msg INFO CONFIG:   server.log_request_headers: True
2006-12-22 15:29:33,001 cherrypy.msg INFO CONFIG:   server.protocol_version: HTTP/1.0
2006-12-22 15:29:33,002 cherrypy.msg INFO CONFIG:   server.socket_host: 
2006-12-22 15:29:33,002 cherrypy.msg INFO CONFIG:   server.socket_port: 8080
2006-12-22 15:29:33,002 cherrypy.msg INFO CONFIG:   server.socket_file: 
2006-12-22 15:29:33,003 cherrypy.msg INFO CONFIG:   server.reverse_dns: False
2006-12-22 15:29:33,003 cherrypy.msg INFO CONFIG:   server.socket_queue_size: 5
2006-12-22 15:29:33,004 cherrypy.msg INFO CONFIG:   server.thread_pool: 10
Failed to create client object: Daemon not running
2006-12-22 15:29:33,299 cherrypy.msg INFO HTTP: Serving HTTP on http://localhost:8080/

comment:3 Changed 12 years ago by alberto

don't worry, reopening tickets is standard procedure when problems re-appear... :)

Can't reproduce the problem you're seeing in a clean workinenv.py sandbox... this is my "tg-admin info":

TurboGears Complete Version Information

TurboGears requires:

* TurboGears 1.0b3dev-r2261
* nose 0.9.0
* configobj 4.3.2
* RuleDispatch 0.5a0.dev-r2115
* setuptools 0.6c3
* FormEncode 0.5.1
* cElementTree 1.0.5-20051216
* PasteScript 0.9.7
* elementtree 1.2.6
* simplejson 1.3
* CherryPy 2.2.1
* TurboKid 0.9.8
* TurboCheetah 0.9.5
* TurboJson 0.9.9
* PyProtocols 1.0a0dev-r2082
* Cheetah 1.0
* PasteDeploy 0.9.6
* Paste 0.9.7
* kid 0.9.3
* Cheetah 1.0
* elementtree 1.2.6

Identity Providers 

* sqlobject (TurboGears 1.0b3dev-r2261)
* sqlalchemy (TurboGears 1.0b3dev-r2261)

tg-admin Commands 

* info (TurboGears 1.0b3dev-r2261)
* shell (TurboGears 1.0b3dev-r2261)
* quickstart (TurboGears 1.0b3dev-r2261)
* update (TurboGears 1.0b3dev-r2261)
* sql (TurboGears 1.0b3dev-r2261)
* i18n (TurboGears 1.0b3dev-r2261)
* toolbox (TurboGears 1.0b3dev-r2261)

Visit Managers 

* sqlobject (TurboGears 1.0b3dev-r2261)
* sqlalchemy (TurboGears 1.0b3dev-r2261)

Template Engines 

* kid (TurboKid 0.9.8)
* cheetah (TurboCheetah 0.9.5)
* json (TurboJson 0.9.9)

Widget Packages 


TurboGears Extensions 

* visit (TurboGears 1.0b3dev-r2261)
* identity (TurboGears 1.0b3dev-r2261)

Would you mind posting yours?

comment:4 Changed 12 years ago by alberto

  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed in [2314] (1.0) and [2315] (trunk).

comment:5 Changed 12 years ago by jeffk

Thanks alberto, incorporating a reusable teardown function is even better. The patches [2314] and [2315] fix #1217, if anyone is referring to this later.

Noting the pattern

test_method = with_setup(teardown=teardown_func)(test_method)

from [2314] and [2315], is that a candidate for a new @with_teardown decorator that could be added to tests as needed?

comment:6 Changed 12 years ago by jeffk

Information on a workaround for the title error of this ticket #1214 can be found at #1099. Failed to create client object: Daemon not running is an  avahi daemon error condition not directly related to TurboGears, but TurboGears is affected as of [1913] and [1914].

Note: See TracTickets for help on using tickets.