Re [UMN_MAPSERVER-USERS] postgis connection problem

Dave Potts dave.potts at PINAN.CO.UK
Thu Jan 11 19:57:09 EST 2007


Tried that.
Also tried the host name strings 127.0.0.1, 10.1.18, localhost,  not
defining a host string.  All with the same result.

"msDrawMap(): Image handling error. Failed to draw layer named 'castles'.
msPOSTGISLayerOpen(): Query error. couldnt make connection to DB with
connect string 'host=10.1.1.8 user=dave password=*******
dbname=castle'.Error reported was 'unknown host name: 10.1.1.8'.This error
occured when trying to make a connection to the specified postgresql
server. Most commonly this is caused by (1) incorrect connection string
(2) you didnt specify a 'user=...' in your connection string (3) the
postmaster (postgresql server) isnt running (4) you are not allowing
TCP/IP connection to the postmaster (5) your postmaster is not running on
the correct port - if its not on 5432 you must specify a 'port=...' (6)
the security on your system does not allow the webserver (usually user
'nobody') to make socket connections to the postmaster (7) you forgot to
specify a 'host=...' if the postmaster is on a different machine(8) you
made a typo"




I have tried disabling all of my virus checking software.
Tried differrent versions of the fwtool tool kit (fwtools 1.07, 1.12 and
1.13.  Also tried postgres 8.1.5 and 8.1.6 and postgis 1.2.

Since postgres is'nt reporting any error, failed connection attempts
etc,etc  I have assume that the problem, what ever it is lies somewhere
within mapserver.

Any suggestions welcome.

Dave.

PS another example

msDrawMap(): Image handling error. Failed to draw layer named 'castles'.
msPOSTGISLayerOpen(): Query error. couldnt make connection to DB with
connect string 'host=localhost user=dave password=*******
dbname=castle'.Error reported was 'unknown host name: localhost'.This
error occured when trying to make a connection to the specified postgresql
server. Most commonly this is caused by (1) incorrect connection string
(2) you didnt specify a 'user=...' in your connection string (3) the
postmaster (postgresql server) isnt running (4) you are not allowing
TCP/IP connection to the postmaster (5) your postmaster is not running on
the correct port - if its not on 5432 you must specify a 'port=...' (6)
the security on your system does not allow the webserver (usually user
'nobody') to make socket connections to the postmaster (7) you forgot to
specify a 'host=...' if the postmaster is on a different machine(8) you
made a typo



nslookup says
nslookup localhost
Server: pth-cdns01.plus.net
Address 212.159.13.49

Name: localhost
Address: 127.0.0.1



> Try this and see if it works better. Local connections are the default...
>
> CONNECTION "dbname=castle user=dave password=foobar"
>
> Dave Potts wrote:

> >> I am trying to connect to postgres database on my local machine
> >>
> >> The connect strings reads
> >>
> >> CONNECTION "dbname=castle user=dave password=foobar host=localhost
> >> port=5432"
> >>
> >> This gives an msPOSTGISLAyerOpen(): Query error, the reported error is
> >> "unknown hostname: localhost"
> >>
> >> Doing a nslookup on localhost gives the expected answer off 127.0.0.1
> >>
> >> Using the value 127.0.0.1 instead of the string localhost, gives the
> >> same error, but reporting the error unknown host name 127.0.0.1
> >>
> >> A telnet session to localhost 5432 connects , therefore the database is
> >> running on localhost,  I am not having any problems resolving names.
> >>
> >> A psql session to the database castle with the login dave and the
> >> password foobar works correctly
> >>
> >>
> >> SO why the error, any suggestions ?
> >>
> >> Dave.
>   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dave.potts.vcf
Type: text/x-vcard
Size: 85 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070112/82a943f2/dave.potts.vcf


More information about the mapserver-users mailing list