# Elastic APM 8.2, sourcemap not working, "unable to find sourcemap.url"

**URL:** <https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553>\
**Category:** APM\
**Tags:** fleet, rum, server, ui, docker\
**Created:** [October 13, 2022, 3:44pm UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553 "2022-10-13T15:44:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkf1](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mkf1](https://discuss.elastic.co/u/mkf1)\
**Post date:** [October 13, 2022, 3:44pm UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553/1 "2022-10-13T15:44:53Z")

</div>

Elastic APM 8.2, sourcemap does not work.

Sourcemaps uploaded and saved in Kibana without issues.  
Service version, service name looks good.

 ![firefox_OVAVpdCGWJ](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2fe9d2975614f224c74984ebdd0e5c884bd39a4b.png)

But it still always complains about "sourcemap.url not find":

 ![InkedInkedfirefox_Sa19qIgonM_LI](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d5ead793aa7699c6dd9eee66611ec7821473d20a.jpeg)

Any idea why I cant get this to work?

**Kibana version** :  
8.2.1

**Elasticsearch version** :  
8.2.1

**APM Server version** :  
8.2.1 (Elastic APM (Elastic Agent))

**APM Agent language and version** :

**Browser version** :

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
Docker. Elasticsearch (8.2.1), Kibana (8.2.1), Fleet-Server (8.2.1) and Elastic APM (8.2.1) running as containers.  
**EDIT**  
All services running as containers on the same host.

 ![WindowsTerminal_mAGv1GdZwH](https://us1.discourse-cdn.com/elastic/original/3X/d/f/df05e8c98393107028a09c1024e61e88a8319d3f.png)

**EDIT2:**

Here is the out from "elastic-agent inspect" on the APM instance/server:

Note: the URL for the fleet host, `https://elastic-monitoring-fleet.<redacted>:9200` is going to reverse proxy (nginx) which is in-front the fleet server.

 ![WindowsTerminal_N30j67Y7Ud](https://us1.discourse-cdn.com/elastic/original/3X/a/b/ab5f77dcc6c994fcd9a989d73170aa6efd43dbbc.png)

If anyone knows where I can see more information about the error I would like to know. I have checked multiple logs on the different services but can't find anything related to the souremap error.

---

<div class="post-metadata">

**Author:** ![Alberto\_Delgado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_delgado/32/98488_2.png) [@Alberto\_Delgado](https://discuss.elastic.co/u/Alberto_Delgado)\
**Post date:** [October 13, 2022, 5:21pm UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553/2 "2022-10-13T17:21:23Z")

</div>

Hi @mkf1,

Thanks for reaching out!

Could you have a look at [this](https://github.com/elastic/apm-agent-rum-js/issues/1289#issuecomment-1273438311)?

Also recommended to check [this](https://discuss.elastic.co/t/uploading-sourcemaps-from-aix-webserver/303526/20) for guidance

Thanks,  
Alberto

---

<div class="post-metadata">

**Author:** ![mkf1](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mkf1](https://discuss.elastic.co/u/mkf1)\
**Post date:** [October 14, 2022, 6:03am UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553/3 "2022-10-14T06:03:11Z")

</div>

Hi @Alberto_Delgado

Thank you.  
Yes I have seen that github issue. But we are not using relavete path in bundle\_filepath, we have absolute path.

In the first screenshot in my post you can see that the bundle\_filepath has the absolue path, e.g. `https://<redacted>/995.4364f50e3faea049cebb.js`

We have a simple powershell script which is using curl to upload the sourcemaps.

```auto
$files = Get-ChildItem -PATH $path -Recurse -Filter '*.map'

foreach ($file in $files)
{
    $fullname = $file.FullName
    $relativeSourceMapPath = $fullname.Replace($path, '')
    $relativeSourcefilePath = $relativeSourceMapPath.replace('.map', '')
    $relativeSourcefilePathURL = $relativeSourcefilePath.replace('\', '/')
    $absoluteSourcePath = "https://$iisHost" + $relativeSourcefilePathURL
    
    $CurlArguments = "-X", "POST",
        "$kibanaServerUrl/api/apm/sourcemaps",
        "-H", "Content-Type: multipart/form-data",
		"-H", "kbn-xsrf: true",
		"-H", "Authorization: Basic $kibanaBasicAuth",
        "--form", "service_name=$apmServiceName",
        "--form", "service_version=$version",
        "--form", "bundle_filepath=$absoluteSourcePath",
        "--form", "sourcemap=@$fullname",
        "--output", "nul",
        "--insecure",
        "--silent",
        "--show-error",
        "--fail"
        
	Write-Host "---"
    Write-Host "File: $absoluteSourcePath"
	Write-Host "File: $fullname"
    
    & $CurlExecutable @CurlArguments > $null 2>&1
}

```

This is working fine, we can't see any issue with how the sourcemaps are being uploaded and when we look at the Kibana `/api/apm/sourcemaps` endpoint the sourcemaps looks correct.

If there is any other log or anything I can look at to see why it fails with the "unable find sourcemap.url" error please let me now. I have checked all relveant logs that I know of in my elastic stack and can't see anything related to the sourcemap error.

---

<div class="post-metadata">

**Author:** ![mkf1](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mkf1](https://discuss.elastic.co/u/mkf1)\
**Post date:** [October 14, 2022, 10:55am UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553/4 "2022-10-14T10:55:42Z")

</div>

I have done two edits to my post and added some more information about setup and the output of "elastic-agent inspect" from the apm instance/container.

---

<div class="post-metadata">

**Author:** ![mkf1](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mkf1](https://discuss.elastic.co/u/mkf1)\
**Post date:** [October 14, 2022, 12:37pm UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553/5 "2022-10-14T12:37:22Z")

</div>

I can see that it is this code that is throwing the "unable find sourcemap.url" here [apm-server/fleet.go at 077d179ddff4d1bc5585a1b92d36ba068b02e585 · elastic/apm-server · GitHub](https://github.com/elastic/apm-server/blob/077d179ddff4d1bc5585a1b92d36ba068b02e585/internal/sourcemap/fleet.go#L99) .

If I understand correctly the apm-server is fetching the sourcemaps from the fleet-server via http request.  
Then I would expect to see entries in my http access log for my fleet-server ( `https://elastic-monitoring-fleet.<redacted>:9200`), but there is no entries at all in the access log about http requests on `/api/fleet/artifacts` from apm-server.

---

<div class="post-metadata">

**Author:** ![mkf1](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mkf1](https://discuss.elastic.co/u/mkf1)\
**Post date:** [October 16, 2022, 12:42pm UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553/6 "2022-10-16T12:42:53Z")

</div>

Hi @Alberto_Delgado  
I have figured out my issue  
I have created a github issue about it here [APM stacktrace doesn't work when more than 20 sourcemaps have been uploaded to /api/apm/sourcemaps · Issue #9372 · elastic/apm-server · GitHub](https://github.com/elastic/apm-server/issues/9372)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 6, 2022, 8:43am UTC](https://discuss.elastic.co/t/elastic-apm-8-2-sourcemap-not-working-unable-to-find-sourcemap-url/316553/7 "2022-11-06T08:43:29Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
