3

I am receiving an error message in QGIS about my layer in PostGIS being invalid or the connection to the database terminating.

dbname='x' host=x port=5432 user='x' password='x' sslmode=disable key='""' srid=27700 type=LineStringZ table="x"."x" (wkb_geometry) sql= is an invalid layer - not loaded

Erroneous query: SELECT * FROM "x"."x" LIMIT 1 returned 7 [server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.] Unable to access the "x"."x" relation. The error message from the database was: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.

I am using QGIS 2.14.15 64bit LTR on a Windows 7 laptop and PostGIS 9.6 on a remote Windows 2012 server, but received similar errors using 2.18 and PostGIS 9.4.

The connection to the remote server is still active as I have a ping test running but the response times change from 1/2ms up to ~680ms when trying to access a simple data layer.

The data in the PostGIS database is spatially indexed and the table is VACUUM ANALYZED and each table has a Primary Key. So I don't think its the way the data is stored.

The real problem is that it does not happen every time, if I start a new project and add the same layers in the same way QGIS loads the data successfully.

Has anyone encountered this before?

  • 2
    have you tried looking at the table/data in pgAdmin? this may require some server-side configuration to allow connections but if you can access it you could try running some SQL queries through pgAdmin to see if you still get the same error – Alex May 31 '17 at 11:21
  • Good idea - just installed pgAdmin and I can successfully run different types of queries on any of the tables. So it all seems to be fine. – tjmgis May 31 '17 at 11:38
  • 1
    so you know your data is fine at least. as you say it's intermittent it could just be a dodgy internet connection, perhaps use wireshark to have a closer look. I haven't used it myself but I'm sure the web will provide all the instructions needed! – Alex May 31 '17 at 13:18
  • Are you using wifi on your laptop? – Mapperz May 31 '17 at 20:01
  • No it is on the LAN. – tjmgis Jun 1 '17 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.