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

Error logs about missing cli auth token after updated to 4.5 #697

Closed
G00fY2 opened this issue Apr 25, 2024 · 13 comments · Fixed by #700
Closed

Error logs about missing cli auth token after updated to 4.5 #697

G00fY2 opened this issue Apr 25, 2024 · 13 comments · Fixed by #700
Assignees
Labels
bug Something isn't working Platform: Android

Comments

@G00fY2
Copy link

G00fY2 commented Apr 25, 2024

Gradle Version

8.7

AGP Version

8.3.2

Code Minifier/Optimizer

None

Version

4.5

Sentry SDK Version

7.8.0

Steps to Reproduce

  • Add Sentry Android Gradle plugin to project
  • Configure the sentry plugin with ignoredBuildTypes.set(setOf("debug"))
  • Do not install or setup the Sentry CLI
  • run assembleDebug to build an Android project

Expected Result

Since the build type is ignored no sentry CLI task is executed and no Sentry errors are logged

Actual Result

We always see an Gradle error log with (the build luckily still succeeds)

Auth token is required for this request. Please run sentry-cli login and try again!

@tjohnn
Copy link

tjohnn commented Apr 26, 2024

Facing the same issue. The error is thrown from sentry-cli as described in 2.29.0 release notes. The error shows up when building app variants that don't have anything to do with sentry, which suggests that sentry is doing something unneeded under the hood.

@LionZXY
Copy link

LionZXY commented Apr 29, 2024

Same issue
Has anyone come up with a workaround for this yet?

@markushi
Copy link
Member

Hi everyone, thanks for reaching out!
I just tried to reproduce(same Gradle, AGP and sentry Gradle plugin versions) this quickly, but unfortunately couldn't.

Could you share a few more details about your setup?

  1. A snippet of your sentry { } .gradle config
  2. Are you using the new EU region?

Additionally our telemetry could be the root cause, as it utilizes sentry-cli under the hood. You can disable it via the configuration block and try if it works then.

sentry {
    telemetry.set(false)
}

Additionally you can enable debugging an run your gradle task with the --info flags to get more details about the tasks being executed.

sentry {
    debug.set(true)
}

@LionZXY
Copy link

LionZXY commented Apr 30, 2024

telemetry.set(false) does not work : (
That's a reproducible sample log:
https://github.com/flipperdevices/Flipper-Android-App/actions/runs/8887106408/job/24401803084?pr=840#step:4:11306

This branch with the command ./gradlew assembleInternal.

@G00fY2
Copy link
Author

G00fY2 commented Apr 30, 2024

Actually the error log is gone after configuring telemetry.set(false)! Maybe it makes sense to only try sending telemetry if the auth token is available?

For me it seems like this was executed while configuration phase. Because the error message was always very early in the logs, right after the Android variants got configured.

@LionZXY Maybe you have autoUploadProguardMapping enabled locally? We currently configured it like this autoUploadProguardMapping.set(isCI).

@markushi markushi self-assigned this Apr 30, 2024
@markushi
Copy link
Member

markushi commented Apr 30, 2024

Thanks for all the details, I can finally reproduce the issue. It looks like a recent sentry-cli version bump is the underlying issue, causing requests to be made when they shouldn't. the --no-upload flag to be ignored.

We're on it!

@markushi
Copy link
Member

markushi commented May 1, 2024

Quick update: We shipped a bugfix with our 4.5.1 release. Please give it a try and let us know if the issue is resolved for you as well.

@markushi
Copy link
Member

markushi commented May 8, 2024

Re-opening this issue as we see error logs in the gradle build which are causing some confusion (Note: the build still succeeds).

@markushi markushi reopened this May 8, 2024
@tjohnn
Copy link

tjohnn commented May 8, 2024

@markushi I was also getting the same issue on 4.5.1 but it got resolved by disabling telemetry.

@bfricka
Copy link

bfricka commented May 8, 2024

@markushi I was also getting the same issue on 4.5.1 but it got resolved by disabling telemetry.

Same.

@sebokopter
Copy link

Same here with 4.5.1. According to the Gradle debug logs calling sentry-cli info already warns about the missing auth token:

2024-05-13T18:46:07.022+0200 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/Users/dev/android/app/build/tmp/sentry-cli-2.31.1.exe''. Working directory: /Users/dev/android Command: /Users/dev/android/app/build/tmp/sentry-cli-2.31.1.exe --log-level=error info
2024-05-13T18:46:07.022+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
2024-05-13T18:46:07.022+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command '/Users/dev/android/app/build/tmp/sentry-cli-2.31.1.exe'.
2024-05-13T18:46:07.025+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
2024-05-13T18:46:07.026+0200 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
2024-05-13T18:46:07.026+0200 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command '/Users/dev/android/app/build/tmp/sentry-cli-2.31.1.exe''
2024-05-13T18:46:07.038+0200 [ERROR] [system.err] error: Auth token is required for this request. Please run `sentry-cli login` and try again!
2024-05-13T18:46:07.038+0200 [ERROR] [system.err]
2024-05-13T18:46:07.038+0200 [ERROR] [system.err] Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
2024-05-13T18:46:07.038+0200 [ERROR] [system.err] Please attach the full debug log to all bug reports.
2024-05-13T18:46:07.038+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
2024-05-13T18:46:07.038+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command '/Users/dev/android/app/build/tmp/sentry-cli-2.31.1.exe'' finished with exit value 1 (state: FAILED)

@romtsn
Copy link
Member

romtsn commented May 16, 2024

I believe this should be tackled by #708 now

@romtsn
Copy link
Member

romtsn commented May 16, 2024

hey everyone here, the issue has been addressed in the version 4.6.0, which just has been published. Please give it a try and let us know. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Platform: Android
Projects
Archived in project
Archived in project
Archived in project
7 participants