From moritz at casella.verplant.org Sun Feb 11 02:04:31 2007 From: moritz at casella.verplant.org (Moritz Lenz) Date: Sun, 11 Feb 2007 01:04:31 +0000 Subject: [Mapit] genmap.fcgi doesn't return images Message-ID: <45CE6B9F.10201@casella.verplant.org> Hi, I tried to setup mapit-1.0.2 on my local machine (Debian GNU/Linux 3.1 testing), and I'm having some difficulties, I hope you can help me. I adapted mapconfig.py and then ran checkconfig.py. It says at the end: Summary: all tile image files can be opened all tile image files can be loaded all marker image files can be opened all marker image files can be loaded 1 python file(s) can't be compiled/imported: modmapit `python modmapit` complains about not beeing able to load _apache, which appears to be due to the fact that it's not run from mode_python (I'm using the fastcgi interface). When I call showmap.fgci from the browser it shows me the borders of the image map, zoom icons etc. but no images. When I call the image map URL manually, It takes a very long time and then I get a 501 internal server error. The error.log file from apache2 says: [Sun Feb 11 00:35:08 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" (pid 24952) terminated by calling exit with status '0' [Sun Feb 11 00:35:08 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds [Sun Feb 11 00:40:08 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds [Sun Feb 11 00:45:07 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds [Sun Feb 11 00:45:07 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" restarted (pid 25137) /home/moritz/public_html/mapit/common.py:20: DeprecationWarning: Non-ASCII character '\xf6' in file /home/moritz/public_html/mapit/markerinfo.py on line 19, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details import mapconfig, tileinfo, markerinfo [Sun Feb 11 00:45:08 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" (pid 25137) terminated by calling exit with status '0' [Sun Feb 11 00:45:08 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds and sometimes: [Sun Feb 11 00:11:02 2007] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "/var/www/mapit/genmap.fcgi", referer: http://127.0.0.1/mapit/showmap.fcgi?x=16316&y=20640&width=400&height=400&scale=5&sameregion=0&autocenter=0 When I run `python genmap` I get: Content-type: image/png Traceback (most recent call last): File "genmap", line 42, in ? main() File "genmap", line 37, in main image = makemap.generate_map(parameters) File "/home/moritz/public_html/mapit/makemap.py", line 78, in generate_map image = PIL.Image.new("RGB", (result_width, result_height), 0xFFFFFFFF) File "/usr/lib/python2.4/site-packages/PIL/Image.py", line 1610, in new return Image()._new(core.fill(mode, size, color)) SystemError: new style getargs format but argument is not a tuple Any idea what might be wrong? In case it's important a few version numbers: python: 2.4.4-2 apache: 2.2.3-3.2 fastcgi: 2.4.2-8 Thanks in advance, Moritz -- Moritz Lenz http://moritz.faui2k3.org/ http://sudokugarden.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://www.intevation.de/pipermail/mapit/attachments/20070211/2e2bd4dc/signature.asc From bernhard at intevation.de Sun Feb 11 13:44:28 2007 From: bernhard at intevation.de (Bernhard Reiter) Date: Sun, 11 Feb 2007 13:44:28 +0100 Subject: [Mapit] genmap.fcgi doesn't return images In-Reply-To: <45CE6B9F.10201@casella.verplant.org> References: <45CE6B9F.10201@casella.verplant.org> Message-ID: <200702111344.33044.bernhard@intevation.de> Hi Moritz, On Sunday 11 February 2007 02:04, Moritz Lenz wrote: > I tried to setup mapit-1.0.2 on my local machine (Debian GNU/Linux 3.1 > testing) wouldn't this be "Sarge" which is stable? > , and I'm having some difficulties, I hope you can help me. We will sure try. :) > I adapted mapconfig.py and then ran checkconfig.py. It says at the end: > > Summary: > all tile image files can be opened > all tile image files can be loaded > all marker image files can be opened > all marker image files can be loaded > 1 python file(s) can't be compiled/imported: > modmapit > > `python modmapit` > complains about not beeing able to load _apache, which appears to be due > to the fact that it's not run from mode_python (I'm using the fastcgi > interface). Should be fine then. > When I call showmap.fgci from the browser it shows me the borders of the > image map, zoom icons etc. but no images. > > When I call the image map URL manually, It takes a very long time and > then I get a 501 internal server error. > When I run `python genmap` I get: > Content-type: image/png > > Traceback (most recent call last): This is the problem we need to concentrate on: > File "genmap", line 42, in ? > main() > File "genmap", line 37, in main > image = makemap.generate_map(parameters) > File "/home/moritz/public_html/mapit/makemap.py", line 78, in > generate_map image = PIL.Image.new("RGB", (result_width, result_height), > 0xFFFFFFFF) File "/usr/lib/python2.4/site-packages/PIL/Image.py", line > 1610, in new return Image()._new(core.fill(mode, size, color)) > SystemError: new style getargs format but argument is not a tuple > > Any idea what might be wrong? The problems seems to arise from PIL somehow. > In case it's important a few version numbers: > python: 2.4.4-2 > apache: 2.2.3-3.2 > fastcgi: 2.4.2-8 Apache and fastcgi are not yet in the picture, so it would be interesting which version of PIL you are using and how was it installed. Best, Bernhard -- Managing Director - Owner: www.intevation.net (Free Software Company); Germany Coordinator: fsfeurope.org. Coordinator: www.Kolab-Konsortium.com. Intevation GmbH, Amtsgericht Osnabr?ck, HRB 18998, USt-Id DE204854484 Gesch?ftsf?hrer Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.intevation.de/pipermail/mapit/attachments/20070211/f2c10706/attachment.bin From moritz at casella.verplant.org Sun Feb 11 23:19:35 2007 From: moritz at casella.verplant.org (Moritz Lenz) Date: Sun, 11 Feb 2007 22:19:35 +0000 Subject: [Mapit] genmap.fcgi doesn't return images In-Reply-To: <200702111344.33044.bernhard@intevation.de> References: <45CE6B9F.10201@casella.verplant.org> <200702111344.33044.bernhard@intevation.de> Message-ID: <45CF9677.4040705@casella.verplant.org> Hi, first thank you for your fast response. And sorry for PM, now to the list ;-) Bernhard Reiter wrote: > Hi Moritz, > > On Sunday 11 February 2007 02:04, Moritz Lenz wrote: >> I tried to setup mapit-1.0.2 on my local machine (Debian GNU/Linux 3.1 >> testing) > > wouldn't this be "Sarge" which is stable? Yes, it would. I was too sleepy when I wrote that. I have Etch aka testing aka 4.0 (iirc). > >> I adapted mapconfig.py and then ran checkconfig.py. It says at the end: >> >> Summary: >> all tile image files can be opened >> all tile image files can be loaded >> all marker image files can be opened >> all marker image files can be loaded >> 1 python file(s) can't be compiled/imported: >> modmapit >> >> `python modmapit` >> complains about not beeing able to load _apache, which appears to be due >> to the fact that it's not run from mode_python (I'm using the fastcgi >> interface). > > Should be fine then. > >> When I call showmap.fgci from the browser it shows me the borders of the >> image map, zoom icons etc. but no images. >> >> When I call the image map URL manually, It takes a very long time and >> then I get a 501 internal server error. > >> When I run `python genmap` I get: >> Content-type: image/png >> >> Traceback (most recent call last): > > This is the problem we need to concentrate on: > >> File "genmap", line 42, in ? >> main() >> File "genmap", line 37, in main >> image = makemap.generate_map(parameters) >> File "/home/moritz/public_html/mapit/makemap.py", line 78, in >> generate_map image = PIL.Image.new("RGB", (result_width, result_height), >> 0xFFFFFFFF) File "/usr/lib/python2.4/site-packages/PIL/Image.py", line >> 1610, in new return Image()._new(core.fill(mode, size, color)) >> SystemError: new style getargs format but argument is not a tuple >> >> Any idea what might be wrong? > > The problems seems to arise from PIL somehow. > >> In case it's important a few version numbers: >> python: 2.4.4-2 >> apache: 2.2.3-3.2 >> fastcgi: 2.4.2-8 > > Apache and fastcgi are not yet in the picture, > so it would be interesting which version of PIL you are using > and how was it installed. It was installed in the debian-way via apt-get/aptitude, version is 1.1.5-11. Oddly enough it works when I start genmap explictly with python-2.3 instead of 2.4, so I'll try to fall back to pyhton2.3. I change the shebang lines of all the python scripts to #!/usr/bin/python2.3 and when I run ./genmap from the command line I get the desired output (Content-Type: image/png, an empty line + binary data, which _is_ a png), but over the web server I still get the same errors. Is fastcgi somehow using a different interpreter from the one specified in the #!-line? (And yes, I restarted apache2 after changing the interpreter). Thanks again, Moritz -- Moritz Lenz http://moritz.faui2k3.org/ http://sudokugarden.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://www.intevation.de/pipermail/mapit/attachments/20070211/698fe2c3/signature.asc From bernhard at intevation.de Mon Feb 12 10:00:02 2007 From: bernhard at intevation.de (Bernhard Reiter) Date: Mon, 12 Feb 2007 10:00:02 +0100 Subject: [Mapit] genmap.fcgi doesn't return images In-Reply-To: <45CF9677.4040705@casella.verplant.org> References: <45CE6B9F.10201@casella.verplant.org> <200702111344.33044.bernhard@intevation.de> <45CF9677.4040705@casella.verplant.org> Message-ID: <200702121000.03195.bernhard@intevation.de> Hi Moritz, On Sunday 11 February 2007 23:19, Moritz Lenz wrote: > Bernhard Reiter wrote: > > On Sunday 11 February 2007 02:04, Moritz Lenz wrote: > Yes, it would. I was too sleepy when I wrote that. > I have Etch aka testing aka 4.0 (iirc). > >> When I run `python genmap` I get: > > This is the problem we need to concentrate on: > >> File "genmap", line 42, in ? > >> main() > >> File "genmap", line 37, in main > >> image = makemap.generate_map(parameters) > >> File "/home/moritz/public_html/mapit/makemap.py", line 78, in > >> generate_map image = PIL.Image.new("RGB", (result_width, result_height), > >> 0xFFFFFFFF) File "/usr/lib/python2.4/site-packages/PIL/Image.py", line > >> 1610, in new return Image()._new(core.fill(mode, size, color)) > >> SystemError: new style getargs format but argument is not a tuple > > The problems seems to arise from PIL somehow. > >> python: 2.4.4-2 > > it would be interesting which version of PIL you are using > > and how was it installed. > > It was installed in the debian-way via apt-get/aptitude, version is > 1.1.5-11. > > Oddly enough it works when I start genmap explictly with python-2.3 > instead of 2.4, Debian switched to new way to package python modules in testing (Etch). I suggest you do some tests with PIL directly (without Mapit) and python2.4 and then file a bug report with Debian. > so I'll try to fall back to pyhton2.3. Should work. > I change the shebang lines of all the python scripts to > #!/usr/bin/python2.3 > and when I run ./genmap from the command line I get the desired output > (Content-Type: image/png, an empty line + binary data, which _is_ a > png), but over the web server I still get the same errors. > > Is fastcgi somehow using a different interpreter from the one specified > in the #!-line? (And yes, I restarted apache2 after changing the > interpreter). You also need to shoot down the running processes of genmap.fcgi and showmap.fcgi. Bernhard -- Managing Director - Owner: www.intevation.net (Free Software Company); Germany Coordinator: fsfeurope.org. Coordinator: www.Kolab-Konsortium.com. Intevation GmbH, Amtsgericht Osnabr?ck, HRB 18998, USt-Id DE204854484 Gesch?ftsf?hrer Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.intevation.de/pipermail/mapit/attachments/20070212/3ed01e59/attachment.bin From bh at intevation.de Mon Feb 12 11:22:58 2007 From: bh at intevation.de (Bernhard Herzog) Date: Mon, 12 Feb 2007 11:22:58 +0100 Subject: [Mapit] genmap.fcgi doesn't return images In-Reply-To: <45CF9677.4040705@casella.verplant.org> (Moritz Lenz's message of "Sun\, 11 Feb 2007 22\:19\:35 +0000") References: <45CE6B9F.10201@casella.verplant.org> <200702111344.33044.bernhard@intevation.de> <45CF9677.4040705@casella.verplant.org> Message-ID: Moritz Lenz writes: >>> File "/home/moritz/public_html/mapit/makemap.py", line 78, in >>> generate_map image = PIL.Image.new("RGB", (result_width, result_height), >>> 0xFFFFFFFF) File "/usr/lib/python2.4/site-packages/PIL/Image.py", line >>> 1610, in new return Image()._new(core.fill(mode, size, color)) >>> SystemError: new style getargs format but argument is not a tuple >>> >>> Any idea what might be wrong? >> >> The problems seems to arise from PIL somehow. [...] > Oddly enough it works when I start genmap explictly with python-2.3 > instead of 2.4, so I'll try to fall back to pyhton2.3. The issue is probably that 0xFFFFFFFF is a long-int in Python 2.4 while it was an int in Python 2.3. PIL accepts an int as a color specification for RGB images. But a long-int is a different python type, and so PIL tries to interpret the long-int object as a tuple which leads to the error message above. A simple fix would be to replace the 0xFFFFFFFF with -1. 0x00FFFFFF would probably also work. Bernhard -- Intevation GmbH http://intevation.de/ Skencil http://skencil.org/ Thuban http://thuban.intevation.org/ From moritz at casella.verplant.org Mon Feb 12 13:56:24 2007 From: moritz at casella.verplant.org (Moritz Lenz) Date: Mon, 12 Feb 2007 12:56:24 +0000 Subject: [Mapit] genmap.fcgi doesn't return images In-Reply-To: References: <45CE6B9F.10201@casella.verplant.org> <200702111344.33044.bernhard@intevation.de> <45CF9677.4040705@casella.verplant.org> Message-ID: <45D063F8.2010306@casella.verplant.org> Hi, Bernhard Herzog wrote: > Moritz Lenz writes: > >>>> File "/home/moritz/public_html/mapit/makemap.py", line 78, in >>>> generate_map image = PIL.Image.new("RGB", (result_width, result_height), >>>> 0xFFFFFFFF) File "/usr/lib/python2.4/site-packages/PIL/Image.py", line >>>> 1610, in new return Image()._new(core.fill(mode, size, color)) >>>> SystemError: new style getargs format but argument is not a tuple >>>> >>>> Any idea what might be wrong? >>> The problems seems to arise from PIL somehow. > [...] >> Oddly enough it works when I start genmap explictly with python-2.3 >> instead of 2.4, so I'll try to fall back to pyhton2.3. > > The issue is probably that 0xFFFFFFFF is a long-int in Python 2.4 while > it was an int in Python 2.3. PIL accepts an int as a color > specification for RGB images. But a long-int is a different python > type, and so PIL tries to interpret the long-int object as a tuple which > leads to the error message above. A simple fix would be to replace the > 0xFFFFFFFF with -1. 0x00FFFFFF would probably also work. It works in the sense that I can run genmap from the command line with python2.4, but I still get the same errors in error.log, and a 501 when calling genmap.fcgi from the browser: [Mon Feb 12 10:43:09 2007] [warn] FastCGI: (dynamic) server "/var/www/mapit/genmap.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds I wonder if "dynamic" is the right mode to run genmap? If I understood that right there are three modes to run fast-cgi scripts, do I have to choose a particular mode? Anyway, I wrote a small test script (with code stolen from genmap.fcgi) to see if fast-cgi generally works for me, and it does. Best regards, Moritz P.S. this is the test program that works fine as fast-cgi script. #! /usr/bin/python -O import os, sys import socket import fcgi def main(): while(1): try: while fcgi.isFCGI(): req = fcgi.FCGI() print "Content-Type: text/plain" print print "Something" req.Finish() except socket.error: continue except Exception: break main() -- Moritz Lenz http://moritz.faui2k3.org/ http://sudokugarden.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://www.intevation.de/pipermail/mapit/attachments/20070212/5e37680d/signature.asc