opengisch / QgisModelBaker

Create QGIS projects from database schemas or Interlis models
https://opengisch.github.io/QgisModelBaker/
GNU Lesser General Public License v3.0
55 stars 17 forks source link

ServiceNotFound issue on PG layers #944

Closed gacarrillor closed 4 months ago

gacarrillor commented 4 months ago

I've obtained the following error by first working with layers loaded using a pg_service, then loading PG layers with direct connection (no PG service involved), and switching the selected layer from the ones loaded via service to the ones not loaded via service.

Note: None of the layers were related to MB.

Log obtained by the First Aid plugin:

{
  "ExceptionDetails": {
    "Type": "ServiceNotFound",
    "Message": ""
  },
  "Environment": {
    "Qgis Version": "3.28.6-Firenze",
    "Operating System": "linux",
    "Locale": "en"
  },
  "Trace": [
    {
      "Name": "set_current_layer",
      "Filename": "dataset_selector.py",
      "LineNo": 81,
      "Variables": {
        "self": "<QgisModelBaker.gui.panel.dataset_selector.DatasetSelector object at 0x7943769dd2d0>",
        "layer": "<QgsVectorLayer: 'ethnic_group_type' (postgres)>",
        "source_provider": "<qgis._core.QgsVectorDataProvider object at 0x79441eefbf40>",
        "layer_model_topic_names": "",
        "configuration": "<QgisModelBaker.libs.modelbaker.iliwrapper.ili2dbconfig.Ili2DbCommandConfiguration object at 0x79441eeac040>",
        "schema_identificator": "localhost_c2e_02_public"
      }
    },
    {
      "Name": "get_configuration_from_sourceprovider",
      "Filename": "db_utils.py",
      "LineNo": 77,
      "Variables": {
        "provider": "<qgis._core.QgsVectorDataProvider object at 0x79441eefbf40>",
        "configuration": "<QgisModelBaker.libs.modelbaker.iliwrapper.ili2dbconfig.Ili2DbCommandConfiguration object at 0x79441eeac040>",
        "mode": "DbIliMode.pg",
        "valid": "False",
        "layer_source": "<QgsDataSourceUri: dbname='c2e_02' host=localhost port=5432 user='postgres' password='postgres' sslmode=disable key='id' checkPrimaryKeyUnicity='0' table=\"public\".\"ethnic_group_type\">"
      }
    },
    {
      "Name": "service_config",
      "Filename": "__init__.py",
      "LineNo": 69,
      "Variables": {
        "service_name": "",
        "conf_file_path": "None",
        "config": "<configparser.ConfigParser object at 0x79441eeafe50>"
      }
    }
  ]
}