SourceMaps don't show for all Errors

Some errors are pointing to the bundle.js files event tho I have uploaded the Source Maps.

Kibana version: 7.1

Elasticsearch version: 7.1

APM Server version:

APM Agent language and version:

Original install method (e.g. download page, yum, deb, from source, etc.) and version:

Fresh install or upgrade from other versions?:

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Using Angular 5 /CLI 1.7.4 to generate Source Maps and

  • Angular 5 app with "@elastic/apm-rum": "^4.3.0",
  • Using Angular CLI 1.7.4 to generate Source Maps
  • Using CURL to upload them all to APM cloud server

(code)

npm config set user root
npm config set user root
npm install -g @angular/cli@1.7.4
npm install
ng build --sourcemaps=true --prod
echo "Uploading sourcemaps..."
cd dist/
ls -l
echo "starting curl part"
for i in *.map
do
  MAPNAME=$i
  BASENAME=$(basename $i .map)
  curl -X POST https://ASDF.apm.eu-west-1.aws.cloud.es.io:443/assets/v1/sourcemaps \
  -H "Authorization: Bearer tokenxxxyyy" \
  -F service_name="simplesite-checkout-app" \
  -F service_version="1.0" \
  -F bundle_filepath="https://www.ASD.com/checkout/$BASENAME" \
  -F sourcemap=@./$MAPNAME
done
echo "Deleting sourcemaps..."
rm -rf *.map

Hi @akosanovic, could you query for the error groups where you see references to a minified js and see what is stored in the sourcemap fields of those errors.

GET apm*error*/_search
{
  "query": {
    "term": {
      "error.grouping_key": {
        "value": "3fc00..."
      }
    }
  }
}

Check for error and updated in error.exceptions.stacktrace.sourcemap.*

Hi @simitt, thank you for your response.

I've looked over *bundle.js errors and they all have :

     "sourcemap": {
           "updated": true
     },

I'm new to APM so I'm not really sure what that means?

This looks like the sourcemaps were applied from within the APM Server then. For every updated stacktrace frame there should be a group original storing information before applying the sourcemapping. Can you compare the values of error.exceptions.stacktrace.[].sourcemap.original.filename and error.exceptions.stacktrace.[]sourcemap.filename? They should have a different value. If they show the same value for a frame where sourcemap.updated: true, could you please verify the sourcemap you uploaded is actually valid?

error.exceptions.stacktrace.[].sourcemap.original.filename and error.exceptions.stacktrace.[]sourcemap.filename are indeed showing the same values for each stacktrace with sourcemap being:

"sourcemap":{ 
   "updated":true
 },

Sourcemap seems valid, it's generated at the same time and looks like other sourcemaps.

That does sound as if either the sourcemap is not valid or missing a mapping for this stacktrace frame, or the sourcemap library we are using internally has a bug.

I cannot reproduce this issue locally, as the sourcemap functionality generally works as expected and I don't have a sourcemap file for which it doesn't. Is it possible for you to verify your sourcemap, e.g. by using another tool to validate and apply the sourcemap?