Image Mosaic Update via Rest => Failed to locate the input file

Hi! I created my geoserver via docker with a mounted/bind local data directory at ‘docker-geoserver/geoserver_data/’

Inside my data subfolder (‘docker-geoserver/geoserver_data/data/mhw_test’), I put 3 timeseries raster files with naming convention: mhw_yyyymmdd then created indexer.properties and timeregex.properties. Aftewards, I made a imagemosaic store. Then I was able to successfully make a timeseries layer.

Now I added another raster file inside the mhw_test folder. I can’t seem to update it via REST, as it results to this error

curl -u admin:password -XPOST -H "Content-type: text/plain"  -d "file:///data/mhwAnomaly_19820104.tif" "http://localhost:80/rest/workspaces/mhw/coveragestores/mhw/external.imagemosaic"

I, at this point, actually tried different conventions and combinations and permutations but it all leads to error 400: Failed to locate the input file. More details below.

<!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Failed to locate the input file file:&#47;&#47;&#47;data&#47;mhwAnomaly_19820104.tif</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p><hr class="line" /><h3>i_am_a_teapot</h3></body></html>

+1

I am also having this problem using geoserver via docker. We’re using the docker.osgeo.org/geoserver:2.26.2 docker image and our index is kept in a PostgreSQL table. We bind mount with the path to our NFS to our docker container, and the user tomcat owns the data on the NFS mount.

I am wondering if it has to do with file permissions somehow. When we create our docker container, we have it set to run as the tomcat user and assigned a UID/GID that is the same as the tomcat user we created on our VM that “owns” the data in our NFS mount:

# Run as tomcat user with same UID and GID as on host VM
RUN_UNPRIVILEGED=true
RUN_WITH_USER_UID=444
RUN_WITH_USER_GID=444

However, while our tomcat user owns the data on our NFS mount, the group does not match what is on the NFS mount. So in our docker container, I see the image mosaic files like this:

-rwxrwxr-x 1 tomcat  4730 2403012 May  7 03:53 noresm2_mm_ssp585_dbcca_daymet_vic4_wind_2060_2099_spring.tif

Where GID 4730 matches a group on our VM, but it does not exist in our docker container. I wonder if the fact that the group doesn’t exist in our docker container is somehow messing it up. I don’t know how that could be since tomcat owns the data and has all necessary permissions to act on it, but it’s the only thing I can really think of.

(I commented on your stackoverflow post, but figured I would here too for more visibility).

UPDATE:
I tried changing the group to tomcat too (GID=444), which it recognized, but it didn’t make a difference.

Log files seem to indicate that GeoServer is looking in the wrong spot for our regex .properties files, but the right spot for the other configuration files like mosaic_dir.properties and datastore.properties. Very confusing, no idea why it would be doing that. As an aside, where it says Required key Levels not found can be ignored; the key Levels is not part of datastore.properties, only <mosaic_dir>.properties has that per the docs. That file is generally created automatically and it does, indeed, have the key Levels when I check.

07 May 20:02:48 DEBUG  [gce.imagemosaic] - Using ThreadPoolExecutor with the following settings: core pool size = 5
max pool size = 10
keep alive time 30000
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/data/hop/test_mosaic/
isHidden:false
exists:true
isFiletrue
canRead:true
canWritetrue
canExecute:true
isAbsolute:true
lastModified:1738273704109
length:84
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Trying to load properties file from URL:file:/data/hop/test_mosaic/test_mosaic.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/data/hop/test_mosaic/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:true
lastModified:0
length:0
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/data/hop/test_mosaic/
isHidden:false
exists:true
isFiletrue
canRead:true
canWritetrue
canExecute:true
isAbsolute:true
lastModified:1736959770561
length:865
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/clm_model_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/em_scenario_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/downscale_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/meteor_force_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/model_grid_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/clm_variable_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/clm_period_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/time_period_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Trying to load properties file from URL:file:/data/hop/test_mosaic/datastore.properties
07 May 20:02:48 INFO   [gce.imagemosaic] - Required key Levels not found.
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Trying to load properties file from URL:file:/data/hop/test_mosaic/test_mosaic.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/data/hop/test_mosaic/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:true
lastModified:0
length:0
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/data/hop/test_mosaic/
isHidden:false
exists:true
isFiletrue
canRead:true
canWritetrue
canExecute:true
isAbsolute:true
lastModified:1736959770561
length:865
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/clm_model_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/em_scenario_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/downscale_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/meteor_force_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/model_grid_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/clm_variable_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/clm_period_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/opt/
isHidden:false
exists:false
isFilefalse
canRead:false
canWritefalse
canExecute:false
isAbsolute:false
lastModified:0
length:0
07 May 20:02:48 INFO   [catalog.index] - Unable to access the file for this PropertyCollector: /opt/time_period_regex.properties
07 May 20:02:48 DEBUG  [gce.imagemosaic] - Checking file:/data/hop/test_mosaic/
isHidden:false
exists:true
isFiletrue
canRead:true
canWritetrue
canExecute:false
isAbsolute:true
lastModified:1746641074172
length:469
07 May 20:02:48 DEBUG  [geotools.jdbc] - CREATE CONNECTION
07 May 20:02:48 DEBUG  [geotools.jdbc] - Metadata table GT_PK_METADATA was not found
07 May 20:02:48 DEBUG  [geotools.jdbc] - Getting information about primary keys of test_mosaic
07 May 20:02:48 DEBUG  [geotools.jdbc] - Grabbing table pk metadata: SELECT "fid" FROM "public"."test_mosaic" WHERE 0=1
07 May 20:02:48 DEBUG  [geotools.jdbc] - CLOSE CONNECTION
07 May 20:02:48 DEBUG  [geotools.jdbc] - CREATE CONNECTION
07 May 20:02:48 DEBUG  [geotools.jdbc] - Geometry type check; SELECT TYPE FROM geometry_columns WHERE F_TABLE_SCHEMA = 'public' AND F_TABLE_NAME = 'test_mosaic' AND f_geometry_column = 'the_geom' 
07 May 20:02:48 DEBUG  [geotools.jdbc] - Geography srid check; SELECT SRID FROM GEOGRAPHY_COLUMNS WHERE F_TABLE_SCHEMA = 'public' AND F_TABLE_NAME = 'test_mosaic' AND F_GEOGRAPHY_COLUMN = 'the_geom' 
07 May 20:02:48 DEBUG  [geotools.jdbc] - Geometry srid check; SELECT SRID FROM GEOMETRY_COLUMNS WHERE F_TABLE_SCHEMA = 'public' AND F_TABLE_NAME = 'test_mosaic' AND F_GEOMETRY_COLUMN = 'the_geom' 
07 May 20:02:48 DEBUG  [geotools.jdbc] - Geography srid check; SELECT COORD_DIMENSION FROM GEOGRAPHY_COLUMNS WHERE F_TABLE_SCHEMA = 'public' AND F_TABLE_NAME = 'test_mosaic' AND F_GEOGRAPHY_COLUMN = 'the_geom' 
07 May 20:02:48 DEBUG  [geotools.jdbc] - Geometry srid check; SELECT COORD_DIMENSION FROM GEOMETRY_COLUMNS WHERE F_TABLE_SCHEMA = 'public' AND F_TABLE_NAME = 'test_mosaic' AND F_GEOMETRY_COLUMN = 'the_geom' 
07 May 20:02:48 DEBUG  [geotools.jdbc] - CLOSE CONNECTION
07 May 20:02:48 DEBUG  [imagemosaic.catalog] - BBOXFilterExtractor::extractBasicProperties(): geometryPropertyName is set to 'the_geom'.
07 May 20:02:48 DEBUG  [geotools.jdbc] - CREATE CONNECTION
07 May 20:02:48 DEBUG  [geotools.jdbc] - CLOSE CONNECTION
07 May 20:02:48 ERROR  [geoserver.rest] - Failed to locate the input file file:///data/hop/test_mosaic
org.geoserver.rest.RestException 400 BAD_REQUEST: Failed to locate the input file file:///data/hop/test_mosaic

This was the curl command I gave it:

curl -v -u username:password -XPOST -H "Content-type: text/plain" -d "file:///data/hop/test_mosaic" "http://localhost:8080/geoserver/rest/workspaces/chap/coveragestores/test_mosaic/external.imagemosaic"

I have verified in the docker container the data (including the regex files) all exist at /data/hop/test_mosaic.

In our docker compose we do have this setup… I wonder if that is somehow making it go look in /opt for our regex files even though all this line should be doing is saying that anything in /opt should be owned by tomcat.

CHANGE_OWNERSHIP_ON_FOLDERS="/opt"

It’s possible that the “File System Sandbox Isolation” security feature added in 2.26.2 may be causing your problem: GeoServer 2.26.2 Release

Is the sandbox isolation feature optional, or is it something that needs to be configured while setting up the Docker container?

If it is mandatory then few questions
Suppose I have a directory X on the host machine that is mounted to path Y inside the Docker container. I want to restrict GeoServer’s sandbox to only path Y, so I set GEOSERVER_FILESYSTEM_SANDBOX=Y. However, even after setting this, GeoServer is still unable to locate the files.

I thought the file system sandbox isolation was optional and something you need to enable in order to use. See the GEOSERVER_FILESYSTEM_SANDBOX documentation where the value needs to be set as an application property…

Do we have confirmation adjusting this setting resolves the failure above?

I tried setting the environment variable while configuring the container and pointed it to a mounted path inside the container, but the issue still persisted — the file couldn’t be located. For now, we’ve downgraded to version 2.25.1, and we’ll consider upgrading again if a solution becomes available in the future.

At least upgrade to 2.25.7, please. Did you see the recent announcement?

https://geoserver.org/announcements/vulnerability/2025/05/13/geoserver-2-25-7-released.html

Peter