<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Richard,</div><div><br></div><div>Just checking for the most common errors, and taking a look at this fragment of the layer's debug dump:<br></div><div><br></div><div>[Thu May 26 23:45:30 2011].568123 msPostGISLayerOpen(): Query error.<br><span class="yshortcuts" id="lw_1306506285_3">Database connection</span> failed (could not connect to server: Permission denied<br>        Is the server running on host "localhost" and accepting<br>        TCP/IP connections on port 5432?<br>could not connect to server: Permission denied<br>        Is the server running on host "localhost" and accepting<br>        TCP/IP connections on port 5432?</div><div> <br>Using GeoServer, you have posted this connection string:<br><br>host=localhost dbname=osm password=sssst
 user=geo<br><br>Using Mapserver, you have posted this other connection string:<br><br>host=localhost dbname=osm password=******* user=geo<br><br>You receive a "<span class="yshortcuts" id="lw_1306506285_3">Database connection</span> failed (could not connect to server: Permission denied)", this means that there's a problem <br>with the connection parameters.<br><br>I can see a "sssst" password (5 chars) with Geoserver test and a "*******" password (7 chars) with Mapserver test, are you sure <br>that you're using the same password ???<br><br>Also, if you're using HBA, you have to do the Geoserver and the Mapserver test in the same machine because the ip address.<br><br>Cheers from México<br><br></div><div><font style="font-weight:bold;color:rgb(0, 96, 191);font-family:verdana, helvetica, sans-serif;" size="2">IC Carlos Ruiz</font><br><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><div style="font-family: times new
 roman, new york, times, serif; font-size: 12pt;"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Richard Duivenvoorde <rdmailings@duif.net><br><b><span style="font-weight: bold;">To:</span></b> mapserver-users@lists.osgeo.org<br><b><span style="font-weight: bold;">Sent:</span></b> Friday, May 27, 2011 4:18 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [mapserver-users] mapserver6 (was 5)  postgis connection problem<br></font><br>
Sorry for wrong subject, I'm talking about mapserver6 here.<br><br>Ok, don't think it is a postgres/postgis problem...<br><br>Installed geoserver, and that is serving fine ....<br><br>Als0 tried mapserv from command line:<br>./mapserv -nh "QUERY_STRING=map=osmwm.map&mode=map" > /tmp/test11.png<br>also ok<br><br>mapfile snippet:<br><br>LAYER<br>    NAME test<br>    TYPE polygon<br>    STATUS default<br>    DEBUG 5<br>    CONNECTIONTYPE postgis<br>    CONNECTION "host=localhost dbname=osm password=sssst user=geo"<br>    DATA "way28992 from (select * from landuse2) as foo using unique<br>osm_id using srid=28992"<br>    FILTER "landuse in ('industrial', 'residential')"<br>    METADATA<br>      "WMS_TITLE"                     "test"<br>      "WMS_SRS"         
              "EPSG:28992"<br>      "OWS_EXTENT"                    "-26000 296000 293000 634000"<br>    END<br>    CLASS<br>    STYLE<br>      COLOR 255 0 0<br>    END<br>    STYLE<br>      OUTLINECOLOR 0 0 0<br>      WIDTH 3<br>      ANTIALIAS TRUE<br>    END<br>    END #CLASS<br>  END<br><br><br><br>On 05/26/2011 11:58 PM, Richard Duivenvoorde wrote:<br>> Like somebody else in the list I have a strange problem with MS6 on a<br>> fresh RHEL6 machine. Running the same data and mapfile in an older MS works.<br>> Below as much info I could get.<br>> Anybody a clue?<br>> I can recompile or add debug statements if nessecary (will be on irc<br>> tomorrow morning)<br>> <br>> Regards,<br>> <br>> Richard
 Duivenvoorde<br>> <br>> <br>> I fail to get a postgres connection log somewhere on this machine...<br>> <br>> a new installed RHEL6 machine:<br>> Red Hat Enterprise Linux Server release 6.0 (Santiago)<br>> <br>> running<br>> "PostgreSQL 8.4.8 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)<br>> 4.4.4 20100726 (Red Hat 4.4.4-13), 64-bit"<br>> and<br>> "1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"<br>> <br>> mapserver -v gives<br>> MapServer version 6.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML<br>> SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV<br>> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER<br>> SUPPORTS=WCS_SERVER INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE<br>> <br>> I've done a gdal and mapserver compile myself<br>> <br>> A database with OSM data and mapfile with connectionstring like:<br>> CONNECTION "host=localhost dbname=osm
 password=xxxx user=geo"<br>> keeps saying:<br>> Permission denied Is the server running on host "localhost" and<br>> accepting TCP/IP connections on port 5432? ) with connect string<br>> 'host=localhost dbname=osm password=******* user=geo'<br>> <br>> while:<br>> - I can connect with that user/password via psql<br>> - can use shp2img and the same mapfile (generating a map)<br>> - can do<br>> ogrinfo -ro PG:'host=localhost user=geo password=xxxxxx dbname=osm' -sql<br>> "select count(*) from mytable"<br>> - even tried trust for all hosts in pg_hba.conf<br>> <br>> setting debug in LAYER at 5<br>> <br>> -- first part is from wms request (failing connection):<br>> [Thu May 26 23:45:30 2011].566614 msPostGISLayerOpen called: way28992<br>> from nl_osm_point using unique osm_id using srid=28992<br>> [Thu May 26 23:45:30 2011].566704 msPostGISLayerOpen: No connection in<br>> pool, creating a fresh
 one.<br>> [Thu May 26 23:45:30 2011].568103 msPostGISLayerOpen: Connection failure.<br>> [Thu May 26 23:45:30 2011].568123 msPostGISLayerOpen(): Query error.<br>> Database connection failed (could not connect to server: Permission denied<br>>         Is the server running on host "localhost" and accepting<br>>         TCP/IP connections on port 5432?<br>> could not connect to server: Permission denied<br>>         Is the server running on host "localhost" and accepting<br>>         TCP/IP connections on port 5432?<br>> ) with connect string 'host=localhost dbname=osm password=******* user=geo'<br>> Is the database running? Is it allowing connections? Does the specified<br>> user exist? Is the password valid? Is the database on the standard port?<br>> [Thu May 26 23:45:30 2011].568138 msDrawMap(): Image handling error.<br>> Failed to
 draw layer named 'plaatsen'.<br>> [Thu May 26 23:45:30 2011].568224 msPostGISLayerClose called: way28992<br>> from nl_osm_point using unique osm_id using srid=28992<br>> [Thu May 26 23:45:30 2011].568238 freeLayer(): freeing layer at 0x1c67250.<br>> [Thu May 26 23:45:30 2011].568243 msPostGISLayerIsOpen called.<br>> [Thu May 26 23:45:30 2011].568251 freeLayer(): freeing layer at 0x1c6a7f0.<br>> [Thu May 26 23:45:30 2011].568255 msPostGISLayerIsOpen called.<br>> <br>> -- This part is from shp2img (connection succesfull):<br>> [Thu May 26 23:47:55 2011].3388 msLayerIsVisible(): Skipping layer<br>> (plaatsen) because no CLASS in the layer is in-scale for this MAP scale<br>> [Thu May 26 23:47:55 2011].3450 msLayerIsVisible(): Skipping layer<br>> (plaatsen) because no CLASS in the layer is in-scale for this MAP scale<br>> [Thu May 26 23:47:55 2011].3457 msLayerIsVisible(): Skipping layer<br>> (plaatsen) because no
 CLASS in the layer is in-scale for this MAP scale<br>> [Thu May 26 23:47:55 2011].3470 msPostGISLayerOpen called: way28992 from<br>> (select way28992, z_order, landuse, osm_id, name from nl_osm_polygon<br>> order by z_order) as foo using unique osm_id using srid=28992<br>> [Thu May 26 23:47:55 2011].3478 msPostGISLayerOpen: No connection in<br>> pool, creating a fresh one.<br>> [Thu May 26 23:47:55 2011].16884<br>> msConnPoolRegister(residentialandindustry,host=localhost dbname=osm<br>> password=xxxx user=geo,0x18ff430)<br>> [Thu May 26 23:47:55 2011].27950 msPostGISLayerOpen: Got PostGIS version<br>> 10500.<br>> [Thu May 26 23:47:55 2011].27963 msPostGISLayerFreeItemInfo called.<br>> [Thu May 26 23:47:55 2011].27971 msPostGISLayerInitItemInfo called.<br>> [Thu May 26 23:47:55 2011].27986 msPostGISLayerWhichShapes called.<br>> [Thu May 26 23:47:55 2011].27992 msPostGISParseData called.<br>> [Thu May 26
 23:47:55 2011].28008 msPostGISParseData:<br>> unique_column=osm_id, srid=28992, geom_column_name=way28992,<br>> table_name=(select way28992, z_order, landuse, osm_id, name from<br>> nl_osm_polygon order by z_order) as foo<br>> [Thu May 26 23:47:55 2011].28012 msPostGISBuildSQL called.<br>> [Thu May 26 23:47:55 2011].28016 msPostGISBuildSQLItems called.<br>> [Thu May 26 23:47:55 2011].28021 msPostGISBuildSQLItems: 2 items requested.<br>> [Thu May 26 23:47:55 2011].28025 msPostGISBuildSQLFrom called.<br>> [Thu May 26 23:47:55 2011].28031 msPostGISBuildSQLWhere called.<br>> [Thu May 26 23:47:55 2011].28034 msPostGISBuildSQLSRID called.<br>> [Thu May 26 23:47:55 2011].28038 msPostGISBuildSQLSRID: SRID provided<br>> (28992)<br>> [Thu May 26 23:47:55 2011].28041 msPostGISBuildSQLBox called.<br>> ...<br>> _______________________________________________<br>> mapserver-users mailing list<br>> <a
 ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>> http://lists.osgeo.org/mailman/listinfo/mapserver-users<br><br>_______________________________________________<br>mapserver-users mailing list<br><a ymailto="mailto:mapserver-users@lists.osgeo.org" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br><br><br></div></div></div></body></html>