john sheflin (
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b19732adda5f94d06b9903d
) *created* an issue
GeoServer (
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiOTc5ODk0MGFhMGVmNGJmZTg3NDQ2YzVhMmYwYWEyYzgiLCJwIjoiaiJ9
) / Bug (
https://osgeo-org.atlassian.net/browse/GEOS-9597?atlOrigin=eyJpIjoiOTc5ODk0MGFhMGVmNGJmZTg3NDQ2YzVhMmYwYWEyYzgiLCJwIjoiaiJ9
) GEOS-9597 (
https://osgeo-org.atlassian.net/browse/GEOS-9597?atlOrigin=eyJpIjoiOTc5ODk0MGFhMGVmNGJmZTg3NDQ2YzVhMmYwYWEyYzgiLCJwIjoiaiJ9
) the server mangles the URL and attempts to turn it into a file URL (
https://osgeo-org.atlassian.net/browse/GEOS-9597?atlOrigin=eyJpIjoiOTc5ODk0MGFhMGVmNGJmZTg3NDQ2YzVhMmYwYWEyYzgiLCJwIjoiaiJ9
)
Issue Type: Bug 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: Medium Reporter: john sheflin (
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b19732adda5f94d06b9903d
)
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.
* * * 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).
* 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`
* 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
(
https://osgeo-org.atlassian.net/browse/GEOS-9597#add-comment?atlOrigin=eyJpIjoiOTc5ODk0MGFhMGVmNGJmZTg3NDQ2YzVhMmYwYWEyYzgiLCJwIjoiaiJ9
) Add Comment (
https://osgeo-org.atlassian.net/browse/GEOS-9597#add-comment?atlOrigin=eyJpIjoiOTc5ODk0MGFhMGVmNGJmZTg3NDQ2YzVhMmYwYWEyYzgiLCJwIjoiaiJ9
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125-
sha1:e06514a )
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel