Skip to content

Error while storing uploaded file #370

@ndne

Description

@ndne

Hello,

I'm not sure if this is the right repository to ask.

I have an issue where I can't create a store (I tried shapefile and gpkg) using the rest API.
Doing it from the web interface works well.
The rest API to create a workspace works as expected but when uploading a shapefile, geoserver returns:

[…]
geoserver-1 | 27 Jan 09:16:12 DEBUG [geoserver.security] - ~~~~~~~~~~ antPath= /** methodList= [POST, DELETE, PUT]
geoserver-1 | 27 Jan 09:16:12 DEBUG [geoserver.security] - Candidate is: '/rest/workspaces/acme/datastores/roads/file.shp'; antPath is /**; matchedPath=true; matchedMethods=true
geoserver-1 | 27 Jan 09:16:12 DEBUG [geoserver.security] - returning ROLE_ADMINISTRATOR
geoserver-1 | 27 Jan 09:16:12 TRACE [geoserver.monitor] - Testing /rest/workspaces/acme/datastores/roads/file.shp for monitor filtering
geoserver-1 | 27 Jan 09:16:12 DEBUG [geoserver.ows] - Could not find a layer group named rest
geoserver-1 | 27 Jan 09:16:12 DEBUG [org.geoserver] - Thread 41 locking in mode WRITE
geoserver-1 | 27 Jan 09:16:12 DEBUG [org.geoserver] - Thread 41 got the lock in mode WRITE
geoserver-1 | 27 Jan 09:16:12 DEBUG [security.impl] - Filesystem sandbox: /mnt/
geoserver-1 | 27 Jan 09:16:12 ERROR [geoserver.rest] - Error while storing uploaded file:
geoserver-1 | org.geoserver.rest.RestException 500 INTERNAL_SERVER_ERROR: Error while storing uploaded file:
[…]
geoserver-1 | Caused by: java.lang.IllegalStateException: Could not create file.
geoserver-1 | at org.geoserver.platform.resource.Files$ResourceAdaptor.file(Files.java:185)
geoserver-1 | at org.geoserver.platform.resource.Files$ResourceAdaptor.out(Files.java:111)
geoserver-1 | at org.geoserver.rest.util.RESTUtils.handleBinUpload(RESTUtils.java:128)
geoserver-1 | at org.geoserver.rest.catalog.AbstractStoreUploadController.handleFileUpload(AbstractStoreUploadController.java:70)
geoserver-1 | ... 139 more

I checked the file permissions by connecting to the geoserver instance and it's good. I can do touch file inside the /mnt/geoserver_datadir/workspace/acme.

Upload was working fine with the branch 23. (nginx -> traefik)

My configuration is nginx on the front (https) which reverse proxy to caddy (http).

I deactivated https in the caddyfile by commenting the tls line and adding http in front of the FQDN variable.
http://{$FQDN} {
}

I don't know if it is related but I needed to add the csrf environment variable to the geoserver docker service because some pages from the web admin were returning 400 error code. https://docs.geoserver.org/latest/en/user/security/webadmin/csrf.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions