[Geoserver-devel] [JIRA] (GEOS-9597) the server mangles the URL and attempts to turn it into a file URL

john sheflin created an issue

GeoServer / BugGEOS-9597

the server mangles the URL and attempts to turn it into a file URL

Issue Type:

BugBug

Assignee:

Unassigned

Created:

29/Apr/20 7:50 PM

Environment:

d68399795ec4a5cff98e2a2c6cc472ec1628e368
Build Date
20-Jan-2020 18:21
GeoTools Version
22.2 (rev 648dda215d0ec25671eabc119de4d2be80a992fd)
GeoWebCache Version:
1.16.2 (rev 1.16.x/84a6736412921b9e6a587f0f150822eb3bf238bc)`

Priority:

MediumMedium

Reporter:

john sheflin

description of the bug: I used to be able to simply setup a data store for a shapefile using a public facing AWS S3 URL for the Connection Parameters field and I could publish layers/services for it with no problem. That was version 2.16.0 of Geoserver (build date 18-Sep-2019).

However, on recent Geoserver deploys, the server mangles the URL and attempts to turn it into a file URL like this one for example:
file:///usr/local/tomcat/webapps/Geoserver/https:/myshapefiles.s3.amazonaws.com/testshapefile1.shp
Which, prevents successful Publishing.

      1. Reproduction Steps
        Have a public S3 repo with a shapefile in it. For example:
        https://usgs-shapefiles.s3.amazonaws.com/5e57f958bf0a3642014f3e6c/1790-1823_BlackCone_flow.shp
        Try to use that URL for in the Connection Parameters Shapefile Location field when configuring a datastore.
        Hit the Save button and then it will take you to “Layers” where you can “Publish” it.
        After you hit “Publish”, you get a stacktrace:
        Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /var/www/geoserver/https:/usgs-shapefiles.s3.amazonaws.com/5e57f958bf0a3642014f3e6c/1790-1823_BlackCone_flow.shp (No such file or directory) at org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:329) at org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:296) at org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:105) at org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:342) at org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:325) at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:413) ... 125 more
        When you go back into the datastore (Edit), you will find that Geoserver mangled the original URL and turned it into a combination “file” and “http” URL, like this one:
        file:///var/www/geoserver/https:/usgs-shapefiles.s3.amazonaws.com/5e57f958bf0a3642014f3e6c/1790-1823_BlackCone_flow.shp
        If you attempt to Save again from the Edit page, you will get an error:
        “Could not find file: file:///var/www/geoserver/https:/usgs-shapefiles.s3.amazonaws.com/5e57f958bf0a3642014f3e6c/1790-1823_BlackCone_flow.shp”
        Of course, this is unpublishable.
        This used to actually work in version 2.16.0 of Geoserver (build date 18-Sep-2019).
        1. Error Log
          Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /var/www/geoserver/https:/usgs-shapefiles.s3.amazonaws.com/5e57f958bf0a3642014f3e6c/1790-1823_BlackCone_flow.shp (No such file or directory) at org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:329) at org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:296) at org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:105) at org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:342) at org.geoserver.catalog.CatalogBuilder.buildFeatureType(CatalogBuilder.java:325) at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:413) ... 125 more
        2. Environment
          -JVM Version : Private Build: 1.8.0_242 (OpenJDK 64-Bit Server VM)
  • CLI Version :
  • Framework Version:
  • OS : Ubuntu 18.04.4 LTS
    `GeoServer Version
    2.16.2
    Git Revision

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125-sha1:e06514a)

Atlassian logo