Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trimHeadFrames: Discarded unknown attribute and Source Maps not Applying #556

Closed
3 tasks
abgier-avraha opened this issue Mar 14, 2019 · 8 comments
Closed
3 tasks

Comments

@abgier-avraha
Copy link

abgier-avraha commented Mar 14, 2019

OS:

  • Windows
  • [ x] MacOS
  • Linux

Platform:

  • [ x] iOS
  • Android

Output of node -v && npm -v && npm ls --prod --depth=0

Config:

Sentry.config(environment.SENTRY_DSN).install();

I have following issue:

Screen Shot 2019-03-14 at 11 21 15 am
Screen Shot 2019-03-14 at 11 21 27 am
Screen Shot 2019-03-14 at 11 27 33 am

Steps to reproduce:

  • Populate index.js with the react native plugin for sentry
  • Create a Logger file and initialise sentry
  • Run the uploadSourceMaps script to bundle and upload our artifacts
  • This trimHeadFrames: Discarded unknown attribute has nothing to do with artifacts it seems because the error is still the same when I delete them all
// index.js

import './polyfill';
import { AppRegistry } from 'react-native';
import { App } from './src/App';
import { name as appName } from './app.json';
import Raven from 'raven-js';

require('react-native-sentry/lib/raven-plugin')(Raven);

AppRegistry.registerComponent(appName, () => App);
// Logger.ts

Sentry.config(environment.SENTRY_DSN).install();

Sentry.setRelease(environment.RELEASE);
Sentry.setTagsContext({
  environment: environment.APP_ENV,
  react: true,
});
// uploadSourceMaps.sh

SOURCE_MAP_PATH='.dist/main.jsbundle.map'
SOURCE_PATH='.dist/main.jsbundle'

rm -rf .dist/main.jsbundle.map
rm -rf .dist/main.jsbundle
react-native bundle \
  --dev false \
  --entry-file index.js \
  --bundle-output $SOURCE_PATH \
  --sourcemap-output $SOURCE_MAP_PATH

./node_modules/@sentry/cli/sentry-cli \
  --auth-token $SENTRY_AUTH_TOKEN \
  releases \
  --org *** \
  --project *** \
  files $RELEASE \
  upload $SOURCE_PATH "~/main.jsbundle" \

./node_modules/@sentry/cli/sentry-cli \
  --auth-token $SENTRY_AUTH_TOKEN \
  releases \
  --org *** \
  --project *** \
  files $RELEASE \
  upload-sourcemaps $SOURCE_MAP_PATH \
  --rewrite \
  --validate

Actual result:

  • Stack traces aren't source mapped on the Sentry issue
  • Sentry issue displayed message There was 1 error encountered while processing this event trimHeadFrames: Discarded unknown attribute

Expected result:

  • I expected no errors and I expected my stack trace to be source mapped
@abgier-avraha
Copy link
Author

abgier-avraha commented Mar 14, 2019

Solved:

Turns out my environment tag that I was logging with didn't match the environment of my artifacts. So I just removed that. Didn't fix the trimHeadFrames: Discarded unknown attribute but that doesn't seem to affect anything.

Sentry.setTagsContext({
  // environment: environment.APP_ENV,
  react: true,
});

@cruzach
Copy link
Contributor

cruzach commented May 16, 2019

@rmit-s3539777-abgier-avraha did you ever find out what could be causing the trimHeadFrames: Discarded unknown attribute? I'm getting the same message

@abgier-avraha
Copy link
Author

abgier-avraha commented May 18, 2019

@cruzach I didn't but does it affect anything for you? My source maps started working after removing the environment property but the trimHeadFrames issue still remains.

@cruzach
Copy link
Contributor

cruzach commented May 18, 2019

Doesn't seem to be affecting anything.

But even then, it's an eye sore so was curious what the root cause might be/how to get rid of it

@abgier-avraha abgier-avraha reopened this May 19, 2019
@untitaker
Copy link
Member

Hey, this can be safely ignored. This issue only surfaced recently because we implemented stricter payload validation on the server. We will fix this in the next major version of the SDK.

@cruzach
Copy link
Contributor

cruzach commented May 29, 2019

Awesome! That’s great to hear

Out of curiosity- do you have an ETA for the release?

@untitaker
Copy link
Member

No ETA, but we hope to get it out within the next weeks. Track this PR: #589

@HazAT
Copy link
Member

HazAT commented Sep 4, 2019

I am closing all old issues, please if this is still a problem feel free to revive it.
Also, consider moving to our new SDK @sentry/react-native if it still happens there please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants