Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I tried to deploy my Pylons app using the instructions found here. This simply loads the default Pylons page when I visit the root of my domain. When I try to enter in any path, I receive the message

Unhandled Exception

An unhandled exception was thrown by the application.

When I view the error log for my application and the Apache error log, it seems Pylons always tries to route things to the error controller. However, note that the above message is not what my error controller should be outputting.

Any suggestions on what to check? I love developing with Pylons, but this is my first attempt at deployment. I've tried multiple configurations on multiple different web servers and I haven't had any luck.

UPDATE: Below is the config for my Pylons app (comments stripped to make it a bit shorter)

[DEFAULT]
smtp_server = localhost
error_email_from = paste@localhost

[server:main]
use = egg:PasteScript#flup_fcgi_thread

[app:main]
use = egg:linkdb
full_stack = true
static_files = true

cache_dir = %(here)s/data
beaker.session.key = linkdb
beaker.session.secret = b75f1813263ab9a082f67278daa26433

sqlalchemy.url = mysql://cclp:878048@mysql.mior.ca/ccorl

authkit.setup.enable = True
authkit.setup.method = form, cookie
authkit.form.authenticate.user.type = linkdb.model.auth:MyUsersFromDatabase
authkit.form.authenticate.user.data = linkdb.model
authkit.cookie.secret = c2b47614b6eb46c4bd7842cae10f27e4
authkit.cookie.signoutpath = /users/logout
authkit.form.template.obj = linkdb.model.auth:make_template

set debug = false

[loggers]
keys = root, routes, linkdb, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_routes]
level = INFO
handlers =
qualname = routes.middleware

[logger_linkdb]
level = DEBUG
handlers =
qualname = linkdb

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S

UPDATE: And here is the error log produced by the application (I'm paranoid, so I starred out the IP addresses)

DEBUG:authkit.authenticate.cookie:These cookies were found: []
DEBUG:authkit.authenticate.cookie:Our cookie 'authkit' value is therefore ''
DEBUG:authkit.authenticate.cookie:Remote addr '***.***.***.***', value '', include_ip True
DEBUG:pylons.wsgiapp:Setting up Pylons stacked object globals
DEBUG:pylons.wsgiapp:No controller found, returning 404 HTTP Not Found
DEBUG:authkit.authenticate.multi:Status: '404 Not Found', Headers: [('Content-Type', 'text/html; charset=UTF-8'), ('Content-Length', '154')]
DEBUG:authkit.authenticate.multi:Status checker recieved status '404 Not Found', headers [('Content-Type', 'text/html; charset=UTF-8'), ('Content-Length', '154')], intecept ['401']
DEBUG:authkit.authenticate.multi:Status checker returns False
DEBUG:authkit.authenticate.multi:Multi: No binding was found for the check
DEBUG:authkit.authenticate.cookie:These cookies were found: []
DEBUG:authkit.authenticate.cookie:Our cookie 'authkit' value is therefore ''
DEBUG:authkit.authenticate.cookie:Remote addr '***.***.***.***', value '', include_ip True
DEBUG:pylons.wsgiapp:Setting up Pylons stacked object globals
DEBUG:pylons.wsgiapp:Resolved URL to controller: u'error'
DEBUG:pylons.wsgiapp:Found controller, module: 'linkdb.controllers.error', class: 'ErrorController'
DEBUG:pylons.wsgiapp:Controller appears to be a class, instantiating
DEBUG:pylons.wsgiapp:Calling controller class with WSGI interface

UPDATE: This is the fcgi script my app is using

#!/usr/bin/env python
import logging
# Load the WSGI application from the config file
from paste.deploy import loadapp
wsgi_app = loadapp('config:/var/www/linkdb/production.ini')

# Deploy it using FastCGI
if __name__ == '__main__':
    logging.basicConfig(filename='/var/www/linkdb/error.log', level=logging.DEBUG)
    from flup.server.fcgi import WSGIServer
    WSGIServer(wsgi_app).run()
share|improve this question
add comment

migrated from stackoverflow.com Jul 16 '10 at 12:55

This question came from our site for professional and enthusiast programmers.

1 Answer

While you could debug the fcgid issue, you might find it much easier to deploy using mod_wsgi.

The issue you are probably running into is related to debug=true being set in your .ini file which doesn't work in a multi-threaded mode or code that does a print to STDOUT. If you can post more of your config, log lines, etc. it should be relatively easy to see what is wrong. Are actions within the root controller called? Did you alter your routes?

Did you use virtualenv to set up your environment (the go-pylons.py installer?) or did you use the system libraries and do easy_install in your root?

share|improve this answer
    
I'm not using virtual Python. I did use easy_install to put stuff in the root install. I do have custom routes, but all these work fine on my local machine. I'll post more of my config in the question above. –  Michael Mior Jul 17 '10 at 16:05
    
PS - I actually did forget to disable debugging, but changing that setting (and restarting the server) had no effect. –  Michael Mior Jul 17 '10 at 16:13
    
btw, I'm also happy to try mod_wsgi, but I haven't had any luck with this either. –  Michael Mior Jul 18 '10 at 23:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.