jumpinjackie / mapguide-maestro

MapGuide Maestro
https://jumpinjackie.github.io/mapguide-maestro/
29 stars 20 forks source link

how to connect mapguide maestro to postgres 16? #151

Closed lqmnhakeem217 closed 2 weeks ago

lqmnhakeem217 commented 2 months ago

i been trying to connect my database server which are using postgres 16 to mapguide maestro which i have installed the latest version, but there seem to be an issue with fdo not matching latest version. is there a way to make a custom connection extension that can cater fdo connecting to pg16

lqmnhakeem217 commented 2 months ago

when i try to logging it require md5 auth but my db use scram-sha-256 auth

lqmnhakeem217 commented 2 months ago

FDO Connection Status: The remote server returned an error: (559) MgFdoException.: An exception occurred in FDO component. Error occurred in Feature Source (Session:c78f2942-38e1-11ef-8000-a0294205948e_en_MTI3LjAuMC4x0AFC0AFB0AFA//fafbc1bf-6c0c-4fdd-8e23-ee9884b0687a.FeatureSource): An exception occurred in FDO component. RDBMS: authentication method 10 not supported

jumpinjackie commented 2 months ago

It could be that the libpq.dll included with the MG/FDO install does not support this authentication type.

If you download a zip package of the latest postgresql 16 release and copy libpq.dll and dependent dlls to the FDO directory (overwriting existing files). Does this then work?

For the record, this is the full set of dependent dlls you need to copy alongside libpq.dll from the latest 16.3 binaries according to the Dependencies tool

2024_07_03_20_37_05_Dependencies_x64_

lqmnhakeem217 commented 2 months ago

Oh, I see. I thought I had already resolved the issue by following this guide: Error: Unable to load the FDO Provider library 'PostgreSQLProvider.dll' in Map 3D or Civil 3D 2020.

However, after your suggestion, I noticed some progress. But what does 'FDO Connection Status: False' mean? Does it indicate that my database username and password are incorrect? I am using superuser credentials, so it should work, right?

jumpinjackie commented 2 months ago

Not quite sure. MG connection status can obscure the underlying connection failure details.

A better test would be to try creating a PostgresSQL connection with FDO Toolbox with the updated libpq.dll and see what happens there.

lqmnhakeem217 commented 2 months ago

After using FDO Toolbox, I've been able to access the database smoothly. However, I'm unsure how to set this up with MapGuide Maestro. Could you provide some guidance on integrating FDO ToolBox with MapGuide Maestro?

Also, I encountered the following errors in the log files related to the 'FDO Connection Status: False' issue from my previous query:

System.Exception: The remote server returned an error: (559) MgConnectionFailedException.: Problem:\nCannot establish connection to the MapGuide Server.\n\nPossible Causes:\n-Your session has been idle for too long;\n-MapGuide Server is no longer responding;\n-Internet connection problems.\n\nSolution:\nRestart your application / session, restart the MapGuide Server service, or contact with the server administrator.

Updated:

  1. I editted MapGuide server config anything relating to connection or sessions to the max value still have the same issue
  2. Backup MapGuide/FDO files and Copy/paste FDOToolBox/FDO files to the MapGuide/FDO files to check if it works (It does not worked)
  3. Restarted MapGuide Services/IIS, Map Guide Maestro
jumpinjackie commented 1 month ago

I finally spun up a postgres16 docker image (using https://hub.docker.com/r/kartoza/postgis/) to test this and was able to connect from both MapGuide 4.0 Beta 1 and FDO Toolbox. I also verified this docker image uses scram-sha-256 auth.

So from this I can only assume your issue was this particular step:

  1. Backup MapGuide/FDO files and Copy/paste FDOToolBox/FDO files to the MapGuide/FDO files to check if it works (It does not worked)

You did not need to copy all the FDO files from FDO Toolbox, you only needed to copy in an updated libpq.dll and its dependencies from a postgres16 windows binaries zip file. For ease of reference, this is the full dll list you need to copy from the postgres16 windows binaries.

libcrypto-3-x64.dll
libiconv-2.dll
libintl-9.dll
libpq.dll
libssl-3-x64.dll
libwinpthread-1.dll