pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.41k stars 632 forks source link

Query tab goes blank when viewing empty geometry #7655

Open jaygordon opened 2 months ago

jaygordon commented 2 months ago

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:

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;
  4. 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).
  5. 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):

pravesh-sharma commented 2 months ago

Hi @jaygordon,

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

jaygordon commented 2 months ago

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=***
yogeshmahajan-1903 commented 2 months ago

Here is the error -

Screenshot 2024-07-12 at 4 52 29 PM