3liz / lizmap-web-client

Transfer a QGIS project on a server, Lizmap is providing the web interface to browse it
https://www.lizmap.com
Mozilla Public License 2.0
261 stars 144 forks source link

[Bug]: attribute table features displaying randomly #2541

Open nboisteault opened 3 years ago

nboisteault commented 3 years ago

What is the bug?

Attribute table features are displaying randomly with filter_layer_data_by_polygon_for_groups test project. This cause https://github.com/3liz/lizmap-web-client/blob/master/tests/end2end/cypress/integration/filter_layer_data_by_polygon_for_groups_spec.js#L138 to fail randomly.

Steps to reproduce the issue

  1. launch docker test stack
  2. go to http://localhost:8130/index.php/view/map/?repository=testsrepository&project=filter_layer_data_by_polygon_for_groups
  3. display whatever attribute tables
  4. features are not always returned by WFS request

https://user-images.githubusercontent.com/2145040/137699333-76bb7240-93ae-4755-8082-d2bb61005784.mp4

Lizmap version

master

QGIS desktop version

3.16.11

QGIS server version

3.16.11

Operating system

Ubuntu

Browsers

Chrome

Browsers version

94

Relevant log output

Logs with correct response :

lizmapmaster_test_qgis | 2021-10-18 08:41:49,208    DEBUG   [41]    REQUEST b'OWS-SERVER-1' b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,208    DEBUG   [41]    SND client: b'OWS-SERVER-1' -> worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,208    DEBUG   [51]    RCV b'OWS-SERVER-1': b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,209    DEBUG   [51]    Handling request: b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,209    DEBUG   [51]    Resolving 'file' protocol
lizmapmaster_test_qgis | 2021-10-18 08:41:49,210    WARNING [51]    Qgis: : Warning: error parsing post data as XML: at line 1, column 1: unexpected end of file. Assuming urlencoded query string sent in the post body.
lizmapmaster_test_qgis | 2021-10-18 08:41:49,210    DEBUG   [51]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:41:49,210    DEBUG   [51]    Qgis: Lizmap: No lizmap user groups in request headers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,211    DEBUG   [51]    Qgis: Lizmap: Lizmap user groups in parameters : group_a,__priv_user_in_group_a,users
lizmapmaster_test_qgis | 2021-10-18 08:41:49,211    DEBUG   [51]    Qgis: Lizmap: No acl defined in Lizmap config
lizmapmaster_test_qgis | 2021-10-18 08:41:49,211    DEBUG   [51]    Qgis: Server: GEOMETRYNAME:extent
lizmapmaster_test_qgis | 2021-10-18 08:41:49,211    DEBUG   [51]    Qgis: Server: LIZMAP_OVERRIDE_FILTER:0
lizmapmaster_test_qgis | 2021-10-18 08:41:49,211    DEBUG   [51]    Qgis: Server: LIZMAP_USER:user_in_group_a
lizmapmaster_test_qgis | 2021-10-18 08:41:49,212    DEBUG   [51]    Qgis: Server: LIZMAP_USER_GROUPS:group_a, __priv_user_in_group_a, users
lizmapmaster_test_qgis | 2021-10-18 08:41:49,212    DEBUG   [51]    Qgis: Server: MAP:tests/filter_layer_data_by_polygon_for_groups.qgs
lizmapmaster_test_qgis | 2021-10-18 08:41:49,212    DEBUG   [51]    Qgis: Server: OUTPUTFORMAT:GeoJSON
lizmapmaster_test_qgis | 2021-10-18 08:41:49,212    DEBUG   [51]    Qgis: Server: REQUEST:getfeature
lizmapmaster_test_qgis | 2021-10-18 08:41:49,213    DEBUG   [51]    Qgis: Server: SERVICE:WFS
lizmapmaster_test_qgis | 2021-10-18 08:41:49,214    DEBUG   [51]    Qgis: Server: TYPENAME:shop_bakery
lizmapmaster_test_qgis | 2021-10-18 08:41:49,214    DEBUG   [51]    Qgis: Server: VERSION:1.0.0
lizmapmaster_test_qgis | 2021-10-18 08:41:49,214    WARNING [51]    Qgis: : Service WFS 1.0.0 not found, returning default
lizmapmaster_test_qgis | 2021-10-18 08:41:49,215    DEBUG   [51]    Qgis: Server: WFS Request parameters:
lizmapmaster_test_qgis | 2021-10-18 08:41:49,215    DEBUG   [51]    Qgis: Server:  - OUTPUTFORMAT : GeoJSON
lizmapmaster_test_qgis | 2021-10-18 08:41:49,215    DEBUG   [51]    Qgis: Server:  - TYPENAME : shop_bakery
lizmapmaster_test_qgis | 2021-10-18 08:41:49,215    DEBUG   [51]    Qgis: Server:  - GEOMETRYNAME : extent
lizmapmaster_test_qgis | 2021-10-18 08:41:49,215    DEBUG   [51]    Qgis: Server:  - VERSION : 1.0.0
lizmapmaster_test_qgis | 2021-10-18 08:41:49,216    DEBUG   [51]    Qgis: AccessControlFilter: QgsAccessControlFilter plugin default layerPermissions called
lizmapmaster_test_qgis | 2021-10-18 08:41:49,216    DEBUG   [51]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:41:49,216    DEBUG   [51]    Qgis: Lizmap: No lizmap user groups in request headers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,217    DEBUG   [51]    Qgis: Lizmap: Lizmap user groups in parameters : group_a,__priv_user_in_group_a,users
lizmapmaster_test_qgis | 2021-10-18 08:41:49,217    DEBUG   [51]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:41:49,217    DEBUG   [51]    Qgis: Lizmap: No lizmap user login in request headers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,217    DEBUG   [51]    Qgis: Lizmap: Lizmap user login in parameters : user_in_group_a
lizmapmaster_test_qgis | 2021-10-18 08:41:49,219    DEBUG   [51]    Qgis: Lizmap: No edition config defined for layer: shop_bakery (points_241855da_7b4f_45e2_a5ac_c84f869f9f9d)
lizmapmaster_test_qgis | 2021-10-18 08:41:49,221    DEBUG   [51]    Qgis: Lizmap: No Lizmap layer group visibility for: shop_bakery
lizmapmaster_test_qgis | 2021-10-18 08:41:49,221    DEBUG   [51]    Qgis: Lizmap: Lizmap layerFilterSubsetString
lizmapmaster_test_qgis | 2021-10-18 08:41:49,221    DEBUG   [51]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:41:49,221    DEBUG   [51]    Qgis: Lizmap: No lizmap override filter in request headers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,221    DEBUG   [51]    Qgis: Lizmap: Lizmap override filter in parameters
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: No lizmap user groups in request headers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: Lizmap user groups in parameters : group_a,__priv_user_in_group_a,users
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: No lizmap user login in request headers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: Lizmap user login in parameters : user_in_group_a
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: No editing context found in request headers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,222    DEBUG   [51]    Qgis: Lizmap: No lizmap editing context filter in parameters : default value false
lizmapmaster_test_qgis | 2021-10-18 08:41:49,270    DEBUG   [51]    Qgis: Lizmap: _polygon_for_groups_with_qgis_api ran in 0.05s
lizmapmaster_test_qgis | 2021-10-18 08:41:49,294    DEBUG   [51]    Qgis: Lizmap: _features_ids_with_qgis_api ran in 0.02s
lizmapmaster_test_qgis | 2021-10-18 08:41:49,294    DEBUG   [51]    Qgis: Lizmap: subset_sql ran in 0.07s
lizmapmaster_test_qgis | 2021-10-18 08:41:49,294    DEBUG   [51]    Qgis: Lizmap: The polygon filter subset string is not null : "id" IN ( 119 , 163 , 168 , 103 , 16 )
lizmapmaster_test_qgis | 2021-10-18 08:41:49,294    DEBUG   [51]    Qgis: Lizmap: Lizmap config has no loginFilteredLayers
lizmapmaster_test_qgis | 2021-10-18 08:41:49,295    DEBUG   [51]    Qgis: Lizmap: get_lizmap_layer_filter ran in 0.07s
lizmapmaster_test_qgis | 2021-10-18 08:41:49,309    DEBUG   [51]    Qgis: AccessControlFilter: QgsAccessControlFilter plugin default authorizedLayerAttributes called
lizmapmaster_test_qgis | 2021-10-18 08:41:49,320    DEBUG   [51]    b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03': Flushing response data: (348 bytes)
lizmapmaster_test_qgis | 2021-10-18 08:41:49,322    DEBUG   [41]    SND worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,322    DEBUG   [51]    b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03': Flushing response data: (266 bytes)
lizmapmaster_test_qgis | 2021-10-18 08:41:49,322    DEBUG   [41]    SND worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,323    DEBUG   [51]    b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03': Flushing response data: (259 bytes)
lizmapmaster_test_qgis | 2021-10-18 08:41:49,323    RREQ    [1]     206 POST    http://map:8080/ows/?GEOMETRYNAME=extent&MAP=tests%2Ffilter_layer_data_by_polygon_for_groups.qgs&OUTPUTFORMAT=GeoJSON&REQUEST=getfeature&SERVICE=WFS&TYPENAME=shop_bakery&VERSION=1.0.0&LIZMAP_USER=user_in_group_a&LIZMAP_USER_GROUPS=group_a%2C+__priv_user_in_group_a%2C+users&LIZMAP_OVERRIDE_FILTER=0  116 -1  
lizmapmaster_test_qgis | 2021-10-18 08:41:49,324    DEBUG   [41]    SND worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,324    DEBUG   [51]    b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03': Flushing response data: (267 bytes)
lizmapmaster_test_qgis | 2021-10-18 08:41:49,324    DEBUG   [51]    b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03': Flushing response data: (267 bytes)
lizmapmaster_test_qgis | 2021-10-18 08:41:49,324    DEBUG   [41]    SND worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,324    DEBUG   [41]    SND worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,325    DEBUG   [51]    b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03': Flushing response data: (4 bytes)
lizmapmaster_test_qgis | 2021-10-18 08:41:49,326    DEBUG   [51]    Qgis: Server: Request finished in 115 ms
lizmapmaster_test_qgis | 2021-10-18 08:41:49,326    DEBUG   [41]    SND worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,326    DEBUG   [41]    SND worker: b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'<\x01\xbd\x8e/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,326    DEBUG   [41]    READY b'\xe5\x85V\x14/\xe4\x11\xec\x86c\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:41:49,327    REQ [1] 172.25.0.6  200 POST    /ows/?geometryname=extent&map=tests%2Ffilter%5Flayer%5Fdata%5Fby%5Fpolygon%5Ffor%5Fgroups%2Eqgs&outputformat=GeoJSON&request=getfeature&service=WFS&typename=shop%5Fbakery&version=1%2E0%2E0&Lizmap%5FUser=user%5Fin%5Fgroup%5Fa&Lizmap%5FUser%5FGroups=group%5Fa%2C%20%5F%5Fpriv%5Fuser%5Fin%5Fgroup%5Fa%2C%20users&Lizmap%5FOverride%5FFilter=0   120 -1  Lizmap  
lizmapmaster_test_nginx | 172.25.0.1 - - [18/Oct/2021:08:41:49 +0000] "POST /index.php/lizmap/service/?repository=testsrepository&project=filter_layer_data_by_polygon_for_groups HTTP/1.1" 200 1411 "http://localhost:8130/index.php/view/map/?repository=testsrepository&project=filter_layer_data_by_polygon_for_groups" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
lizmapmaster_test_nginx | 172.25.0.1 - - [18/Oct/2021:08:41:49 +0000] "GET /assets/js/dataTables/fr_FR.json HTTP/1.1" 200 1105 "http://localhost:8130/index.php/view/map/?repository=testsrepository&project=filter_layer_data_by_polygon_for_groups" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"

Logs with empty array for features :

lizmapmaster_test_qgis | 2021-10-18 08:42:23,353    DEBUG   [41]    REQUEST b'OWS-SERVER-1' b'P[\xf3\x12/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:42:23,354    DEBUG   [41]    SND client: b'OWS-SERVER-1' -> worker: b'\xe5i%>/\xe4\x11\xec\x98#\x02B\xac\x19\x00\x03' : b'P[\xf3\x12/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:42:23,354    DEBUG   [47]    RCV b'OWS-SERVER-1': b'P[\xf3\x12/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:42:23,354    DEBUG   [47]    Handling request: b'P[\xf3\x12/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:42:23,354    DEBUG   [47]    Resolving 'file' protocol
lizmapmaster_test_qgis | 2021-10-18 08:42:23,355    WARNING [47]    Qgis: : Warning: error parsing post data as XML: at line 1, column 1: unexpected end of file. Assuming urlencoded query string sent in the post body.
lizmapmaster_test_qgis | 2021-10-18 08:42:23,355    DEBUG   [47]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:42:23,355    DEBUG   [47]    Qgis: Lizmap: No lizmap user groups in request headers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,355    DEBUG   [47]    Qgis: Lizmap: Lizmap user groups in parameters : group_a,__priv_user_in_group_a,users
lizmapmaster_test_qgis | 2021-10-18 08:42:23,356    DEBUG   [47]    Qgis: Lizmap: No acl defined in Lizmap config
lizmapmaster_test_qgis | 2021-10-18 08:42:23,356    DEBUG   [47]    Qgis: Server: GEOMETRYNAME:extent
lizmapmaster_test_qgis | 2021-10-18 08:42:23,356    DEBUG   [47]    Qgis: Server: LIZMAP_OVERRIDE_FILTER:0
lizmapmaster_test_qgis | 2021-10-18 08:42:23,356    DEBUG   [47]    Qgis: Server: LIZMAP_USER:user_in_group_a
lizmapmaster_test_qgis | 2021-10-18 08:42:23,356    DEBUG   [47]    Qgis: Server: LIZMAP_USER_GROUPS:group_a, __priv_user_in_group_a, users
lizmapmaster_test_qgis | 2021-10-18 08:42:23,356    DEBUG   [47]    Qgis: Server: MAP:tests/filter_layer_data_by_polygon_for_groups.qgs
lizmapmaster_test_qgis | 2021-10-18 08:42:23,356    DEBUG   [47]    Qgis: Server: OUTPUTFORMAT:GeoJSON
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    DEBUG   [47]    Qgis: Server: REQUEST:getfeature
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    DEBUG   [47]    Qgis: Server: SERVICE:WFS
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    DEBUG   [47]    Qgis: Server: TYPENAME:shop_bakery
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    DEBUG   [47]    Qgis: Server: VERSION:1.0.0
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    WARNING [47]    Qgis: : Service WFS 1.0.0 not found, returning default
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    DEBUG   [47]    Qgis: Server: WFS Request parameters:
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    DEBUG   [47]    Qgis: Server:  - OUTPUTFORMAT : GeoJSON
lizmapmaster_test_qgis | 2021-10-18 08:42:23,357    DEBUG   [47]    Qgis: Server:  - TYPENAME : shop_bakery
lizmapmaster_test_qgis | 2021-10-18 08:42:23,358    DEBUG   [47]    Qgis: Server:  - GEOMETRYNAME : extent
lizmapmaster_test_qgis | 2021-10-18 08:42:23,358    DEBUG   [47]    Qgis: Server:  - VERSION : 1.0.0
lizmapmaster_test_qgis | 2021-10-18 08:42:23,359    DEBUG   [47]    Qgis: AccessControlFilter: QgsAccessControlFilter plugin default layerPermissions called
lizmapmaster_test_qgis | 2021-10-18 08:42:23,360    DEBUG   [47]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:42:23,360    DEBUG   [47]    Qgis: Lizmap: No lizmap user groups in request headers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,360    DEBUG   [47]    Qgis: Lizmap: Lizmap user groups in parameters : group_a,__priv_user_in_group_a,users
lizmapmaster_test_qgis | 2021-10-18 08:42:23,360    DEBUG   [47]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:42:23,361    DEBUG   [47]    Qgis: Lizmap: No lizmap user login in request headers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,361    DEBUG   [47]    Qgis: Lizmap: Lizmap user login in parameters : user_in_group_a
lizmapmaster_test_qgis | 2021-10-18 08:42:23,362    DEBUG   [47]    Qgis: Lizmap: No edition config defined for layer: shop_bakery (points_241855da_7b4f_45e2_a5ac_c84f869f9f9d)
lizmapmaster_test_qgis | 2021-10-18 08:42:23,362    DEBUG   [47]    Qgis: Lizmap: No Lizmap layer group visibility for: shop_bakery
lizmapmaster_test_qgis | 2021-10-18 08:42:23,362    DEBUG   [47]    Qgis: Lizmap: Lizmap layerFilterSubsetString
lizmapmaster_test_qgis | 2021-10-18 08:42:23,363    DEBUG   [47]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:42:23,363    DEBUG   [47]    Qgis: Lizmap: No lizmap override filter in request headers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,365    DEBUG   [47]    Qgis: Lizmap: Lizmap override filter in parameters
lizmapmaster_test_qgis | 2021-10-18 08:42:23,366    DEBUG   [47]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:42:23,366    DEBUG   [47]    Qgis: Lizmap: No lizmap user groups in request headers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,366    DEBUG   [47]    Qgis: Lizmap: Lizmap user groups in parameters : group_a,__priv_user_in_group_a,users
lizmapmaster_test_qgis | 2021-10-18 08:42:23,366    DEBUG   [47]    Qgis: Lizmap: Request headers provided
lizmapmaster_test_qgis | 2021-10-18 08:42:23,366    DEBUG   [47]    Qgis: Lizmap: No lizmap user login in request headers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,366    DEBUG   [47]    Qgis: Lizmap: Lizmap user login in parameters : user_in_group_a
lizmapmaster_test_qgis | 2021-10-18 08:42:23,367    DEBUG   [47]    Qgis: Lizmap: No editing context found in request headers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,367    DEBUG   [47]    Qgis: Lizmap: No lizmap editing context filter in parameters : default value false
lizmapmaster_test_qgis | 2021-10-18 08:42:23,387    DEBUG   [47]    Qgis: Lizmap: _polygon_for_groups_with_qgis_api ran in 0.02s
lizmapmaster_test_qgis | 2021-10-18 08:42:23,421    DEBUG   [47]    Qgis: Lizmap: _features_ids_with_qgis_api ran in 0.03s
lizmapmaster_test_qgis | 2021-10-18 08:42:23,421    DEBUG   [47]    Qgis: Lizmap: subset_sql ran in 0.05s
lizmapmaster_test_qgis | 2021-10-18 08:42:23,421    DEBUG   [47]    Qgis: Lizmap: The polygon filter subset string is not null : "id" IN ( 119 , 163 , 168 , 103 , 16 )
lizmapmaster_test_qgis | 2021-10-18 08:42:23,421    DEBUG   [47]    Qgis: Lizmap: Lizmap config has no loginFilteredLayers
lizmapmaster_test_qgis | 2021-10-18 08:42:23,421    DEBUG   [47]    Qgis: Lizmap: get_lizmap_layer_filter ran in 0.06s
lizmapmaster_test_qgis | 2021-10-18 08:42:23,440    DEBUG   [47]    Qgis: AccessControlFilter: QgsAccessControlFilter plugin default authorizedLayerAttributes called
lizmapmaster_test_qgis | 2021-10-18 08:42:23,451    DEBUG   [47]    b'\xe5i%>/\xe4\x11\xec\x98#\x02B\xac\x19\x00\x03': Flushing response data: (87 bytes)
lizmapmaster_test_qgis | 2021-10-18 08:42:23,451    DEBUG   [47]    Qgis: Server: Request finished in 96 ms
lizmapmaster_test_qgis | 2021-10-18 08:42:23,452    DEBUG   [41]    SND worker: b'\xe5i%>/\xe4\x11\xec\x98#\x02B\xac\x19\x00\x03' -> client: b'OWS-SERVER-1' : b'P[\xf3\x12/\xef\x11\xec\x81}\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:42:23,452    DEBUG   [41]    READY b'\xe5i%>/\xe4\x11\xec\x98#\x02B\xac\x19\x00\x03'
lizmapmaster_test_qgis | 2021-10-18 08:42:23,452    RREQ    [1]     200 POST    http://map:8080/ows/?GEOMETRYNAME=extent&MAP=tests%2Ffilter_layer_data_by_polygon_for_groups.qgs&OUTPUTFORMAT=GeoJSON&REQUEST=getfeature&SERVICE=WFS&TYPENAME=shop_bakery&VERSION=1.0.0&LIZMAP_USER=user_in_group_a&LIZMAP_USER_GROUPS=group_a%2C+__priv_user_in_group_a%2C+users&LIZMAP_OVERRIDE_FILTER=0  99  87  
lizmapmaster_test_qgis | 2021-10-18 08:42:23,452    REQ [1] 172.25.0.6  200 POST    /ows/?geometryname=extent&map=tests%2Ffilter%5Flayer%5Fdata%5Fby%5Fpolygon%5Ffor%5Fgroups%2Eqgs&outputformat=GeoJSON&request=getfeature&service=WFS&typename=shop%5Fbakery&version=1%2E0%2E0&Lizmap%5FUser=user%5Fin%5Fgroup%5Fa&Lizmap%5FUser%5FGroups=group%5Fa%2C%20%5F%5Fpriv%5Fuser%5Fin%5Fgroup%5Fa%2C%20users&Lizmap%5FOverride%5FFilter=0   100 87  Lizmap  
lizmapmaster_test_nginx | 172.25.0.1 - - [18/Oct/2021:08:42:23 +0000] "POST /index.php/lizmap/service/?repository=testsrepository&project=filter_layer_data_by_polygon_for_groups HTTP/1.1" 200 87 "http://localhost:8130/index.php/view/map/?repository=testsrepository&project=filter_layer_data_by_polygon_for_groups" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
nboisteault commented 3 years ago

@rldhont it is very strange, I can't reproduce the bug now.

nboisteault commented 3 years ago

It is failing randomly in CI : https://github.com/3liz/lizmap-web-client/runs/3961535775?check_suite_focus=true#step:9:91

dmarteau commented 3 years ago

I cannot test http://localhost:8130/index.php/view/map/?repository=testsrepository&project=filter_layer_data_by_polygon_for_groups : Vous n'avez pas les droits pour voir ce répertoire de cartes.

Using credentials: admin/admin

nboisteault commented 3 years ago

Add rights for admins group for testsrepository in http://localhost:8130/admin.php/admin/maps/

dmarteau commented 3 years ago

Tests direct requests to py-qgis-server :

request:

MAP=private/lwc_2541/filter_layer_data_by_polygon_for_groups
SERVICE=WFS
VERSION=1.0.0
REQUEST=GetFeature
TYPENAME=shop_bakery
OUTPUTFORMAT=GeoJSON
GEOMETRYNAME=extent
LIZMAP_OVERRIDE_FILTER=0
LIZMAP_USER=user_in_group_a
LIZMAP_USER_GROUPS=group_a%2C+__priv_user_in_group_a%2C+users

Qgis 3.16

Without Lizmap plugin

No issue to report, features are always fetched:

{
  type: FeatureCollection,
  bbox: [ 
    3.77,
    43.56,
    3.94,
    43.68
  ],
  features: [ 
    {
      bbox: [ 
        3.913073,
        43.659122,
        3.913073,
        43.659122
      ],
      geometry: { 
        coordinates: [ 
          [
            [
              3.913073,
              43.659122
            ],
            [
              3.913073,
              43.659122
            ],
            [
              3.913073,
              43.659122
            ],
            [
              3.913073,
              43.659122
            ],
            [
              3.913073,
              43.659122
            ]
          ]
        ],
        type: Polygon
      },
      id: shop_bakery.0,
      properties: {
        id: 1
      },
      type: Feature
    },
   etc ...

With Lizmap plugin (master):

Same thing, no issue to report.

dmarteau commented 3 years ago

@nboisteault

Add rights for admins group for testsrepository in http://localhost:8130/admin.php/admin/maps/

There is no testsrepository in admin.

nboisteault commented 3 years ago

@dmarteau ping me, we'll look to this issue.

nboisteault commented 2 years ago

@dmarteau, in docker stack for test :

curl 'http://map:8080/ows/?geometryname=extent&map=tests%2Ffilter%5Flayer%5Fdata%5Fby%5Fpolygon%5Ffor%5Fgroups%2Eqgs&outputformat=GeoJSON&request=getfeature&service=WFS&typename=shop%5Fbakery&version=1%2E0%20&Lizmap%5FUser=admin&Lizmap%5FUser%5FGroups=%5F%5Fpriv%5Fadmin%2C%20admins&Lizmap%5FOverride%5FFilter=0'

returns

{"type": "FeatureCollection",
 "bbox": [ 3.77, 43.56, 3.94, 43.68],
 "features": [
 ]
nboisteault commented 2 years ago

@rldhont @mdouchin same request with Lizmap%5FOverride%5FFilter=1

curl 'http://map:8080/ows/?geometryname=extent&map=tests%2Ffilter%5Flayer%5Fdata%5Fby%5Fpolygon%5Ffor%5Fgroups%2Eqgs&outputformat=GeoJSON&request=getfeature&service=WFS&typename=shop%5Fbakery&version=1%2E0%20&Lizmap%5FUser=admin&Lizmap%5FUser%5FGroups=%5F%5Fpriv%5Fadmin%2C%20admins&Lizmap%5FOverride%5FFilter=1'

returns

{"type": "FeatureCollection",
 "bbox": [ 3.77, 43.56, 3.94, 43.68],
 "features": [
  {"bbox":[3.913073,43.659122,3.913073,43.659122],"geometry":{"coordinates":[[[3.913073,43.659122],[3.913073,43.659122],[3.913073,43.659122],[3.913073,43.659122],[3.913073,43.659122]]],"type":"Polygon"},"id":"shop_bakery.0","properties":{"id":1,"polygon_id":null},"type":"Feature"}
 ,{"bbox":[3.811568,43.653714,3.811568,43.653714],"geometry":{"coordinates":[[[3.811568,43.653714],[3.811568,43.653714],[3.811568,43.653714],[3.811568,43.653714],[3.811568,43.653714]]],"type":"Polygon"},"id":"shop_bakery.1","properties":{"id":16,"polygon_id":0},"type":"Feature"}
 ,{"bbox":[3.860864,43.664591,3.860864,43.664591],"geometry":{"coordinates":[[[3.860864,43.664591],[3.860864,43.664591],[3.860864,43.664591],[3.860864,43.664591],[3.860864,43.664591]]],"type":"Polygon"},"id":"shop_bakery.2","properties":{"id":68,"polygon_id":2},"type":"Feature"}
 ,{"bbox":[3.803876,43.577272,3.803876,43.577272],"geometry":{"coordinates":[[[3.803876,43.577272],[3.803876,43.577272],[3.803876,43.577272],[3.803876,43.577272],[3.803876,43.577272]]],"type":"Polygon"},"id":"shop_bakery.3","properties":{"id":69,"polygon_id":6},"type":"Feature"}
 ,{"bbox":[3.904609,43.602678,3.904609,43.602678],"geometry":{"coordinates":[[[3.904609,43.602678],[3.904609,43.602678],[3.904609,43.602678],[3.904609,43.602678],[3.904609,43.602678]]],"type":"Polygon"},"id":"shop_bakery.4","properties":{"id":73,"polygon_id":5},"type":"Feature"}
 ,{"bbox":[3.844422,43.596471,3.844422,43.596471],"geometry":{"coordinates":[[[3.844422,43.596471],[3.844422,43.596471],[3.844422,43.596471],[3.844422,43.596471],[3.844422,43.596471]]],"type":"Polygon"},"id":"shop_bakery.5","properties":{"id":79,"polygon_id":5},"type":"Feature"}
 ,{"bbox":[3.835329,43.577769,3.835329,43.577769],"geometry":{"coordinates":[[[3.835329,43.577769],[3.835329,43.577769],[3.835329,43.577769],[3.835329,43.577769],[3.835329,43.577769]]],"type":"Polygon"},"id":"shop_bakery.6","properties":{"id":99,"polygon_id":3},"type":"Feature"}
 ,{"bbox":[3.850837,43.683412,3.850837,43.683412],"geometry":{"coordinates":[[[3.850837,43.683412],[3.850837,43.683412],[3.850837,43.683412],[3.850837,43.683412],[3.850837,43.683412]]],"type":"Polygon"},"id":"shop_bakery.7","properties":{"id":102,"polygon_id":null},"type":"Feature"}
 ,{"bbox":[3.878482,43.655109,3.878482,43.655109],"geometry":{"coordinates":[[[3.878482,43.655109],[3.878482,43.655109],[3.878482,43.655109],[3.878482,43.655109],[3.878482,43.655109]]],"type":"Polygon"},"id":"shop_bakery.8","properties":{"id":103,"polygon_id":1},"type":"Feature"}
 ,{"bbox":[3.89268,43.656244,3.89268,43.656244],"geometry":{"coordinates":[[[3.89268,43.656244],[3.89268,43.656244],[3.89268,43.656244],[3.89268,43.656244],[3.89268,43.656244]]],"type":"Polygon"},"id":"shop_bakery.9","properties":{"id":119,"polygon_id":1},"type":"Feature"}
 ,{"bbox":[3.868088,43.603732,3.868088,43.603732],"geometry":{"coordinates":[[[3.868088,43.603732],[3.868088,43.603732],[3.868088,43.603732],[3.868088,43.603732],[3.868088,43.603732]]],"type":"Polygon"},"id":"shop_bakery.10","properties":{"id":126,"polygon_id":5},"type":"Feature"}
 ,{"bbox":[3.804697,43.61133,3.804697,43.61133],"geometry":{"coordinates":[[[3.804697,43.61133],[3.804697,43.61133],[3.804697,43.61133],[3.804697,43.61133],[3.804697,43.61133]]],"type":"Polygon"},"id":"shop_bakery.11","properties":{"id":140,"polygon_id":7},"type":"Feature"}
 ,{"bbox":[3.924303,43.635591,3.924303,43.635591],"geometry":{"coordinates":[[[3.924303,43.635591],[3.924303,43.635591],[3.924303,43.635591],[3.924303,43.635591],[3.924303,43.635591]]],"type":"Polygon"},"id":"shop_bakery.12","properties":{"id":143,"polygon_id":9},"type":"Feature"}
 ,{"bbox":[3.913397,43.635438,3.913397,43.635438],"geometry":{"coordinates":[[[3.913397,43.635438],[3.913397,43.635438],[3.913397,43.635438],[3.913397,43.635438],[3.913397,43.635438]]],"type":"Polygon"},"id":"shop_bakery.13","properties":{"id":151,"polygon_id":9},"type":"Feature"}
 ,{"bbox":[3.766922,43.579735,3.766922,43.579735],"geometry":{"coordinates":[[[3.766922,43.579735],[3.766922,43.579735],[3.766922,43.579735],[3.766922,43.579735],[3.766922,43.579735]]],"type":"Polygon"},"id":"shop_bakery.14","properties":{"id":155,"polygon_id":null},"type":"Feature"}
 ,{"bbox":[3.793696,43.561103,3.793696,43.561103],"geometry":{"coordinates":[[[3.793696,43.561103],[3.793696,43.561103],[3.793696,43.561103],[3.793696,43.561103],[3.793696,43.561103]]],"type":"Polygon"},"id":"shop_bakery.15","properties":{"id":157,"polygon_id":null},"type":"Feature"}
 ,{"bbox":[3.93703,43.649574,3.93703,43.649574],"geometry":{"coordinates":[[[3.93703,43.649574],[3.93703,43.649574],[3.93703,43.649574],[3.93703,43.649574],[3.93703,43.649574]]],"type":"Polygon"},"id":"shop_bakery.16","properties":{"id":158,"polygon_id":8},"type":"Feature"}
 ,{"bbox":[3.894293,43.572141,3.894293,43.572141],"geometry":{"coordinates":[[[3.894293,43.572141],[3.894293,43.572141],[3.894293,43.572141],[3.894293,43.572141],[3.894293,43.572141]]],"type":"Polygon"},"id":"shop_bakery.17","properties":{"id":163,"polygon_id":4},"type":"Feature"}
 ,{"bbox":[3.897565,43.580337,3.897565,43.580337],"geometry":{"coordinates":[[[3.897565,43.580337],[3.897565,43.580337],[3.897565,43.580337],[3.897565,43.580337],[3.897565,43.580337]]],"type":"Polygon"},"id":"shop_bakery.18","properties":{"id":168,"polygon_id":4},"type":"Feature"}
 ,{"bbox":[3.922375,43.639475,3.922375,43.639475],"geometry":{"coordinates":[[[3.922375,43.639475],[3.922375,43.639475],[3.922375,43.639475],[3.922375,43.639475],[3.922375,43.639475]]],"type":"Polygon"},"id":"shop_bakery.19","properties":{"id":173,"polygon_id":9},"type":"Feature"}
 ,{"bbox":[3.896339,43.632993,3.896339,43.632993],"geometry":{"coordinates":[[[3.896339,43.632993],[3.896339,43.632993],[3.896339,43.632993],[3.896339,43.632993],[3.896339,43.632993]]],"type":"Polygon"},"id":"shop_bakery.20","properties":{"id":174,"polygon_id":9},"type":"Feature"}
 ,{"bbox":[3.820083,43.574158,3.820083,43.574158],"geometry":{"coordinates":[[[3.820083,43.574158],[3.820083,43.574158],[3.820083,43.574158],[3.820083,43.574158],[3.820083,43.574158]]],"type":"Polygon"},"id":"shop_bakery.21","properties":{"id":181,"polygon_id":3},"type":"Feature"}
 ,{"bbox":[3.849871,43.620122,3.849871,43.620122],"geometry":{"coordinates":[[[3.849871,43.620122],[3.849871,43.620122],[3.849871,43.620122],[3.849871,43.620122],[3.849871,43.620122]]],"type":"Polygon"},"id":"shop_bakery.22","properties":{"id":195,"polygon_id":5},"type":"Feature"}
 ,{"bbox":[3.942209,43.641274,3.942209,43.641274],"geometry":{"coordinates":[[[3.942209,43.641274],[3.942209,43.641274],[3.942209,43.641274],[3.942209,43.641274],[3.942209,43.641274]]],"type":"Polygon"},"id":"shop_bakery.23","properties":{"id":197,"polygon_id":8},"type":"Feature"}
 ,{"bbox":[3.90324,43.663094,3.90324,43.663094],"geometry":{"coordinates":[[[3.90324,43.663094],[3.90324,43.663094],[3.90324,43.663094],[3.90324,43.663094],[3.90324,43.663094]]],"type":"Polygon"},"id":"shop_bakery.24","properties":{"id":199,"polygon_id":null},"type":"Feature"}
 ]

See all the data of the filtered layers (attribute or spatial filters) is not checked for this repository.

nboisteault commented 2 years ago

When I display attribute table for shop_bakery twice, one is OK other NOK, there are differences in log :

image

Lizmap layerFilterExpression is not present at right.

nboisteault commented 2 years ago

flaky_test_attribute_table

Bug occurs once every four times. Docker stack is configured with QGSRV_SERVER_WORKERS: 4.

Any idea how to fix this @rldhont @mdouchin @dmarteau ?

nboisteault commented 2 years ago

I confirm there is no bug with QGSRV_SERVER_WORKERS: 1

mdouchin commented 2 years ago

Some users also reported random errors in the editing tool, related to some WFS requests on error. Not easy to reproduce though.

mdouchin commented 2 years ago

Perhaps a bug with the filter cache in the plugin cc @Gustry or in LWC ? We could disable the cache et test again

mdouchin commented 2 years ago

@nboisteault I cannot reproduce the bug :(. Or more correct, I was able to reproduce it one time, then I restarted my docker containers, and then I could not anymore.

Note that it is completely normal that your curl command below does not return the data, since the Polygons layer groups fields does not contain the admins group. For admins, this is simpler if they just check the corresponding checkbox for the repository, which corresponds to this LIZMAP_OVERRIDE_FILTER parameter

curl 'http://map:8080/ows/?geometryname=extent&map=tests%2Ffilter%5Flayer%5Fdata%5Fby%5Fpolygon%5Ffor%5Fgroups%2Eqgs&outputformat=GeoJSON&request=getfeature&service=WFS&typename=shop%5Fbakery&version=1%2E0%20&Lizmap%5FUser=admin&Lizmap%5FUser%5FGroups=%5F%5Fpriv%5Fadmin%2C%20admins&Lizmap%5FOverride%5FFilter=0'

Could you please tell us with which user did you try ? admin or user_in_group_a ?

nboisteault commented 2 years ago

@mdouchin Gif was made when logged as user_in_group_a.