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

Unable to set FILTER_COMPLIANCE property in Web Feature Server store through REST api #597

Open
lpalmarucci opened this issue Nov 17, 2023 · 5 comments
Labels
upstream Packaging issue in base image or GeoServer

Comments

@lpalmarucci
Copy link

lpalmarucci commented Nov 17, 2023

What is the bug or the crash?

Hi Everyone!
i'm trying to create a datastore (in particular a Web Feature Server store) from Rest API.
Everything works fine (i receive the 201 created http status code) but when i access to the geoserver web application and go to the detail page of the store just created, i see that the Filter Compliace property is empty (see image below)

image

Steps to reproduce the issue

You can use both of these requests

curl --location --globoff 'http://localhost:8080/geoserver/rest/workspaces/example/datastores/' \
--header 'Content-Type: application/json' \
--data '{
    "dataStore": {
        "name": "wfsRestApi2",
        "description": "Description web feature service creatoin from api",
        "type": "Web Feature Server (NG)",
        "enabled": true,
        "connectionParameters": {
            "WFSDataStoreFactory:GET_CAPABILITIES_URL": "https://gs-stable.geo-solutions.it/geoserver/ows",
            "WFSDataStoreFactory:USERNAME": "",
            "WFSDataStoreFactory:PASSWORD": "",
            "WFSDataStoreFactory:ENCODING": "UTF-8",
            "WFSDataStoreFactory:TIMEOUT": 30000,
            "WFSDataStoreFactory:USE_HTTP_CONNECTION_POOLING": true,
            "WFSDataStoreFactory:MAX_CONNECTION_POOL_SIZE": 7,
            "WFSDataStoreFactory:AXIS_ORDER": "Compliant",
            "WFSDataStoreFactory:AXIS_ORDER_FILTER": "Compliant",
            "WFSDataStoreFactory:TRY_GZIP": true,
            "WFSDataStoreFactory:BUFFER_SIZE": 10,
            "WFSDataStoreFactory:WFS_STRATEGY": "auto",
            "WFSDataStoreFactory:FILTER_COMPLIANCE": 0,
            "WFSDataStoreFactory:MAXFEATURES": 0,
            "WFSDataStoreFactory:GML_COMPLIANCE_LEVEL": 0
        },
        "_default": false
    }
}'
curl --location --globoff 'http://localhost:8080/geoserver/rest/workspaces/example/datastores' \
--header 'Content-Type: application/json' \
--data '{
    "dataStore": {
        "name": "wfs",
        "description": "Description web feature service creatoin from api",
        "type": "Web Feature Server (NG)",
        "enabled": true,
        "connectionParameters": {
            "entry": [
                {
                    "key": "WFSDataStoreFactory:GET_CAPABILITIES_URL",
                    "value": "https://gs-stable.geo-solutions.it/geoserver/ows"
                },
                {
                    "key": "WFSDataStoreFactory:USERNAME",
                    "value": ""
                },
                {
                    "key": "WFSDataStoreFactory:PASSWORD",
                    "value": ""
                },
                {
                    "key": "WFSDataStoreFactory:FILTER_COMPLIANCE",
                    "value": 0
                },
                {
                    "key": "WFSDataStoreFactory:MAXFEATURES",
                    "value": "0"
                },
                {
                    "key": "WFSDataStoreFactory:WFS_STRATEGY",
                    "value": "auto"
                },
                {
                    "key": "WFSDataStoreFactory:GML_COMPLIANCE_LEVEL",
                    "value": 0
                },
                {
                    "key": "WFSDataStoreFactory:AXIS_ORDER",
                    "value": "Compliant"
                },
                {
                    "key": "WFSDataStoreFactory:AXIS_ORDER_FILTER",
                    "value": "Compliant"
                },
                {
                    "key": "WFSDataStoreFactory:TIMEOUT",
                    "value": 30000
                },
                {
                    "key": "WFSDataStoreFactory:BUFFER_SIZE",
                    "value": 10
                },
                {
                    "key": "WFSDataStoreFactory:MAX_CONNECTION_POOL_SIZE",
                    "value": 6
                }
            ]
        },
        "_default": false
    }
}'

Versions

2.24.0

Additional context

Every other ConnectionParameters property is set correctly

@NyakudyaA
Copy link
Collaborator

Can you please check what the generated xml file without the filter VS the filter shows. Sometimes it's just how the value should be set that is different

@lpalmarucci
Copy link
Author

lpalmarucci commented Nov 21, 2023

Can you please check what the generated xml file without the filter VS the filter shows. Sometimes it's just how the value should be set that is different

I've checked and inside the datastore.xml file it's correctly saved (below the xml content)

<dataStore>
  <id>DataStoreInfoImpl--6eec8551:18bdc4d0bbd:-7ff6</id>
  <name>wfsRestApi2</name>
  <description>Description web feature service creatoin from api</description>
  <type>Web Feature Server (NG)</type>
  <enabled>true</enabled>
  <workspace>
    <id>WorkspaceInfoImpl-197cd622:18ba8cd8228:-6bd6</id>
  </workspace>
  <connectionParameters>
    <entry key="WFSDataStoreFactory:TRY_GZIP">true</entry>
    <entry key="WFSDataStoreFactory:GML_COMPATIBLE_TYPENAMES">false</entry>
    <entry key="WFSDataStoreFactory:LENIENT">false</entry>
    <entry key="WFSDataStoreFactory:AXIS_ORDER">Compliant</entry>
    <entry key="usedefaultsrs">false</entry>
    <entry key="WFSDataStoreFactory:PROTOCOL">false</entry>
    <entry key="WFSDataStoreFactory:GML_COMPLIANCE_LEVEL">0</entry>
    <entry key="WFSDataStoreFactory:GET_CAPABILITIES_URL">https://gs-stable.geo-solutions.it/geoserver/ows</entry>
    <entry key="WFSDataStoreFactory:MAX_CONNECTION_POOL_SIZE">7</entry>
    <entry key="WFSDataStoreFactory:FILTER_COMPLIANCE">0</entry>
    <entry key="WFSDataStoreFactory:MAXFEATURES">0</entry>
    <entry key="WFSDataStoreFactory:TIMEOUT">30000</entry>
    <entry key="WFSDataStoreFactory:BUFFER_SIZE">10</entry>
    <entry key="namespace">http://U0VNRU1ORVctMlxzZW1lbXVzZXI=</entry>
    <entry key="WFSDataStoreFactory:AXIS_ORDER_FILTER">Compliant</entry>
    <entry key="WFSDataStoreFactory:WFS_STRATEGY">auto</entry>
    <entry key="WFSDataStoreFactory:USE_HTTP_CONNECTION_POOLING">true</entry>
    <entry key="WFSDataStoreFactory:ENCODING">UTF-8</entry>
  </connectionParameters>
  <__default>false</__default>
  <dateCreated>2023-11-17 08:43:54.675 UTC</dateCreated>
  <dateModified>2023-11-17 08:59:02.571 UTC</dateModified>
  <disableOnConnFailure>false</disableOnConnFailure>
</dataStore>

@NyakudyaA
Copy link
Collaborator

@lpalmarucci The correct xml comes from the rest API requests you did or after changing the filter in the UI. Can you try to do a put request with the XML and see if the results is the same, I will try it later to replicate

@lpalmarucci
Copy link
Author

lpalmarucci commented Nov 22, 2023

@lpalmarucci The correct xml comes from the rest API requests you did or after changing the filter in the UI. Can you try to do a put request with the XML and see if the results is the same, I will try it later to replicate

I've followed this steps:

  1. Put request with the XML in the previous response
curl --location --request PUT '{GEOSERVER_URL}/geoserver/rest/workspaces/example/datastores/wfsRestApi' \
--header 'Content-Type: application/xml' \
--header 'Authorization: Basic {basicAuthorizationCode}' \
--data '<dataStore>
 <name>wfsRestApi</name>
 <description>Description web feature service creatoin from api</description>
 <type>Web Feature Server (NG)</type>
 <enabled>true</enabled>
 <workspace>
   <id>WorkspaceInfoImpl-197cd622:18ba8cd8228:-6bd6</id>
 </workspace>
 <connectionParameters>
   <entry key="WFSDataStoreFactory:TRY_GZIP">true</entry>
   <entry key="WFSDataStoreFactory:GML_COMPATIBLE_TYPENAMES">false</entry>
   <entry key="WFSDataStoreFactory:LENIENT">false</entry>
   <entry key="WFSDataStoreFactory:AXIS_ORDER">Compliant</entry>
   <entry key="usedefaultsrs">false</entry>
   <entry key="WFSDataStoreFactory:PROTOCOL">false</entry>
   <entry key="WFSDataStoreFactory:GML_COMPLIANCE_LEVEL">0</entry>
   <entry key="WFSDataStoreFactory:GET_CAPABILITIES_URL">https://gs-stable.geo-solutions.it/geoserver/ows</entry>
   <entry key="WFSDataStoreFactory:MAX_CONNECTION_POOL_SIZE">7</entry>
   <entry key="WFSDataStoreFactory:FILTER_COMPLIANCE">0</entry>
   <entry key="WFSDataStoreFactory:MAXFEATURES">0</entry>
   <entry key="WFSDataStoreFactory:TIMEOUT">30000</entry>
   <entry key="WFSDataStoreFactory:BUFFER_SIZE">10</entry>
   <entry key="namespace">http://U0VNRU1ORVctMlxzZW1lbXVzZXI=</entry>
   <entry key="WFSDataStoreFactory:AXIS_ORDER_FILTER">Compliant</entry>
   <entry key="WFSDataStoreFactory:WFS_STRATEGY">auto</entry>
   <entry key="WFSDataStoreFactory:USE_HTTP_CONNECTION_POOLING">true</entry>
   <entry key="WFSDataStoreFactory:ENCODING">UTF-8</entry>
 </connectionParameters>
 <__default>false</__default>
 <dateCreated>2023-11-17 08:43:54.675 UTC</dateCreated>
 <dateModified>2023-11-17 08:59:02.571 UTC</dateModified>
 <disableOnConnFailure>false</disableOnConnFailure>
</dataStore>'
  1. In the web application i verify if the field was set but it doesn't

The fact is that if the FILTER_COMPLIANCE is not set, when i try to publish a layer, it crashes. However, making PUT request with the XML previously shared, fixed the problem of publishing layers (even if in the UI i'm not able to see the field valorized).
I assume that i have to use this solution as workaround waiting for geoserver to fix the issue as i've also created a BUG on their Jira

@NyakudyaA
Copy link
Collaborator

NyakudyaA commented Nov 23, 2023

@NyakudyaA NyakudyaA added the upstream Packaging issue in base image or GeoServer label Nov 26, 2023
@NyakudyaA NyakudyaA closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
@NyakudyaA NyakudyaA reopened this Apr 21, 2024
@NyakudyaA NyakudyaA reopened this Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Packaging issue in base image or GeoServer
Projects
None yet
Development

No branches or pull requests

2 participants