2

I have just seriously broken my geoserver installation.

We were fiddling around trying to create a new style, and didn't realize we have overriden the default raster.xml style. I renamed the style back to raster.xml and regenerated and forgot about the issue.

But I just restarted geoserver this morning, and now all of my services are broken, for all layers that used the raster style.

Checking the style page, I see the raster style duplicated:

enter image description here

I cannot remove them from the GUI, because It is prevented "can't remove default style".

I have also tried to remove the files in the data folder, as well as clear the cache, without being able to correct the problem so far.

Now, the main issue is that I cannot assign/unassign styles to my layers any more, because I get a nullpointerexception trying to get in the window.

enter image description here

Is there any way I can recover from this?

1

Mind, before following these suggestions, do a backup of the data directory (and mind, I did not try these instructions, it's just how I'd expect would need to be done, so really do the backup).

Once done:

  • Take a layer that has a broken style, and open the $data_dir/worskpaces/wsName/storeName/layerName/layer.xml file
  • Look for defaultStyle and note down its id, e.g.:

<defaultStyle> <id>StyleInfoImpl--570ae188:124761b8d78:-7fec</id> </defaultStyle>

  • Go to the styles directory, remove the xml file of the duplicate raster style
  • Open raster.xml and set the id to be the one you noted down before
  • Restart GeoServer and cross your fingers

Btw, the issue about style duplication is known, I believe further damage has been done by the manual changes done trying to fix it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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