Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geo tif upload via API results in "failed to create coverage/layer" error #11518

Closed
hyphae-lab opened this issue Sep 20, 2023 · 14 comments
Closed
Assignees
Labels
investigation minor A low priority issue which might affect only some users and /or not the main functionality

Comments

@hyphae-lab
Copy link

Expected Behavior

I upload via command line curl call to API (with correct oauth application/token). I expect the execution job to say "status: running" or "status: finished".

Actual Behavior

I get

{
  "request": {
    "exec_id": "e22eca1c-a7c4-40e8-8ec5-808bb3523e09",
    "status": "failed",
    "func_name": "rollback",
    "created": "2023-09-20T20:59:52.111470Z",
    "finished": "2023-09-20T20:59:52.693807Z",
    "last_updated": "2023-09-20T20:59:52.693817Z",
    "input_params": {
      "files": {
        "base_file": "/mnt/volumes/statics/uploaded/tmp7fq7v8vg/svf.tif"
      },
      "total_layers": 1,
      "store_spatial_file": true,
      "handler_module_path": "importer.handlers.geotiff.handler.GeoTiffFileHandler",
      "skip_existing_layers": false,
      "overwrite_existing_layer": false
    },
    "output_params": {
      "errors": [
        "Task: importer.publish_resource raised an error during actions for layer: import: Failed to create coverage/layer svf_5ec5bdae6976dbe40fdfb6906b3ea729 for : svf_5ec5bdae6976dbe40fdfb6906b3ea729, 500. Request: e22eca1c-a7c4-40e8-8ec5-808bb3523e09"
      ],
      "failed_layers": [
        "import"
      ]
    },
    "step": "importer.rollback",
    "log": "Failed to create coverage/layer svf_5ec5bdae6976dbe40fdfb6906b3ea729 for : svf_5ec5bdae6976dbe40fdfb6906b3ea729, 500. Request: e22eca1c-a7c4-40e8-8ec5-808bb3523e09",
    "name": "svf.tif",
    "action": "import",
    "source": "upload",
    "user": 1001,
    "geonode_resource": null,
    "link": "https://some.domain/api/v2/executionrequest/e22eca1c-a7c4-40e8-8ec5-808bb3523e09"
  }
}

Steps to Reproduce the Problem

  1. curl --location --request POST -k -H 'Authorization: Bearer $access_token' -F '[email protected]' 'https://some.domain/api/v2/uploads/upload'
  2. i get the execution job ID from the response and make another API call to https://some.domain/api/v2/executionrequest/
  3. i receive the JSON response (above)

Specifications

  • GeoNode version: 4.0
  • Installation type (vanilla, geonode-project): geonode-project
  • Installation method (manual, docker): docker
  • Platform: Debian GNU/Linux 11 (bullseye)
  • Additional details: geoserver 2.23, nginx
@ridoo
Copy link
Contributor

ridoo commented Sep 21, 2023

Could you please add some GeoServer Logs? The logs can be found in its data dir: /geoserver_data/data/logs/geoserver.logs

@mattiagiupponi
Copy link
Contributor

mattiagiupponi commented Sep 24, 2023

Geonode and Geoserver should be able to access the default upload folder (MEDIA_ROOT).
In case it is not accessible, please consider adding it to the geonode settings the following:

FILE_UPLOAD_DIRECTORY_PERMISSIONS

Information about how to set it up are here:
https://docs.djangoproject.com/en/dev/ref/settings/#file-upload-directory-permissions

@Raji-Ahmad
Copy link

Raji-Ahmad commented Nov 8, 2023

I'm facing the same problem on 4.1.x. How do I solve this?

On closer inspection, the data doesn't actually get saved on disc "uploaded/tempcnn/data.tif" and Geoserver can't access it.

Vector files works, only raster (tif) images doesn't.

@mattiagiupponi
Copy link
Contributor

I'm facing the same problem on 4.1.x. How do I solve this?

On closer inspection, the data doesn't actually get saved on disc "uploaded/tempcnn/data.tif" and Geoserver can't access it.

Vector files works, only raster (tif) images doesn't.

Hi @Raji-Ahmad
Please as suggested by @ridoo share the geoserver logs and try to set FILE_UPLOAD_DIRECTORY_PERMISSIONS and FILE_UPLOAD_PERMISSIONS to 0o777 to see if is able to read/write in the folder

@Raji-Ahmad
Copy link

Raji-Ahmad commented Nov 9, 2023

Thanks for your reply @mattiagiupponi

Setting the FILE_UPLOAD_DIRECTORY_PERMISSIONS and FILE_UPLOAD_PERMISSIONS to 0o777 doesn't fix it.

All Vector files work perfectly. Only ."tif" raster images have this issue. Vector files were saved in /opt/geonode/geonode/uploaded/ and accessed successfully.

This is geoserver log:

at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:77)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:49)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.FileNotFoundException: File /opt/geonode/geonode/uploaded/tmp04qn8lrd/Basement depth.tif does not exist.
	at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java:257)
	... 125 more
08 Nov 09:49:43 ERROR  [geoserver.rest] - Failed to create reader from file:/opt/geonode/geonode/uploaded/tmp04qn8lrd/Basement depth.tif and hints Hints:
  REPOSITORY       = org.geoserver.catalog.CatalogRepository@240ab25                                                                                    
  EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@4a64d26a[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
System defaults:
  COMPARISON_TOLERANCE             = 1.0E-8                                                 
  STYLE_FACTORY                    = StyleFactoryImpl                                       
  FILTER_FACTORY                   = FilterFactoryImpl                                      
  FEATURE_FACTORY                  = org.geotools.feature.LenientFeatureFactoryImpl@31d82e5a
  LENIENT_DATUM_SHIFT              = true                                                   
  GRID_COVERAGE_FACTORY            = GridCoverageFactory                                    
    TILE_ENCODING                  = null                                                   
  FORCE_AXIS_ORDER_HONORING        = http                                                   
  FORCE_LONGITUDE_FIRST_AXIS_ORDER = true                                                   

java.io.IOException: Failed to create reader from file:/opt/geonode/geonode/uploaded/tmp04qn8lrd/Basement depth.tif and hints Hints:
  REPOSITORY       = org.geoserver.catalog.CatalogRepository@240ab25                                                                                    
  EXECUTOR_SERVICE = java.util.concurrent.ThreadPoolExecutor@4a64d26a[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
System defaults:
  COMPARISON_TOLERANCE             = 1.0E-8                                                 
  STYLE_FACTORY                    = StyleFactoryImpl                                       
  FILTER_FACTORY                   = FilterFactoryImpl                                      
  FEATURE_FACTORY                  = org.geotools.feature.LenientFeatureFactoryImpl@31d82e5a
  LENIENT_DATUM_SHIFT              = true                                                   
  GRID_COVERAGE_FACTORY            = GridCoverageFactory                                    
    TILE_ENCODING                  = null                                                   
  FORCE_AXIS_ORDER_HONORING        = http                                                   
  FORCE_LONGITUDE_FIRST_AXIS_ORDER = true                                                   

	at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1596)
	at org.geoserver.catalog.ResourcePool.getGridCoverageReader(ResourcePool.java:1534)
	at org.geoserver.catalog.impl.CoverageStoreInfoImpl.getGridCoverageReader(CoverageStoreInfoImpl.java:57)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.geoserver.catalog.impl.ModificationProxy.invoke(ModificationProxy.java:144)
	at com.sun.proxy.$Proxy202.getGridCoverageReader(Unknown Source)
	at org.geoserver.rest.catalog.CoverageStoreController.delete(CoverageStoreController.java:196)
	at org.geoserver.rest.catalog.CoverageStoreController.coverageStoreDelete(CoverageStoreController.java:180)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doDelete(FrameworkServlet.java:931)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:561)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:623)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:73)
	at org.geoserver.flow.controller.IpBlacklistFilter.doFilter(IpBlacklistFilter.java:89)
	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
	at org.geoserver.ows.HTTPHeadersCollector.doFilter(HTTPHeadersCollector.java:48)
	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
	at org.geoserver.filters.HTTPMethodFilter.doFilter(HTTPMethodFilter.java:36)
	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
	at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:194)
	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
	at org.geoserver.monitor.MonitorFilter.doFilter(MonitorFilter.java:90)
	at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
	at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:43)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:39)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
	at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
	at org.geoserver.security.oauth2.GeoServerOAuthAuthenticationFilter.doFilter(GeoServerOAuthAuthenticationFilter.java:166)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
	at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:81)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:71)
	at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilterInternal(GeoServerSecurityContextPersistenceFilter.java:72)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:75)
	at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186)
	at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:142)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:77)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:49)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:42)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:829) 

@mattiagiupponi
Copy link
Contributor

mattiagiupponi commented Nov 9, 2023

All Vector files work perfectly. Only ."tif" raster images have this issue. Vector files were saved in /opt/geonode/geonode/uploaded/ and accessed successfully.

For the Vector data geoserver does not need to access directly the file while for raster it needs.

Are you running the system in docker?

From what i see, the path where your file are saved is not the default one that the .env file set.

The defaults one are the following

STATIC_ROOT=/mnt/volumes/statics/static/
MEDIA_ROOT=/mnt/volumes/statics/uploaded/

Because are mounted in a volume and shared between the containers, while /opt/geonode/geonode/uploaded/ it looks more a local path to me

Can you please do the following:

  • Post here the alue of STATIC_ROOT and MEDIA_ROOT
  • Change the value of STATIC_ROOT and MEDIA_ROOT to the default one i posted
  • keep the value for FILE_UPLOAD_DIRECTORY_PERMISSIONS and FILE_UPLOAD_PERMISSIONS
  • run ls -al /opt/geonode/geonode/uploaded/ from the geoserver container and paste the output

Please change STATIC_ROOT and MEDIA_ROOT in the .env file and FILE_UPLOAD_DIRECTORY_PERMISSIONS and FILE_UPLOAD_PERMISSIONS in the settings.py, rebuild and restart the containers

ps: please use the create-envfile.py script available to generate the appropiate env file (doc)

@Raji-Ahmad
Copy link

Raji-Ahmad commented Nov 9, 2023

I'm not running on Docker.

While debugging, I discovered that the file dets were created in the correct path, the same as a vector file. The reason I thought it wasn't created was that the Geonode importer deletes the file automatically when an exception happens. See this:

importer/api/views.py

I was able to track the problem to importer/handlers/common/raster.py

Then final call to geoserver catalog gives error code 500:

geoserver/catalog.py

@Raji-Ahmad
Copy link

I'm probably not setting the FILE_UPLOAD_DIRECTORY_PERMISSIONS and FILE_UPLOAD_PERMISSIONS well. This was what I used in settings.py;

FILE_UPLOAD_DIRECTORY_PERMISSIONS = "0o777"
FILE_UPLOAD_PERMISSIONS = "0o777"

@mattiagiupponi
Copy link
Contributor

I'm probably not setting the FILE_UPLOAD_DIRECTORY_PERMISSIONS and FILE_UPLOAD_PERMISSIONS well. This was what I used in settings.py;

FILE_UPLOAD_DIRECTORY_PERMISSIONS = "0o777" FILE_UPLOAD_PERMISSIONS = "0o777"

Try by setting them as a number instead of a string

FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o777
FILE_UPLOAD_PERMISSIONS = 0o777

@Raji-Ahmad
Copy link

I'm probably not setting the FILE_UPLOAD_DIRECTORY_PERMISSIONS and FILE_UPLOAD_PERMISSIONS well. This was what I used in settings.py;

FILE_UPLOAD_DIRECTORY_PERMISSIONS = "0o777" FILE_UPLOAD_PERMISSIONS = "0o777"

Try by setting them as a number instead of a string

FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o777
FILE_UPLOAD_PERMISSIONS = 0o777

@mattiagiupponi

Setting them as a number worked. Thanks for the support.

I couldn't find this in the documentation here.

[https://docs.geonode.org/en/master/install/advanced/core/index.html](geonode installation )

Maybe it can be included.

@mattiagiupponi
Copy link
Contributor

Hi @Raji-Ahmad
This is documented in the importer README.md and overall is a Django configuration and is not strictly related to GeoNode.

In Django the values are mentioned here and here.

But it might be worth to mention it, if you would like to contribute, please open a PR on the geonode-documentation repository.

Meanwhile i'm going to close this issue

@mattiagiupponi mattiagiupponi self-assigned this Nov 10, 2023
@mattiagiupponi mattiagiupponi added investigation minor A low priority issue which might affect only some users and /or not the main functionality labels Nov 10, 2023
@a13668349935
Copy link

FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o777
FILE_UPLOAD_PERMISSIONS = 0o777

update which file ?

@a13668349935
Copy link

image
/opt/geonode/geonode/settings.py
i updated this file ,it is not work

@a13668349935
Copy link

sudo systemctl restart geonode-uwsgi.service not work
reboot machine works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation minor A low priority issue which might affect only some users and /or not the main functionality
Projects
None yet
Development

No branches or pull requests

5 participants