upgrade to 3.0.0 - Application mounted at ''

619 views
Skip to first unread message

Kevin Coyner

unread,
Jan 15, 2007, 5:11:02 AM1/15/07
to cherryp...@googlegroups.com

I'm in the process of upgrading to 3.0.0 from 2.1 and am getting
this warning when starting up cherrypy:

HTTP Serving HTTP on http://0.0.0.0:17700/
CherryPy Checker:
The Application mounted at '' has an empty config. It looks like
the config you passed to cherrypy.config.update() contains
application-specific sections. You must explicitly pass application
config via cherrypy.tree.mount(..., config=app_config)

It works, but I'm not sure about that message. Can anyone point out
what I might me missing?

Here's some hopefully relevant snips:

index.py
---------------
class Mainpage(webpage.Webpage):
def __init__(self):
<snip>
html = cherrytemplate.renderTemplate(file="index.html")
return html
index.exposed = True

config = cherrypy.config.update('cherrypy3.cfg')

if __name__ == '__main__':
cherrypy.tree.mount(Mainpage(), config=config)
cherrypy.server.quickstart()
cherrypy.engine.start()

cherrypy3.cfg
---------------
[global]
server.socket_port = 17700
server.thread_pool = 1
tools.proxy.on = True
log.error_file = "/home/mysite/logs/cherrypy.log"

<snip>

--
Kevin Coyner GnuPG key: 1024D/8CE11941

Sylvain Hellegouarch

unread,
Jan 15, 2007, 5:22:20 AM1/15/07
to cherryp...@googlegroups.com
Kevin Coyner wrote:
>
>
> I'm in the process of upgrading to 3.0.0 from 2.1 and am getting
> this warning when starting up cherrypy:
>
> HTTP Serving HTTP on http://0.0.0.0:17700/
> CherryPy Checker:
> The Application mounted at '' has an empty config. It looks like
> the config you passed to cherrypy.config.update() contains
> application-specific sections. You must explicitly pass application
> config via cherrypy.tree.mount(..., config=app_config)
>
> It works, but I'm not sure about that message. Can anyone point out
> what I might me missing?
>
> Here's some hopefully relevant snips:
>
> index.py
> ---------------
> class Mainpage(webpage.Webpage):
> def __init__(self):
> <snip>
> html = cherrytemplate.renderTemplate(file="index.html")
> return html
> index.exposed = True
>
> config = cherrypy.config.update('cherrypy3.cfg')

Are you sure the assignation is what you want here? AFAIK, update() will
return None.

> if __name__ == '__main__':
> cherrypy.tree.mount(Mainpage(), config=config)

Since config is now None you actually pass nothing to your application.

> cherrypy.server.quickstart()
> cherrypy.engine.start()
>
>
>
> cherrypy3.cfg
> ---------------
> [global]
> server.socket_port = 17700
> server.thread_pool = 1
> tools.proxy.on = True
> log.error_file = "/home/mysite/logs/cherrypy.log"
>
> <snip>
>

Does your global config contain other sections. In theory you should
only have the [global] one here and have a different file for the
application config.

So:
cherrypy.config.update('cherrypy3.cfg')
cherrypy.tree.mount(Mainpage(), config='myapp.cfg')

- Sylvain


Kevin Coyner

unread,
Jan 15, 2007, 6:20:55 AM1/15/07
to cherryp...@googlegroups.com

On Mon, Jan 15, 2007 at 10:22:20AM +0000, Sylvain Hellegouarch wrote......

> >index.py
> >---------------
> >class Mainpage(webpage.Webpage):
> > def __init__(self):
> ><snip>
> > html = cherrytemplate.renderTemplate(file="index.html")
> > return html
> > index.exposed = True
> >
> >config = cherrypy.config.update('cherrypy3.cfg')
>
> Are you sure the assignation is what you want here? AFAIK,
> update() will return None.

No I actually don't want to pass it None. I'd like to pass it
server.socketPort = 17700 as right now it keeps defaulting to 8080.


> >if __name__ == '__main__':
> > cherrypy.tree.mount(Mainpage(), config=config)
>
> Since config is now None you actually pass nothing to your application.
>
> > cherrypy.server.quickstart()
> > cherrypy.engine.start()

O.k., so now I've got the following:

if __name__ == '__main__':
cherrypy.config.update('cherrypy3.cfg')
cherrypy.tree.mount(Mainpage(), config='mysite.cfg')
cherrypy.server.quickstart()
cherrypy.engine.start()

and this does mount the tree, so no more error. But as I mentioned
above, I no longer can specify a specific port.

I've got:

mysite.cfg
--------------
[session]
server.socketPort = 17700
server.threadPool = 1
server.socketHost = "localhost"
log.error_file = "/home/mysite/logs/cherrypy.log"

I've also still got cherrypy3.cfg.

> >cherrypy3.cfg
> >---------------
> >[global]
> >server.socket_port = 17700
> >server.thread_pool = 1
> >tools.proxy.on = True
> >log.error_file = "/home/mysite/logs/cherrypy.log"
> >
> ><snip>
>
> Does your global config contain other sections. In theory you
> should only have the [global] one here and have a different file
> for the application config.

No, the [global] section now only has:

cherrypy3.cfg
---------------
[global]
server.socketPort = 17700
server.threadPool = 1
server.socketHost = "localhost"


So as I indicated above, I know do not have any warnings about an
Application not being mounted, but I've lost my ability to specify a
port.

Thanks
Kevin

Sylvain Hellegouarch

unread,
Jan 15, 2007, 6:46:19 AM1/15/07
to cherryp...@googlegroups.com
damn thunderbird that lost me my response, here it goes again...

see below


> mysite.cfg
> --------------
> [session]
> server.socketPort = 17700
> server.threadPool = 1
> server.socketHost = "localhost"
> log.error_file = "/home/mysite/logs/cherrypy.log"

This has nothing to do here and I'm sorry if I misled you. The
mysite.cfg only contains sections such as:

[/static/style.css]
blah blah

What you provide belongs to the [global] section because it only
interact with the HTTP/engine server.

>
> I've also still got cherrypy3.cfg.
>
>> >cherrypy3.cfg
>> >---------------
>> >[global]
>> >server.socket_port = 17700
>> >server.thread_pool = 1
>> >tools.proxy.on = True
>> >log.error_file = "/home/mysite/logs/cherrypy.log"
>> >
>> ><snip>
>>
>> Does your global config contain other sections. In theory you
>> should only have the [global] one here and have a different file
>> for the application config.

The [global] section goes into cherrypy3.cfg
The [/path] sections go into mysite.cfg


>
> No, the [global] section now only has:
>
> cherrypy3.cfg
> ---------------
> [global]
> server.socketPort = 17700
> server.threadPool = 1
> server.socketHost = "localhost"

Here's the rob, you must use lower_case :)

> [global]
> server.socket_port = 17700
> server.thread_pool = 1

> server.socket_host = "localhost"


- Sylvain

Kevin Coyner

unread,
Jan 15, 2007, 7:06:03 AM1/15/07
to cherryp...@googlegroups.com

On Mon, Jan 15, 2007 at 11:46:19AM +0000, Sylvain Hellegouarch wrote......

> The [global] section goes into cherrypy3.cfg
> The [/path] sections go into mysite.cfg
>
>
> >No, the [global] section now only has:
> >
> >cherrypy3.cfg
> >---------------
> >[global]
> >server.socketPort = 17700
> >server.threadPool = 1
> >server.socketHost = "localhost"
>
> Here's the rob, you must use lower_case :)
>
> >[global]
> >server.socket_port = 17700
> >server.thread_pool = 1
> >server.socket_host = "localhost"

O.k. That all makes sense now, and it is working perfectly.

I was following the docs at:

http://cherrypy.org/wiki/ConfigFile

which state to use the camelCaps style like:

socketPort = 8080

Should I submit a documentation bug for that?

Again, thanks.

fumanchu

unread,
Jan 15, 2007, 11:53:28 AM1/15/07
to cherrypy-users

If you like, but did you not notice the warning at the top of the page?

"This page holds true for Cherrypy 2.0.0, a new (but similar) config
system will ship with 2.1"

2.0 was a long time ago. ;)


Robert Brewer
System Architect
Amor Ministries
fuma...@amor.org

Kevin Coyner

unread,
Jan 15, 2007, 12:09:56 PM1/15/07
to cherryp...@googlegroups.com

On Mon, Jan 15, 2007 at 08:53:28AM -0800, fumanchu wrote......

> >I was following the docs at:
> >
> > http://cherrypy.org/wiki/ConfigFile
> >
> >which state to use the camelCaps style like:
> >
> > socketPort = 8080
> >
> >Should I submit a documentation bug for that?
>
> If you like, but did you not notice the warning at the top of the
> page?
>
> "This page holds true for Cherrypy 2.0.0, a new (but similar)
> config system will ship with 2.1"


Actually I did not notice that disclaimer. Rather I saw the
sentence right after, that starts with:

"In CherryPy 3, you use the configuration to set attributes ..."

Seeing the reference to CP 3, I assumed this page was up-to-date.

But clearly I was wrong. My fault for not reading completely and
thoroughly. Instead I selectively read, which can dangerous at any
time but particularly with the docs for CP since there are several
versions.

Sylvain Hellegouarch

unread,
Jan 15, 2007, 12:15:11 PM1/15/07
to cherryp...@googlegroups.com

True but the wiki layout doesn't always make things clear. Anyway it's
all solved now :D

- Sylvain

Reply all
Reply to author
Forward
0 new messages