I’m trying to get a site working again which lost a developer and a lot of undocumented information — desperate for help. The site was working with the below configuration, and my feeling is that I’m not getting cherrypy (cherryd?) started properly.
The site is not using name-based virtual hosts, everything is/was running fine using the ip address. We’re not using mod_python and cherrypy doesn’t start with apache.
We’re routing some requests to cherrypy via rewrite rules in .htaccess
RewriteRule ^ip/(.*) http://127.0.0.1:8081/$1 [proxy]
The config file: (cpconfig.conf)
[global]
server.socket_port = 8081
The command to start cherryd that isn’t working for me:
cherryd -d -i imageproc -c cpconfig.conf
Cherrypy appears to start:
ENGINE Listening for SIGHUP.
ENGINE Listening for SIGTERM.
ENGINE Listening for SIGUSR1.
ENGINE Bus STARTING
ENGINE Started monitor thread '_TimeoutMonitor'.
ENGINE Started monitor thread 'Autoreloader'.
ENGINE Serving on 127.0.0.1:8081
ENGINE Bus STARTED
and most of our app works fine. The app is a design tool that uses inputs and image-uploads to render an image on-screen. The text-inputs work fine. However when we use the file-upload portion of the app, the file appears to upload (according to chrome’s progress indicator) and then it just waits, times out, and eventually returns a 502 proxy error?
During this waiting/time-out time I can use the other text inputs etc. and the cherrypy server responds quickly.. it’s just choking on the image.
Here’s what Apache shows. The long encoded URLs represent changes to the image on the canvas, all which return OK. But then the file upload fails..
[Tue Jan 22 19:56:11 2013] [debug] proxy_util.c(1513): [client 67.176.56.45] proxy: *: found reverse proxy worker for http://127.0.0.1:8081/render?w=805&h=470&z=0.2&l=%5B%7B%22t%22%3A%2233%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%5D&g=%5B%5D&b=, referer: http://97.107.141.248/design/new/1209
[Tue Jan 22 19:56:11 2013] [debug] mod_proxy.c(993): Running scheme http handler (attempt 0)
[Tue Jan 22 19:56:11 2013] [debug] mod_proxy_http.c(1940): proxy: HTTP: serving URL http://127.0.0.1:8081/render?w=805&h=470&z=0.2&l=%5B%7B%22t%22%3A%2233%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%5D&g=%5B%5D&b=
[Tue Jan 22 19:56:11 2013] [debug] proxy_util.c(1999): proxy: HTTP: has acquired connection for (*)
[Tue Jan 22 19:56:11 2013] [debug] proxy_util.c(2055): proxy: connecting http://127.0.0.1:8081/render?w=805&h=470&z=0.2&l=%5B%7B%22t%22%3A%2233%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%5D&g=%5B%5D&b= to 127.0.0.1:8081
[Tue Jan 22 19:56:11 2013] [debug] proxy_util.c(2153): proxy: connected /render?w=805&h=470&z=0.2&l=%5B%7B%22t%22%3A%2233%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%2C%7B%22t%22%3A%22%22%2C%22b%22%3Afalse%2C%22i%22%3Afalse%2C%22u%22%3Afalse%2C%22a%22%3A%22c%22%2C%22fs%22%3A11%2C%22f%22%3A0%2C%22x%22%3A0%2C%22y%22%3A0%2C%22arc%22%3Afalse%2C%22o%22%3A0%2C%22r%22%3A0%2C%22cw%22%3Atrue%7D%5D&g=%5B%5D&b= to 127.0.0.1:8081
[Tue Jan 22 19:56:11 2013] [debug] proxy_util.c(2308): proxy: HTTP: fam 2 socket created to connect to *
[Tue Jan 22 19:56:11 2013] [debug] proxy_util.c(2414): proxy: HTTP: connection complete to 127.0.0.1:8081 (127.0.0.1)
[Tue Jan 22 19:56:11 2013] [debug] mod_proxy_http.c(1723): proxy: start body send
[Tue Jan 22 19:56:11 2013] [debug] mod_proxy_http.c(1816): proxy: end body send
[Tue Jan 22 19:56:11 2013] [debug] proxy_util.c(2017): proxy: HTTP: has released connection for (*)
[Tue Jan 22 19:56:21 2013] [debug] proxy_util.c(1513): [client 67.176.56.45] proxy: *: found reverse proxy worker for http://127.0.0.1:8081/upload, referer: http://97.107.141.248/design/new/1209
[Tue Jan 22 19:56:21 2013] [debug] mod_proxy.c(993): Running scheme http handler (attempt 0)
[Tue Jan 22 19:56:21 2013] [debug] mod_proxy_http.c(1940): proxy: HTTP: serving URL http://127.0.0.1:8081/upload
[Tue Jan 22 19:56:21 2013] [debug] proxy_util.c(1999): proxy: HTTP: has acquired connection for (*)
[Tue Jan 22 19:56:21 2013] [debug] proxy_util.c(2055): proxy: connecting http://127.0.0.1:8081/upload to 127.0.0.1:8081
[Tue Jan 22 19:56:21 2013] [debug] proxy_util.c(2153): proxy: connected /upload to 127.0.0.1:8081
[Tue Jan 22 19:56:21 2013] [debug] proxy_util.c(2308): proxy: HTTP: fam 2 socket created to connect to *
[Tue Jan 22 19:56:21 2013] [debug] proxy_util.c(2414): proxy: HTTP: connection complete to 127.0.0.1:8081 (127.0.0.1)
[Tue Jan 22 20:01:22 2013] [error] [client 67.176.56.45] (70007)The timeout specified has expired: proxy: error reading status line from remote server 127.0.0.1, referer: http://97.107.141.248/design/new/1209
[Tue Jan 22 20:01:22 2013] [debug] mod_proxy_http.c(1401): [client 67.176.56.45] proxy: read timeout, referer: http://97.107.141.248/design/new/1209
[Tue Jan 22 20:01:22 2013] [error] [client 67.176.56.45] proxy: Error reading from remote server returned by /ip/upload, referer: http://97.107.141.248/design/new/1209
[Tue Jan 22 20:01:22 2013] [debug] proxy_util.c(2017): proxy: HTTP: has released connection for (*)
If there’s a better way to communicate logs please let me know what is preferred..
Anyway, there’s nothing else listening on 8081..
Does this signal some kind of error in the app itself having to do with the image upload? I’ve tried restoring app code to a point in time where everything worked, killing and restarting cherrypy per the above (cherryd), and it still doesn’t work.
New information:
Running my app like so:
python imageproc.py
Does the trick, as there is a quickstart call in my app. No port issues, images will upload, everything works. But of course closing the term window kills the process. So I’m still looking for the proper way to get cherrypy off the ground.
Like I said desperate for any pointers.. thanks
Could well be the size of your image is larger than the default allowed request entity size set by CherryPy (which is 100Mb IIRC).
When the request entity is larger than the treshold, CherryPy aborts the requests and responds with a 413 error code.
Try setting the following value in your global config:
This will set it to 200Mb.
Edit: Here is the way to turn the CherryPy process into a daemon: