<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.Shkpostityyli18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Did you make the test that I suggested to run the same request for individual layers instead of the root layer “default”?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Lähettäjä:</span></b><span lang="EN-US"> mapserver-users <mapserver-users-bounces@lists.osgeo.org>
<b>Puolesta </b>Johannes Paul<br>
<b>Lähetetty:</b> torstai 23. tammikuuta 2020 21.56<br>
<b>Vastaanottaja:</b> Brian <mulcahy.brianp@gmail.com><br>
<b>Kopio:</b> mapserver-users@lists.osgeo.org<br>
<b>Aihe:</b> Re: [mapserver-users] cgi-error: End of script output before headers mapserv<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi Brian,<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">I'm not usinage fcgi on my side, and it is not related to file permission or bad cgi script.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">I've tried to work on my Osm postgis tables, and made the geom valid, like Jukka said, but it didn't change anything...<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US">I'm thinking it might be related with Apache MPM prefork module and the MaxRequestWorker ?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Keep in touch<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Le jeu. 23 janv. 2020 à 20:27, Brian <</span><a href="mailto:mulcahy.brianp@gmail.com" target="_blank"><span lang="EN-US">mulcahy.brianp@gmail.com</span></a><span lang="EN-US">> a écrit :<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span lang="EN-US">So I have this error as well. I mostly see it when a connection times out. Like you mapserver shows no errors but apache has the script ended before headers error. Do you have fcgi enabled? If I disable fcgi I don't get
that error, so It could be related to connection a user has to mapserver. Maybe FcgidMaxRequestsPerProcess, FcgidMinProcessesPerClass, FcgidMaxProcessesPerClass need to be tweaked?<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">If you do a google search on this error most of the responses says it is either due to a bad cgi script or bad file/dir permissions which in our case I doubt that is the reason. If you figure it out let me know.<o:p></o:p></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">On Wed, Jan 22, 2020 at 12:31 PM Rahkonen Jukka (MML) <</span><a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank"><span lang="EN-US">jukka.rahkonen@maanmittauslaitos.fi</span></a><span lang="EN-US">>
wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">I would suspect data, especially because it seems to be OSM data. Perhaps some invalid polygon again.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">You use &layers=default and I suppose that it means all the layers from your mapfile together. In that case I would try to catch the failing layer by adding layers
one by one and in groups (first &layers=layer1, then &layers=layer2, then &layers=layer1,layer2).
<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Hopefully that way you can find the failing layer, and then because you know the BBOX you may find the nasty geometry from the database. Without your data and
mapfile it is rather useless to make very much guesswork, but a small change in bbox may select/not select a bad geometry, of change of bbox may change scale so much that source data come from a different table if you have a scale dependent layer group in
the mapfile etc.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">If the issue is due to bad geometry and you use PostGIS you may find it with ST_IsValid and ST_IsValidReason, and correct with ST_MakeValid.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-Jukka Rahkonen-<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>Lähettäjä:</b> mapserver-users <<a href="mailto:mapserver-users-bounces@lists.osgeo.org" target="_blank">mapserver-users-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Johannes Paul<br>
<b>Lähetetty:</b> keskiviikko 22. tammikuuta 2020 13.02<br>
<b>Vastaanottaja:</b> <a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">
mapserver-users@lists.osgeo.org</a><br>
<b>Aihe:</b> [mapserver-users] cgi-error: End of script output before headers mapserv<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Hello,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">my mapserver is having a very strange behaviour, which I can't explain, nor debug.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">I'm using mapserver 7.0.0 along with apache http server 2.4.6.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Most of the time, the server is working just fine, i.e. when I request a typical URL, I get my image back:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="http://10.0.0.22/cgi-bin/mapserv?map=/var/www/html/osm-transp-en-default.map&VERSION=1.1.0&REQUEST=getmap&SERVICE=wms&STYLES=&BBOX=-9.143,38.746,-9.140,38.748&HEIGHT=256&WIDTH=256&LAYERS=default&FORMAT=image/png&SRS=EPSG:4326&TRANSPARENT=true" target="_blank"><span lang="EN-US">http://10.0.0.22/cgi-bin/mapserv?map=/var/www/html/osm-transp-en-default.map&VERSION=1.1.0&REQUEST=getmap&SERVICE=wms&STYLES=&BBOX=-9.143,38.746,-9.140,38.748&HEIGHT=256&WIDTH=256&LAYERS=default&FORMAT=image/png&SRS=EPSG:4326&TRANSPARENT=true</span></a><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">but then, when I slightly change bbox values, I get an internal server error (500):<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a href="http://10.0.0.22/cgi-bin/mapserv?map=/var/www/html/osm-transp-en-default.map&VERSION=1.1.0&REQUEST=getmap&SERVICE=wms&STYLES=&BBOX=-9.1433,38.7460,-9.1406,38.7487&HEIGHT=256&WIDTH=256&LAYERS=default&FORMAT=image/png&SRS=EPSG:4326&TRANSPARENT=true" target="_blank"><span lang="EN-US">http://10.0.0.22/cgi-bin/mapserv?map=/var/www/html/osm-transp-en-default.map&VERSION=1.1.0&REQUEST=getmap&SERVICE=wms&STYLES=&BBOX=-9.1433,38.7460,-9.1406,38.7487&HEIGHT=256&WIDTH=256&LAYERS=default&FORMAT=image/png&SRS=EPSG:4326&TRANSPARENT=true</span></a><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">I don't get any mapserver error log, but I do get an apache error log saying:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">[cgi:error] End of script output before headers: mapserv<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">This is really an strange behaviour which I can't explain.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Did anyone already experienced a similar situation ?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Thanks<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Jo<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US">_______________________________________________<br>
mapserver-users mailing list<br>
</span><a href="mailto:mapserver-users@lists.osgeo.org" target="_blank"><span lang="EN-US">mapserver-users@lists.osgeo.org</span></a><span lang="EN-US"><br>
</span><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank"><span lang="EN-US">https://lists.osgeo.org/mailman/listinfo/mapserver-users</span></a><span lang="EN-US"><o:p></o:p></span></p>
</blockquote>
</div>
<p class="MsoNormal"><span lang="EN-US">_______________________________________________<br>
mapserver-users mailing list<br>
</span><a href="mailto:mapserver-users@lists.osgeo.org" target="_blank"><span lang="EN-US">mapserver-users@lists.osgeo.org</span></a><span lang="EN-US"><br>
</span><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank"><span lang="EN-US">https://lists.osgeo.org/mailman/listinfo/mapserver-users</span></a><span lang="EN-US"><o:p></o:p></span></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>