1

After creating an empty image mosaic :

curl -v -u admin:geoserver -XPUT -H "Content-type:application/zip"
--data-binary @/services/GeoServer/data_dir/data/MaltaLab/basic.zip http://localhost:8080/geoserver/rest/workspaces/SHAREMED/coveragestores/test_base/file.imagemosaic?configure=none

And trying to update it using preexisting folder:

curl -v -u admin:geoserver -XPOST -H "Content-type: text/plain" -d "file://services/GeoServer/data_dir/data/CMEMS/WIND/CMEMS-WIND-V-SAT-2021082118.tif" "http://localhost:8080/geoserver/rest/workspaces/SHAREMED/coveragestores/test_base/external.imagemosaic"

I get the error :

Note : Unnecessary use of -X or --request, POST is already inferred.
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
 Server auth using Basic with user 'admin'
> POST /geoserver/rest/workspaces/SHAREMED/coveragestores/test_base/external.imagemosaic HTTP/1.1
> Host: localhost:8080
> Authorization: Basic YWRtaW46Z2Vvc2VydmVy
> User-Agent: curl/7.68.0
> Accept: */*
> Content-type: text/plain
> Content-Length: 82
>
 upload completely sent off: 82 out of 82 bytes
 Mark bundle as not supporting multiuse
< HTTP/1.1 500 Server Error
< X-Frame-Options: SAMEORIGIN
< Content-Type: text/plain
< Transfer-Encoding: chunked
< Server: Jetty(9.4.18.v20190429)
<
Failed to create reader from file:data/SHAREMED/test_base and hints Hints:
  REPOSITORY = org.geoserver.catalog.CatalogRepository@715042ff
System defaults:
  STYLE_FACTORY                    = StyleFactoryImpl
  EXECUTOR_SERVICE                 = java.util.concurrent.ThreadPoolExecutor@20ff40ee[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
  FORCE_AXIS_ORDER_HONORING        = http
  GRID_COVERAGE_FACTORY            = GridCoverageFactory
    TILE_ENCODING                  = null
  FORCE_LONGITUDE_FIRST_AXIS_ORDER = true
  LENIENT_DATUM_SHIFT              = true
  FEATURE_FACTORY                  = org.geotools.feature.LenientFeatureFactoryImpl@1f443fae
  COMPARISON_TOLERANCE             = 1.0E-8
  FILTER_FACTORY                   = FilterFactoryImpl
Connection #0 to host localhost left intact
nikola@watercolours:~$

Which I do not understand. What may I be doing wrong?

1 Answer 1

1

You may be just missing a / in your file path.

Try

curl -v -u admin:geoserver -XPOST -H "Content-type: text/plain" -d "file:///services/GeoServer/data_dir ...

instead of

curl -v -u admin:geoserver -XPOST -H "Content-type: text/plain" -d "file://services/GeoServer/data_dir ...

1
  • 1
    Correct - it was an issue of typing. Specifically the extra "/" was missing. Thank you! Commented Nov 22, 2021 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.