Atlaslog / Field Notes / Services & tile access
Field note · Services & tile access
SLD uploaded but the map still uses the default grey
Quick answer
The SLD previews correctly inside GeoServer, yet GetMap returns the default grey fill. The log says the requested style is unavailable and falls back, usually because the style name lacks the workspace prefix or is not set as the layer default.
Symptom
- Log shows No such style: roads_style followed by Requested style roads_style is not available, using default style instead.
- The returned PNG is the auto-generated grey polygon with no custom colours.
- GetCapabilities lists the style for the layer but does not mark it default.
Checklist
- Search GetCapabilities for the layer's Style block and check the name and the default flag.
- Grep the GeoServer log for Requested style to see which style actually ran.
- Verify the STYLES parameter includes the workspace prefix, for example workspace:roads_style.
- Run DescribeFeatureType and compare attribute names, case included, with the filter PropertyName.
- Check the SLD namespace version: 1.0.0 uses an unprefixed StyledLayerDescriptor while 1.1.0 needs the sld prefix.
Fix
Request with the fully qualified name STYLES=workspace:roads_style, or make it the layer default with a PUT to /geoserver/rest/workspaces/{ws}/datastores/{ds}/layers/{layer} carrying layer.defaultStyle.name roads_style. Fix mismatched SLD element names and attribute spelling so the rules actually match.
Code
2026-10-29 11:03:12,441 WARN [geoserver.wms] -
No such style: roads_style
2026-10-29 11:03:12,443 INFO [geoserver.wms] -
Requested style roads_style is not available, using default style insteadcurl "http://127.0.0.1:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" \
| grep -A 6 "<Layer>" | grep -E "Name|Style"
Watch out
- Rewriting the whole SLD when the log already states that the style name resolved to nothing.
- Applying a LineSymbolizer to a polygon layer, which loads without error and simply draws nothing.
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Atlaslog (2026). SLD uploaded but the map still uses the default grey. https://www.jingweizhi.com/en/cookbook/geoserver-sld-not-applied.html (accessed 2026-11-03).