pgRouting / pgRoutingLayer

pgRouting Layer plugin for QGIS
https://qgis.pgrouting.org/
GNU General Public License v2.0
23 stars 18 forks source link

Error "definition of service "NULL" not found" when Service is not set on Connection #147

Open christian-skjetne opened 7 months ago

christian-skjetne commented 7 months ago

Problem When trying to load db connections that has a blank "Service" field it throws the following error: CRITICAL dbname:databasename, definition of service "NULL" not found

To Reproduce Create a db without setting the "Service" field. Error is thrown when pgRoutingLayer is loaded or trying to refresh the db list in the plugin.

The bug seems to be that the plugin expects this property to be None when it is not set, but it is actually "NULL" (string) It can be fix by checking if the service property is "NULL" and setting it to None if it is:

 if service == "NULL":
            service = None

in the connect method of the Connection class in "postgis.py" after loading the settings. I guess it could mess up if your service is actually called "NULL"

gitlsl commented 6 months ago

same issue+1 also sometime it show dbname:pg, connection to server at "127.0.0.1", port 5432 failed: fe_sendauth: no password supplied but qgis can connect the pg success