RUM APM sourcemaps not displaying in kibana

Hello everone, I am trying to setup frontend sourcemaps for better error reporting in kibana APM. I tried many things but nothing seems to work and the errors keep being reported with the production filenames instead of the source names. Here's what I have done maybe someone will find my mistake or point where I should be looking? I have followed this guide Create and upload source maps (RUM) | Elastic Docs

For testing purposes I created a "dummy" error in the application and made sure it was correctly reported:

I then uploaded the 2 concerned chunks with this curl:

curl -X POST --insecure "$KIBANA_SOURCEMAP_ENDPOINT" \
          -H "Content-Type: multipart/form-data" \
          -H "kbn-xsrf: true" \
          -H "Authorization: ApiKey $KIBANA_API_KEY" \
          -F "service_name=x-frontend" \
          -F "service_version=1.0" \
          -F "bundle_filepath=chunk-RN6WJJYZ.js" \
          -F "sourcemap=@./chunk-RN6WJJYZ.js.map"

Making sure that the metadata from the error show consistent service name and version

Disclaimer: the X both in the curl service_name and the image are exactly the same value, hidden to hide the application name.

I have then validated that the sourcemaps were correctly stored using

curl -X GET--insecure "$KIBANA_SOURCEMAP_ENDPOINT" \
          -H "kbn-xsrf: true" \
          -H "Authorization: ApiKey $KIBANA_API_KEY"

Which returned

{
  "artifacts": [
    {
      "type": "sourcemap",
      "identifier": "x-frontend-1.0",
      "relative_url": "/api/fleet/artifacts/x-frontend-1.0/64dbd6a66d6f47d34cad54cc3a196814c11348da0ff709acc7c62e978b505254",
      "body": {
        "serviceName": "x-frontend",
        "serviceVersion": "1.0",
        "bundleFilepath": "chunk-5NR7QMPW.js",
        "sourceMap": {
          "version": 3,
          "sources": ["..."],
          "sourcesContent": ["..."],
          "mappings": "...",
          "names": ["..."]
        }
      },
      "created": "2026-04-16T13:27:39.084Z",
      "id": "apm:x-frontend-1.0-64dbd6a66d6f47d34cad54cc3a196814c11348da0ff709acc7c62e978b505254",
      "compressionAlgorithm": "zlib",
      "decodedSha256": "64dbd6a66d6f47d34cad54cc3a196814c11348da0ff709acc7c62e978b505254",
      "decodedSize": 124121,
      "encodedSha256": "043f0eef04e776b75a40ed4665efaca7ab76601708906d71a5091206527c7748",
      "encodedSize": 28917,
      "encryptionAlgorithm": "none",
      "packageName": "apm"
    },
    {
      "type": "sourcemap",
      "identifier": "x-frontend-1.0",
      "relative_url": "/api/fleet/artifacts/x-frontend-1.0/f234fb0d0952addf110852ce9cb07e39fd40fe0471c6c579856761d8348d9ed1",
      "body": {
        "serviceName": "x-frontend",
        "serviceVersion": "1.0",
        "bundleFilepath": "chunk-RN6WJJYZ.js",
        "sourceMap": {
          "version": 3,
          "sources": ["..."],
          "sourcesContent": ["..."],
          "mappings": "...",
          "names": ["..."],
          "x_google_ignoreList": ["..."]
        }
      },
      "created": "2026-04-16T13:27:44.383Z",
      "id": "apm:x-frontend-1.0-f234fb0d0952addf110852ce9cb07e39fd40fe0471c6c579856761d8348d9ed1",
      "compressionAlgorithm": "zlib",
      "decodedSha256": "f234fb0d0952addf110852ce9cb07e39fd40fe0471c6c579856761d8348d9ed1",
      "decodedSize": 1544257,
      "encodedSha256": "67e8f5466814e3adacb8a0005cb51147fb8e56e0647910f4af7cd794006e338b",
      "encodedSize": 351572,
      "encryptionAlgorithm": "none",
      "packageName": "apm"
    }
  ]
}

I have also tried to upload the sourcemap using absolute URLs using the exact file paths on the server but that did not change anything.

I have also tried waiting different intervals after the upload of the sourcemaps to trigger the error again, 5 mins, 1hour, 12 hour...Because, we never know :man_shrugging:

Any idea where I should be looking to troubleshoot this?

Had to remove the screenshot for the metadata:

Hi MathDP,

are you using Elastic APM RUM JS, OTel Browser or EDOT Browser to collect and send the telemetry data?

Hello hegerchr, thanks for your interest in my situation!

We are using APM RUM js, throught the @elastic/apm-rum-angular package

Source mapping happens in APM Server when a new RUM event arrives. I'd check the indexed error next, since listing the uploaded maps doesn't show whether the server applied them (docs).

On Stack 8.x/9.x, trigger the dummy error again, then run this in Kibana Dev Tools, using your actual service name:

GET logs-apm.error-*/_search
{
  "size": 1,
  "sort": [{"@timestamp": "desc"}],
  "query": {
    "bool": {
      "filter": [
        {"term": {"service.name": "x-frontend"}},
        {"range": {"@timestamp": {"gte": "now-15m"}}}
      ]
    }
  },
  "_source": [
    "@timestamp", "service.name", "service.version", "observer.version",
    "error.exception.stacktrace", "error.log.stacktrace"
  ]
}

For a frame from one of those chunks, compare abs_path with the uploaded bundle_filepath, along with the document's service.name and service.version. Use the bundle URL the browser loaded, including any path prefix. Also check lineno, colno and the frame's sourcemap fields. A missing sourcemap.error doesn't rule out a lookup miss, that changed in APM Server 8.0.

If those values match and the frame remains unmapped, check the receiving APM Server's logs and source-map read access. The upload key and the server's credentials are separate. Direct reads need read on .apm-source-map (permissions). For a standalone server sending through Logstash or Kafka, also check its source-map Elasticsearch connection.

What Stack/APM Server version are you using, and is APM Fleet-managed or standalone? Could you share one redacted frame from that fresh error?

Thanks for the detailed check, Aditya — one Angular-specific thing worth adding for MathDP: with @elastic/apm-rum-angular, the chunk filenames are hashed, so a new build changes the bundle filename and the service version the map was uploaded for. If you redeployed after uploading, upload the maps again for the new build and trigger a fresh dummy error — sourcemaps only apply to errors that arrive after the upload, not to errors already indexed. Also compare the exact path the browser loaded, including any base-href or deploy-url prefix, with the bundle_filepath you uploaded; even a missing leading slash or an extra prefix is enough for the lookup to miss. Checking the service name and version in the error document against the uploaded map, as Aditya suggested, is the quickest way to confirm that mismatch.

I had the same issue when the bundle filename changed after a rebuild and the sourcemap upload was stale. make sure the @metadata.sourcemap field appears in the indexed error doc and that the version matches the uploaded map