Skip to content

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

Open
@christian-skjetne

Description

@christian-skjetne

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions