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

Geoserver 500 error when creating style in load_geoserver #860

Closed
edsu opened this issue Mar 15, 2024 · 1 comment · Fixed by #861
Closed

Geoserver 500 error when creating style in load_geoserver #860

edsu opened this issue Mar 15, 2024 · 1 comment · Fixed by #861
Labels

Comments

@edsu
Copy link
Contributor

edsu commented Mar 15, 2024

The load_geoserver step sometimes encounters a 500 error when attempting to create a GeoServer Style:

style.create(style_name: raster_style, filename: nil)

The data for triggering the error can be found in Difficult Data 003.zip . You should be able to trigger the error by loading that data through Preassembly.

The error in gis-robot-suite log looks like:

I, [2024-03-15T09:11:46.069142 #999389]  INFO -- : druid:rz417vq6403 processing load-geoserver (gisDeliveryWF)
E, [2024-03-15T09:11:46.354012 #999389] ERROR -- : 500
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/geoserver-publish-1.0.0/lib/geoserver/publish/connection.rb:35:in `post'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/geoserver-publish-1.0.0/lib/geoserver/publish/style.rb:31:in `create'
/opt/app/lyberadmin/gis-robot-suite/releases/20240314225225/lib/robots/dor_repo/gis_delivery/load_geoserver.rb:235:in `create_raster'
/opt/app/lyberadmin/gis-robot-suite/releases/20240314225225/lib/robots/dor_repo/gis_delivery/load_geoserver.rb:41:in `perform_work'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/lyber-core-7.4.2/lib/lyber_core/robot.rb:58:in `block in perform'
/usr/local/rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/benchmark.rb:311:in `realtime'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/lyber-core-7.4.2/lib/lyber_core/robot.rb:57:in `perform'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/sidekiq-7.2.2/lib/sidekiq/processor.rb:210:in `execute_job'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/sidekiq-7.2.2/lib/sidekiq/processor.rb:180:in `block (4 levels) in process'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/sidekiq-7.2.2/lib/sidekiq/middleware/chain.rb:180:in `traverse'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/sidekiq-7.2.2/lib/sidekiq/middleware/chain.rb:183:in `block in traverse'
/opt/app/lyberadmin/gis-robot-suite/shared/bundle/ruby/3.2.0/gems/sidekiq-pro-7.2.0/lib/sidekiq/batch/middleware.rb:58:in `call'
?rz417vq6403
...

There is more information in the GeoServer log, which you can see once you log in to https://earthworks-geoserver-stage-b.stanford.edu and and navigate to Geoserver Logs:

15 Mar 10:47:30 ERROR  [geoserver.rest] - No such style: raster_rz417vq6403
org.geoserver.rest.ResourceNotFoundException 404 NOT_FOUND: No such style: raster_rz417vq6403
        at org.geoserver.rest.catalog.StyleController.getStyleInternal(StyleController.java:283)
        at org.geoserver.rest.catalog.StyleController.styleGet(StyleController.java:262)
        at jdk.internal.reflect.GeneratedMethodAccessor1007.invoke(Unknown Source)
        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)
@edsu edsu added the bug label Mar 15, 2024
@edsu
Copy link
Contributor Author

edsu commented Mar 15, 2024

After some experimentation on the command line it looks like GeoServer is throwing a 500 error because filename is nil.

style.create(style_name: raster_style, filename: nil)

Based on my reading of the PR that created this functionality I think we can set filename to then name of the layer + ".sld"

edsu added a commit that referenced this issue Mar 15, 2024
Calling [Style.create](https://github.com/samvera-labs/geoserver-publish/blob/aec7c64311a17e2e948dd43b6523fdcc604d2837/lib/geoserver/publish/style.rb#L28-L32) without a filename causes Geoserver to throw a 500 error. This commit supplies a filename using the layer name + the ".sld" extension.

Fixes #860
edsu added a commit that referenced this issue Mar 15, 2024
Calling [Style.create](https://github.com/samvera-labs/geoserver-publish/blob/aec7c64311a17e2e948dd43b6523fdcc604d2837/lib/geoserver/publish/style.rb#L28-L32) without a filename causes Geoserver to throw a 500 error. This commit supplies a filename using the layer name + the ".sld" extension.

Fixes #860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant