pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Query tab goes blank when viewing empty geometry

Open jaygordon opened this issue 1 year ago • 3 comments

Describe the bug

If I execute a PostGIS query that returns geometry values, then click the "View all geometries in the column" button in the geometry column's header:

  • If all selected geometries are non-empty, the Geometry Viewer will correctly open and map the geometries.
  • But if one or more of the selected geometries are empty, the contents of that Query Tool tab go blank. Clicking anywhere in that blank tab has no effect, and the tab can't be closed.

To Reproduce

Steps to reproduce the behavior:

  1. Open a query tab.
  2. Load the PostGIS extension if it isn't already loaded: CREATE EXTENSION postgis;
  3. Execute the following query to return two rows, one with an empty geometry and the other with a non-empty one.
WITH intersections AS (
    SELECT 'intersection of two different points' lbl,
    ST_Intersection('POINT(0 0)', 'POINT(1 1)') geom
  UNION ALL
    SELECT 'intersection of two identical points' lbl,
    ST_Intersection('POINT(2 2)', 'POINT(2 2)') geom
)
SELECT lbl,
    ST_IsEmpty(geom), --a result of "true" confirms that the geometry is empty
    ST_SetSrid(geom, 4326) --return the geometry so we can try to map it
FROM intersections;
  1. Select only the row for the non-empty geometry and click the "View all geometries in the column" button (screenshot 1, below). The Geometry Viewer should open and map the point (screenshot 2).
  2. Select the row for the empty geometry (and optionally the non-empty geometry) and click the "View all geometries in the column" button (screenshot 3). The entire tab shoud go blank and become nonresponsive (screenshot 4).

Expected behavior

I would expect the Geometry Viewer to open and for any non-empty geometries to be mapped while any empty geometries would be omitted from the map. If all selected geometries are empty I would expect a blank map, or alternatively, a notification that all selected geometries are empty.

Error message

I don't know if an error message is issued because I can't seet the Messages subtab of the Query tab, as the Query tab is blank and nonresponsive.

Screenshots

  1. Map the non-empty geometry: image

  2. Result: image

  3. Map empty and non-empty geometries: image

  4. Result: image

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Version: 10.0.19045
  • Mode: Desktop
  • pgAdmin4 version: 8.9

jaygordon avatar Jul 01 '24 14:07 jaygordon

Hi @jaygordon,

Can you please share logs as well? You can find logs at File -> Runtime -> View log.

pravesh-sharma avatar Jul 02 '24 04:07 pravesh-sharma

Thanks, @pravesh-sharma . The log is below. I replaced some values with *** for privacy.

The last thing logged is the launching of pdAdmin. I Then replicated the bug but nothing is logged when that occurs.

pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Users\Jay\AppData\Local\Programs\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\Jay\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Users\Jay\AppData\Local\Programs\pgAdmin 4\web\config.py"
Webapp Path: "C:\Users\Jay\AppData\Local\Programs\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Users\Jay\AppData\Local\Programs\pgAdmin 4\python\python.exe -s C:\Users\Jay\AppData\Local\Programs\pgAdmin 4\web\pgAdmin4.py"
Environment: 
  - ALLUSERSPROFILE: C:\ProgramData
  - APPDATA: C:\Users\Jay\AppData\Roaming
  - asl.log: Destination=file
  - CAMLIBS: C:\Program Files\darktable\lib\libgphoto2\2.5.30
  - ChocolateyInstall: C:\ProgramData\chocolatey
  - ChocolateyLastPathUpdate: 132825893873287359
  - CHROME_CRASHPAD_PIPE_NAME: \\.\pipe\crashpad_30108_LDOOOQEOJJQCRDYO
  - CHROME_RESTART: NW.js|Whoa! NW.js has crashed. Relaunch now?|LEFT_TO_RIGHT
  - codeartifact_auth_token: ***
  - CommonProgramFiles: C:\Program Files\Common Files
  - CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
  - CommonProgramW6432: C:\Program Files\Common Files
  - COMPUTERNAME: ***
  - ComSpec: C:\Windows\system32\cmd.exe
  - DriverData: C:\Windows\System32\Drivers\DriverData
  - GDAL_DATA: C:\Program Files\PostgreSQL\12\gdal-data
  - HOMEDRIVE: C:
  - HOMEPATH: \Users\Jay
  - IGCCSVC_DB: ***
  - IOLIBS: C:\Program Files\darktable\lib\libgphoto2_port\0.12.1
  - JAVA_HOME: C:\Program Files\Java\jdk-11.0.20+8
  - LOCALAPPDATA: C:\Users\Jay\AppData\Local
  - LOGONSERVER: \\***
  - NUMBER_OF_PROCESSORS: 8
  - OneDrive: C:\Users\Jay\OneDrive
  - OS: Windows_NT
  - Path: C:\Users\Jay\AppData\Local\Programs\pgAdmin 4\runtime;C:\Python312\Scripts\;C:\Python312\;C:\Python311\Scripts\;C:\Python311\;C:\Python310\Scripts\;C:\Python310\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\Amazon\***\;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Java\jdk-11.0.20+8\bin;C:\Users\Jay\AppData\Roaming\npm;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Ruby30-x64\bin;C:\Users\Jay\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Java\jdk-11.0.20+8\bin;C:\Program Files\Apache Software Foundation\apache-maven-3.9.3\bin;C:\Users\Jay\AppData\Roaming\npm
  - PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
  - PGADMIN_INT_KEY: ***
  - PGADMIN_INT_PORT: 56656
  - PGADMIN_SERVER_MODE: OFF
  - POSTGIS_ENABLE_OUTDB_RASTERS: 1
  - POSTGIS_GDAL_ENABLED_DRIVERS: GTiff PNG JPEG GIF XYZ DTED USGSDEM AAIGrid
  - PROCESSOR_ARCHITECTURE: AMD64
  - PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
  - PROCESSOR_LEVEL: 6
  - PROCESSOR_REVISION: 8c01
  - ProgramData: C:\ProgramData
  - ProgramFiles: C:\Program Files
  - ProgramFiles(x86): C:\Program Files (x86)
  - ProgramW6432: C:\Program Files
  - PROJ_LIB: C:\Program Files\PostgreSQL\12\share\contrib\postgis-3.2\proj
  - PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
  - PUBLIC: C:\Users\Public
  - SESSIONNAME: Console
  - SystemDrive: C:
  - SystemRoot: C:\Windows
  - TEMP: C:\Users\Jay\AppData\Local\Temp
  - TMP: C:\Users\Jay\AppData\Local\Temp
  - USERDOMAIN: ***
  - USERDOMAIN_ROAMINGPROFILE: ***
  - USERNAME: Jay
  - USERPROFILE: C:\Users\Jay
  - windir: C:\Windows
  - ZES_ENABLE_SYSMAN: 1
--------------------------------------------------------

Total spawn time to start the pgAdmin4 server: 0.014 Sec
2024-07-03 09:44:56,127: WARNING	werkzeug:	Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead.

 * Serving Flask app 'pgadmin'
 * Debug mode: off

------------------------------------------
Total time taken to ping pgAdmin4 server: 5.048 Sec
------------------------------------------
Total launch time of pgAdmin4: 6.168 Sec
------------------------------------------
Application Server URL: http://127.0.0.1:56656/?key=***

jaygordon avatar Jul 03 '24 13:07 jaygordon

Here is the error - Screenshot 2024-07-12 at 4 52 29 PM

yogeshmahajan-1903 avatar Jul 12 '24 11:07 yogeshmahajan-1903

@pravesh-sharma please check the below issues:-

  1. You fixed the blank screen issue when user select both rows but when user only select single row whose value of isempty is true then it again goes on blank screen.

  2. when we able to see the geo view -> click on blue dot to see info of that -> opens a popup -> but there should be a value(true/false) of isempy field, attached an image:- Screenshot 2024-10-17 at 11 04 41 PM

  3. I have restore the countries.sql by which i got the data of countries and capitals so i checked and got same issue there:- a. When we select all rows of countries --> select geo view --> it goes on same blank screen issue attached an image of console errors:- Screenshot 2024-10-17 at 11 13 36 PM

RohitBhati8269 avatar Oct 18 '24 05:10 RohitBhati8269

The issue is fixed and verified on the latest snapshot build.

Env: OS - macOS 14.1 (Sonoma) Mode - Desktop

RohitBhati8269 avatar Oct 18 '24 09:10 RohitBhati8269