[mapserver-users] mapserver6 (was 5) postgis connection problem

Carlos Ruiz boolean10001 at yahoo.com
Fri May 27 10:36:04 EDT 2011


Richard,

Just checking for the most common errors, and taking a look at this fragment of the layer's debug dump:


[Thu May 26 23:45:30 2011].568123 msPostGISLayerOpen(): Query error.
Database connection failed (could not connect to server: Permission denied
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5432?
could not connect to server: Permission denied
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5432?
 
Using GeoServer, you have posted this connection string:

host=localhost dbname=osm password=sssst user=geo

Using Mapserver, you have posted this other connection string:

host=localhost dbname=osm password=******* user=geo

You receive a "Database connection failed (could not connect to server: Permission denied)", this means that there's a problem 
with the connection parameters.

I can see a "sssst" password (5 chars) with Geoserver test and a "*******" password (7 chars) with Mapserver test, are you sure 
that you're using the same password ???

Also, if you're using HBA, you have to do the Geoserver and the Mapserver test in the same machine because the ip address.

Cheers from México


IC Carlos Ruiz



________________________________
From: Richard Duivenvoorde <rdmailings at duif.net>
To: mapserver-users at lists.osgeo.org
Sent: Friday, May 27, 2011 4:18 AM
Subject: Re: [mapserver-users] mapserver6 (was 5)  postgis connection problem

Sorry for wrong subject, I'm talking about mapserver6 here.

Ok, don't think it is a postgres/postgis problem...

Installed geoserver, and that is serving fine ....

Als0 tried mapserv from command line:
./mapserv -nh "QUERY_STRING=map=osmwm.map&mode=map" > /tmp/test11.png
also ok

mapfile snippet:

LAYER
    NAME test
    TYPE polygon
    STATUS default
    DEBUG 5
    CONNECTIONTYPE postgis
    CONNECTION "host=localhost dbname=osm password=sssst user=geo"
    DATA "way28992 from (select * from landuse2) as foo using unique
osm_id using srid=28992"
    FILTER "landuse in ('industrial', 'residential')"
    METADATA
      "WMS_TITLE"                     "test"
      "WMS_SRS"                       "EPSG:28992"
      "OWS_EXTENT"                    "-26000 296000 293000 634000"
    END
    CLASS
    STYLE
      COLOR 255 0 0
    END
    STYLE
      OUTLINECOLOR 0 0 0
      WIDTH 3
      ANTIALIAS TRUE
    END
    END #CLASS
  END



On 05/26/2011 11:58 PM, Richard Duivenvoorde wrote:
> Like somebody else in the list I have a strange problem with MS6 on a
> fresh RHEL6 machine. Running the same data and mapfile in an older MS works.
> Below as much info I could get.
> Anybody a clue?
> I can recompile or add debug statements if nessecary (will be on irc
> tomorrow morning)
> 
> Regards,
> 
> Richard Duivenvoorde
> 
> 
> I fail to get a postgres connection log somewhere on this machine...
> 
> a new installed RHEL6 machine:
> Red Hat Enterprise Linux Server release 6.0 (Santiago)
> 
> running
> "PostgreSQL 8.4.8 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
> 4.4.4 20100726 (Red Hat 4.4.4-13), 64-bit"
> and
> "1.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"
> 
> mapserver -v gives
> MapServer version 6.0.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML
> SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
> SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
> SUPPORTS=WCS_SERVER INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
> 
> I've done a gdal and mapserver compile myself
> 
> A database with OSM data and mapfile with connectionstring like:
> CONNECTION "host=localhost dbname=osm password=xxxx user=geo"
> keeps saying:
> Permission denied Is the server running on host "localhost" and
> accepting TCP/IP connections on port 5432? ) with connect string
> 'host=localhost dbname=osm password=******* user=geo'
> 
> while:
> - I can connect with that user/password via psql
> - can use shp2img and the same mapfile (generating a map)
> - can do
> ogrinfo -ro PG:'host=localhost user=geo password=xxxxxx dbname=osm' -sql
> "select count(*) from mytable"
> - even tried trust for all hosts in pg_hba.conf
> 
> setting debug in LAYER at 5
> 
> -- first part is from wms request (failing connection):
> [Thu May 26 23:45:30 2011].566614 msPostGISLayerOpen called: way28992
> from nl_osm_point using unique osm_id using srid=28992
> [Thu May 26 23:45:30 2011].566704 msPostGISLayerOpen: No connection in
> pool, creating a fresh one.
> [Thu May 26 23:45:30 2011].568103 msPostGISLayerOpen: Connection failure.
> [Thu May 26 23:45:30 2011].568123 msPostGISLayerOpen(): Query error.
> Database connection failed (could not connect to server: Permission denied
>         Is the server running on host "localhost" and accepting
>         TCP/IP connections on port 5432?
> could not connect to server: Permission denied
>         Is the server running on host "localhost" and accepting
>         TCP/IP connections on port 5432?
> ) with connect string 'host=localhost dbname=osm password=******* user=geo'
> Is the database running? Is it allowing connections? Does the specified
> user exist? Is the password valid? Is the database on the standard port?
> [Thu May 26 23:45:30 2011].568138 msDrawMap(): Image handling error.
> Failed to draw layer named 'plaatsen'.
> [Thu May 26 23:45:30 2011].568224 msPostGISLayerClose called: way28992
> from nl_osm_point using unique osm_id using srid=28992
> [Thu May 26 23:45:30 2011].568238 freeLayer(): freeing layer at 0x1c67250.
> [Thu May 26 23:45:30 2011].568243 msPostGISLayerIsOpen called.
> [Thu May 26 23:45:30 2011].568251 freeLayer(): freeing layer at 0x1c6a7f0.
> [Thu May 26 23:45:30 2011].568255 msPostGISLayerIsOpen called.
> 
> -- This part is from shp2img (connection succesfull):
> [Thu May 26 23:47:55 2011].3388 msLayerIsVisible(): Skipping layer
> (plaatsen) because no CLASS in the layer is in-scale for this MAP scale
> [Thu May 26 23:47:55 2011].3450 msLayerIsVisible(): Skipping layer
> (plaatsen) because no CLASS in the layer is in-scale for this MAP scale
> [Thu May 26 23:47:55 2011].3457 msLayerIsVisible(): Skipping layer
> (plaatsen) because no CLASS in the layer is in-scale for this MAP scale
> [Thu May 26 23:47:55 2011].3470 msPostGISLayerOpen called: way28992 from
> (select way28992, z_order, landuse, osm_id, name from nl_osm_polygon
> order by z_order) as foo using unique osm_id using srid=28992
> [Thu May 26 23:47:55 2011].3478 msPostGISLayerOpen: No connection in
> pool, creating a fresh one.
> [Thu May 26 23:47:55 2011].16884
> msConnPoolRegister(residentialandindustry,host=localhost dbname=osm
> password=xxxx user=geo,0x18ff430)
> [Thu May 26 23:47:55 2011].27950 msPostGISLayerOpen: Got PostGIS version
> 10500.
> [Thu May 26 23:47:55 2011].27963 msPostGISLayerFreeItemInfo called.
> [Thu May 26 23:47:55 2011].27971 msPostGISLayerInitItemInfo called.
> [Thu May 26 23:47:55 2011].27986 msPostGISLayerWhichShapes called.
> [Thu May 26 23:47:55 2011].27992 msPostGISParseData called.
> [Thu May 26 23:47:55 2011].28008 msPostGISParseData:
> unique_column=osm_id, srid=28992, geom_column_name=way28992,
> table_name=(select way28992, z_order, landuse, osm_id, name from
> nl_osm_polygon order by z_order) as foo
> [Thu May 26 23:47:55 2011].28012 msPostGISBuildSQL called.
> [Thu May 26 23:47:55 2011].28016 msPostGISBuildSQLItems called.
> [Thu May 26 23:47:55 2011].28021 msPostGISBuildSQLItems: 2 items requested.
> [Thu May 26 23:47:55 2011].28025 msPostGISBuildSQLFrom called.
> [Thu May 26 23:47:55 2011].28031 msPostGISBuildSQLWhere called.
> [Thu May 26 23:47:55 2011].28034 msPostGISBuildSQLSRID called.
> [Thu May 26 23:47:55 2011].28038 msPostGISBuildSQLSRID: SRID provided
> (28992)
> [Thu May 26 23:47:55 2011].28041 msPostGISBuildSQLBox called.
> ...
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110527/c68f269d/attachment.html


More information about the mapserver-users mailing list