Opened 12 years ago

Last modified 12 years ago

#4175 new defect

Mapserver 6.0.1 PostGIS connection String Corruption

Reported by: tpingenot Owned by: sdlime
Priority: normal Milestone: 6.0.2 release
Component: MapServer C Library Version: 6.0
Severity: normal Keywords: postgis connection string
Cc: dmorissette, aboudreault

Description

After upgrading from Mapserver 5.4 to 6.0.1 on linux with a custom build we found that including single quotes around dbname value in apostgis connection string causes an error. If you remove the single quotes it works. We have 20+ map files with 100+ layers with near identical setups that work fine with single quotes, so I'm not sure why it failed in this case, but the username and dbname were both 'interlocken'. Basic map file is attached.

MapServer Error: [Thu Feb 2 14:41:04 2012].823297 msPostGISLayerOpen(): Query error. Database connection failed (FATAL: no pg_hba.conf entry for host "[local]",user "interlocken", database "nterlocNken", SSL off ) with connect string 'dbname='nterlocNken' user='interlocken'

Map File Snippet

CONNECTIONTYPE postgis PROCESSING "CLOSE_CONNECTION=DEFER" CONNECTION "dbname='interlocken' user='interlocken' password=''" DATA 'the_geom FROM "ext_lighting_existing_point" USING UNIQUE gid USING srid=4326'

If you look in the postgres log file you see that the dbname getting submitted doesn't match, and so fails. Below is a line from the pg log file.

FATAL: no pg_hba.conf entry for host "[local]", user "interlocken", database "nterlocNken", SSL off

Attachments (1)

bug.map (3.1 KB ) - added by tpingenot 12 years ago.
Basic Map file with postgis layer

Download all attachments as: .zip

Change History (7)

by tpingenot, 12 years ago

Attachment: bug.map added

Basic Map file with postgis layer

comment:1 by sdlime, 12 years ago

Cc: aboudreault added

comment:2 by tbonfort, 12 years ago

Cc: dmorissette added; aboudreault removed
Milestone: FUTURE6.0.2 release

ccing Daniel as I think he was also involved in escaping characters in strings (note that this might not be the issue at stake, but seems like a possible cause)

comment:3 by tbonfort, 12 years ago

Cc: aboudreault added

comment:4 by aboudreault, 12 years ago

Fixed in r13066 and backported in r13069. tpingenot, it would be nice if you could confirm that my patch fixed your issue. We plan to release MapServer 6.0.2 this afternoon and It would be cool to be sure your issue will be fixed in that release.

comment:5 by tpingenot, 12 years ago

aboudreault,

Sorry I just got your message, I have to wait for the sys admin to rebuild mapserver with the new version, I'll try and get him to do it and let you know, but it may be a few days or more.

comment:6 by aboudreault, 12 years ago

Alright. The MapServer 6.0.2 has been released though, so you can try it directly.

Note: See TracTickets for help on using tickets.