Atlaslog
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.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: GeoServer 2.25
Symptom
Checklist
  1. Search GetCapabilities for the layer's Style block and check the name and the default flag.
  2. Grep the GeoServer log for Requested style to see which style actually ran.
  3. Verify the STYLES parameter includes the workspace prefix, for example workspace:roads_style.
  4. Run DescribeFeatureType and compare attribute names, case included, with the filter PropertyName.
  5. 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 instead
curl "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
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

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).