Found a GeoServer issue, but no Jira permissions

Hi. I ran into an issue with GeoServer, but Jira didn’t let me create an activity, so I am going to report it here instead:

When you save a PostGIS data store with a blank schema field and then try to publish a layer not in the public schema, there is an issue with reading/processing the geometry. It doesn’t give a native EPSG and throws a runtime exception when trying to calculate bounds.

java.lang.RuntimeException: java.io.IOException: Error occured calculating bounds for pois_laatzen at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:547)

Editing the data store to specefiy a schema again saves, but doesn’t resolve the problem anymore. Specifying a schema other than public on first creation works and doesn’t result in any issues.

Steps to reproduce:

  1. Have/Create a database with another schema besides the public schema and a table with features in that schema.
  2. Create a PostGIS data store for that data base in GeoServer with an empty schema field (delete “public” from the schema field)
  3. Try to create a new Layer. Select the previously created data store and click publish on a layer not in the public schema.
  4. Observe that you can’t select a native CRS and that trying to calculate bounds throws a runtime exception.

GeoServer version: 3.0.1

What did you expect if you didn’t specify a schema?

While we could improve the error message it seems to be working as expected (i.e. it doesn’t work)

Ian

What happens in that case is that the default schema is used, and it is the “public” schema if the PostgreSQL search path is not set to point into some other schema.
I believe that when you did “Create a PostGIS data store …with an empty schema field (delete “public” from the schema field)” you really did not change anything.

I cannot reproduce this:
“Editing the data store to specefiy a schema again saves, but doesn’t resolve the problem anymore.”
I created a store with an empty (=default) schema, the store showed me the tables in “public”. Then I edited the store to use schema “other”, and then store showed me the tables from the “other” schema.

-Jukka Rahkonen-

I cannot reproduce this:
“Editing the data store to specefiy a schema again saves, but doesn’t resolve the problem anymore.”

I can’t either anymore. Maybe I misinterpreted/imagined something that wasn’t there.

I am not sure if my prvious reply was confusing so just in case to clarify:

I created a store with an empty (=default) schema, the store showed me the tables in “public”. Then I edited the store to use schema “other”, and then store showed me the tables from the “other” schema.

That is not the case for me. With an empty schema, I get shown layers from all schemas. The ones not in public don’t work correctly (see above), but they show up. The “it doesn’t get fixed” was the thing I apparently imagined.