expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
815 stars 83 forks source link

Sentry: Unrecognized auth token format! #2494

Closed anudit closed 1 month ago

anudit commented 2 months ago

Build/Submit details page URL

https://expo.dev/accounts/anuditnagar/projects/omnid-app/builds/a3617877-5ee5-4440-a9fb-31a8f3fccf01

Summary

EAS Build works locally with the same token but not on EAS. I have added the SENTRY_AUTH_TOKEN as an account secret.

Build logs

> Task :app:createBundleReleaseJsAndAssets_SentryUpload_com.cupoc.omnid@1.0.0+1_1
Copy `debugId` from packager source map to Hermes source map...
Done.
Check generated source map for Debug ID: 7ca05721-6ee4-4815-9782-bfeba7e08983
Sentry Source Maps upload will include the release name and dist.
Sentry-CLI arguments: [/home/expo/workingdir/build/node_modules/@sentry/cli/bin/sentry-cli, react-native, gradle, --bundle, /home/expo/workingdir/build/android/app/build/generated/assets/createBundleReleaseJsAndAssets/index.android.bundle, --sourcemap, /home/expo/workingdir/build/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map, --release, com.cupoc.omnid@1.0.0+1, --dist, 1]
Processing react-native sourcemaps for Sentry upload.
> Analyzing 2 sources
INFO    2024-08-14 03:26:43.349354735 +00:00 Loaded file referenced by SENTRY_PROPERTIES (/home/expo/workingdir/build/android/sentry.properties)
  WARN    2024-08-14 03:26:43.362943418 +00:00 Unrecognized auth token format!
    Hint: Did you copy your token correctly?
> Task :expo-dev-menu-interface:compileReleaseJavaWithJavac
> Task :expo-dev-menu-interface:bundleLibCompileToJarRelease
> Task :expo-updates-interface:compileReleaseKotlin
> Task :expo-updates-interface:compileReleaseJavaWithJavac
> Task :expo-updates-interface:bundleLibCompileToJarRelease
> Task :app:createBundleReleaseJsAndAssets_SentryUpload_com.cupoc.omnid@1.0.0+1_1 FAILED
> Rewriting sources
> Adding source map references
error: API request failed
  caused by: sentry reported an error: Invalid org token (http status: 401)
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
> Task :app:createBundleReleaseJsAndAssets_SentryUploadCleanUp SKIPPED

FAILURE: Build failed with an exception.
* Where:
Script '/home/expo/workingdir/build/node_modules/@sentry/react-native/sentry.gradle' line: 142
* What went wrong:
Execution failed for task ':app:createBundleReleaseJsAndAssets_SentryUpload_com.cupoc.omnid@1.0.0+1_1'.
> Process 'command '/home/expo/workingdir/build/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 7m 22s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
716 actionable tasks: 716 executed
Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

Managed or bare?

Managed

Environment

Creating new worker instance Intel, 4 vCPUs, 16 GB RAM Using image "ubuntu-22.04-jdk-17-ndk-26.1.10909125" based on "ubuntu-2204-jammy-v20240614" Installed software:

Error output

No response

Reproducible demo or steps to reproduce from a blank project

szdziedzic commented 2 months ago

Hi @anudit,

As a sanity check can you try to run npx -y @sentry/cli info

  1. locally using the SENTRY_AUTH_TOKEN you use for local builds
  2. during the build process in the pre-install hook while using a build that uses SENTRY_AUTH_TOKEN secret

?

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

henrynewman commented 2 weeks ago

For those looking for solution to this in the future this doc has everything - https://docs.expo.dev/guides/using-sentry/

For those using eas build make sure you have set your SENTRY_AUTH_TOKEN