Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interlis Import unsupported startup parameter: options #76

Closed
cymed opened this issue Jan 15, 2024 · 11 comments
Closed

Interlis Import unsupported startup parameter: options #76

cymed opened this issue Jan 15, 2024 · 11 comments

Comments

@cymed
Copy link
Contributor

cymed commented Jan 15, 2024

Describe the bug
When trying to import the any xtf, I received an psycopg2.OperationalError: connection to server at "%ip%", port %port% failed: FATAL: unsupported startup para

To Reproduce
Exact steps to reproduce the behavior:

  1. try to import the an xtf using the UI button
  2. See error

Expected behavior
XTF import

Screenshots / data
Error:

psycopg2.OperationalError: connection to server at "%ip%", port %port% failed: FATAL: unsupported startup parameter: options
Traceback (most recent call last):
File "C:\Users/%usr%/AppData/Roaming/QGIS/QGIS3\profiles\tww_dev/python/plugins\teksi_wastewater\teksi_wastewater_plugin.py", line 495, in actionImportClicked
self.interlisImporterExporter.action_import()
File "C:\Users/%usr%/AppData/Roaming/QGIS/QGIS3\profiles\tww_dev/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 106, in action_import
raise exception
File "C:\Users/%usr%/AppData/Roaming/QGIS/QGIS3\profiles\tww_dev/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 90, in action_import
self._action_import(xtf_file_input)
File "C:\Users/%usr%/AppData/Roaming/QGIS/QGIS3\profiles\tww_dev/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 180, in _action_import
self._clear_ili_schema(recreate_schema=True)
File "C:\Users/%usr%/AppData/Roaming/QGIS/QGIS3\profiles\tww_dev/python/plugins\teksi_wastewater\interlis\gui\interlis_importer_exporter.py", line 478, in clear_ili_schema
connection = psycopg2.connect(
File "C:\Users%usr%\AppData\Roaming\Python\Python39\site-packages\psycopg2_init
.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server at "%ip%", port %port% failed: FATAL: unsupported startup parameter: options

Desktop (please complete the following information):

  • TEKSI plugin version: dev
  • TEKSI datamodel version: dev
  • TEKSI project file version: 2024_01_15
  • QGIS Version - see the About menu: 3.28.11
  • Postgres: 12.17
  • Postgis: POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 " PROJ="6.3.1" LIBXML="2.9.4" LIBJSON="0.13.1" LIBPROTOBUF="1.3.3" WAGYU="0.4.3 (Internal)"
  • OS: Windows

Additional context

  • psycopg2 Version: 2.9.7 (dt dec pq3 ext lo64)
@sjib
Copy link
Contributor

sjib commented Jan 15, 2024

@cymed Wie machst du deine Datenbankverbindung? pg_conf?

@domi4484
Copy link
Contributor

Ip address and port (and in general postgres connection settings) are taken from the layer vw_tww_wastewater_structure. Do you have the project open?

@cymed
Copy link
Contributor Author

cymed commented Jan 16, 2024

@cymed Wie machst du deine Datenbankverbindung? pg_conf?

DB-connection via PGSYSCONFDIR, windows system variable overridden in qgis options. Project is open and working (inserting through wizard and directly adding entries to vw_tww_wastewater_structure).

@urskaufmann
Copy link
Contributor

Ich habe eine ähnliche Fehlermeldung, wenn ich im pgsysconfdir nicht user und passwort (postgres-passwort) eintrage, weil für das erstellen des Austauschschema das postgres-Passwort notwendig ist. Die Fehlermeldung hilft leider nicht direkt, dem auf die Spur zu kommen.

@cymed
Copy link
Contributor Author

cymed commented Jan 16, 2024

Ich habe eine ähnliche Fehlermeldung, wenn ich im pgsysconfdir nicht user und passwort (postgres-passwort) eintrage, weil für das erstellen des Austauschschema das postgres-Passwort notwendig ist. Die Fehlermeldung hilft leider nicht direkt, dem auf die Spur zu kommen.

User und Passwort sind im pgsysconfdir vorhanden

@cymed
Copy link
Contributor Author

cymed commented Jan 16, 2024

Found out the following things:

  • dump files do not include grant structure
  • grant structure is missing tww_app (see fix in add tww_app to 12_1_roles.sql #83)
  • TWW interlis import does use the qgis override pgsysconfdir
  • error remains

@cymed
Copy link
Contributor Author

cymed commented Jan 16, 2024

Error is thrown at

connection = psycopg2.connect(
get_pgconf_as_psycopg2_dsn(), options="-c statement_timeout=1000"
)

@cymed
Copy link
Contributor Author

cymed commented Jan 16, 2024

It might be a problem of connecting via pgbouncer, see https://stackoverflow.com/questions/69133440/django-error-on-connecting-to-postgres-unsupported-startup-parameter-options.
I could check whether setting ignore_startup_parameters to options works, but I have no writing rights on pgbouncer.ini

@sjib
Copy link
Contributor

sjib commented Jan 19, 2024

  • check for solution for options else remove options="-c statement_timeout=1000" @domi4484

domi4484 added a commit that referenced this issue Jan 19, 2024
domi4484 added a commit that referenced this issue Jan 19, 2024
@domi4484
Copy link
Contributor

domi4484 commented Jan 19, 2024

Fix uploaded in the plugin zip in discussion top post

domi4484 added a commit that referenced this issue Jan 19, 2024
@cymed
Copy link
Contributor Author

cymed commented Jan 22, 2024

Fixed by removing session timeout

@cymed cymed closed this as completed Jan 22, 2024
domi4484 added a commit that referenced this issue Jan 23, 2024
3nids pushed a commit that referenced this issue Jan 23, 2024
domi4484 added a commit that referenced this issue Jan 28, 2024
qgep qwat to ili is added as not submodule

Remove timeout option. Fix #76

Show logs button visible only if log_path is set

Add missing DSS classes. Fix #98

remove profile action

Update plugin/teksi_wastewater/interlis/interlis_importer_exporter.py

remove libs from source

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

fix

sudo

plugin-ci

no sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants