getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.57k stars 333 forks source link

[ci/cd Android generate release aPK] Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_15'. 731> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 236 #1401

Closed ghadeeraqraa1992 closed 2 years ago

ghadeeraqraa1992 commented 3 years ago

Environment

sentry.io

Which SDK and version? @sentry/react-native": "^2.2.1 "react-native": "0.63.4"

Steps to Reproduce

  1. run ci/cd

Expected Result

no issues with sentry

Actual Result

Task :app:bundleReleaseJsAndAssets_SentryUpload_15 FAILED 726error: sentry-cli was not installed by @sentry/cli install script 727> Task :app:bundleReleaseJsAndAssets_SentryUploadCleanUp SKIPPED 728FAILURE: Build failed with an exception. 729* What went wrong: 730Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_15'. 731> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 236

lorenzoangelini commented 3 years ago

i have the same error with react native 0.64

jennmueng commented 3 years ago

Investigating.

ghadeeraqraa1992 commented 3 years ago

any update on this?

nkpatnis commented 3 years ago

not able to build, debug working but staging/release not.

> Task :app:bundleReleaseStagingJsAndAssets_SentryUpload_20108 FAILED
error: sentry-cli was not installed by @sentry/cli install script

> Task :app:bundleReleaseStagingJsAndAssets_SentryUploadCleanUp SKIPPED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseStagingJsAndAssets_SentryUpload_20108'.
> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 236
jennmueng commented 3 years ago

I cannot reproduce this, I will bring up this issue with the team working on the cli

lorenzoangelini commented 3 years ago

@jennmueng any news? we cannot use the last react native's version with this issue

ghadeeraqraa1992 commented 3 years ago

any update on this ?

FaggioniHQ commented 3 years ago

Any update?... Or at least a workaround?... Thanks in advance.

Im getting this error

* Where: Script '....\node_modules\@sentry\react-native\sentry.gradle' line: 72

* What went wrong: Cannot add task 'bundleReleaseJsAndAssets_SentryUpload_292' as a task with that name already exists.

jennmueng commented 3 years ago

Any update?... Or at least a workaround?... Thanks in advance.

Im getting this error

* Where: Script '....\node_modules\@sentry\react-native\sentry.gradle' line: 72

* What went wrong: Cannot add task 'bundleReleaseJsAndAssets_SentryUpload_292' as a task with that name already exists.

This error looks unrelated to the issue at hand, which is regarding the Sentry CLI, this seems to be related to the task names? https://github.com/getsentry/sentry-react-native/issues/1390#issuecomment-818926761

jennmueng commented 3 years ago

For the issue at hand, can everyone try installing sentry cli as a direct dependency?

npm install -s @sentry/cli
yarn add @sentry/cli

And let me know if this solves the issue?

JustinRohweller commented 3 years ago

I get nearly the same error with @sentry/cli installed

JustinRohweller commented 3 years ago

`error: sentry-cli was not installed by @sentry/cli install script

FAILURE: Build failed with an exception.

JustinRohweller commented 3 years ago

Hey guys, for anyone still trying to solve it, having @sentry/cli may or may not have helped but I had that and I deleted android/build folder and android/app/build folder as per this comment: https://github.com/getsentry/sentry-react-native/issues/671#issuecomment-536959427 and was able to create a build.

FaggioniHQ commented 3 years ago

I got the issue when trying to upgrade react-native to the latest version. I solved the issue by changing accordingly the variant code generation part.

applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
               // used on RN 0.61
                output.versionCodeOverride = (versionCodes.get(abi) * 1048576) + defaultConfig.versionCode
               // suggested by RN 0.64
                //defaultConfig.versionCode * 1000 + versionCodes.get(abi)
            }
        }
}

Hope it helps

ShivamJoker commented 3 years ago

@jennmueng even after installing cli directly still it's not working. Already tried deleting build folders Can anyone tell me any temporary fix for this ?

ShivamJoker commented 3 years ago

Getting project not found

DEBUG   2021-05-08 14:35:58.465168 +05:30 Non-file bundle found
  DEBUG   2021-05-08 14:35:58.961900 +05:30 request POST https://sentry.io/api/0/projects/creativeje/creativeje/releases/
  DEBUG   2021-05-08 14:35:58.961935 +05:30 using token authentication
  DEBUG   2021-05-08 14:35:58.961955 +05:30 json body: {"version":"com.sql_playground@2.5.2+22","projects":["creativeje"]}
  DEBUG   2021-05-08 14:35:58.961969 +05:30 retry number 0, max retries: 0
  DEBUG   2021-05-08 14:36:00.299207 +05:30 > POST /api/0/projects/creativeje/creativeje/releases/ HTTP/1.1
  DEBUG   2021-05-08 14:36:00.299242 +05:30 > Host: sentry.io
  DEBUG   2021-05-08 14:36:00.299253 +05:30 > Accept: */*
  DEBUG   2021-05-08 14:36:00.299263 +05:30 > Connection: TE
  DEBUG   2021-05-08 14:36:00.299272 +05:30 > TE: gzip
  DEBUG   2021-05-08 14:36:00.299280 +05:30 > User-Agent: sentry-cli/1.64.1
  DEBUG   2021-05-08 14:36:00.299928 +05:30 > Authorization: Bearer be710333***
  DEBUG   2021-05-08 14:36:00.299943 +05:30 > Content-Type: application/json
  DEBUG   2021-05-08 14:36:00.299953 +05:30 > Content-Length: 67
  DEBUG   2021-05-08 14:36:01.014956 +05:30 < HTTP/1.1 302 Found
  DEBUG   2021-05-08 14:36:01.014979 +05:30 < Server: nginx
  DEBUG   2021-05-08 14:36:01.014988 +05:30 < Date: Sat, 08 May 2021 09:06:01 GMT
  DEBUG   2021-05-08 14:36:01.015001 +05:30 < Content-Type: application/json
  DEBUG   2021-05-08 14:36:01.015020 +05:30 < Content-Length: 172
  DEBUG   2021-05-08 14:36:01.015027 +05:30 < Connection: keep-alive
  DEBUG   2021-05-08 14:36:01.015033 +05:30 < location: /api/0/projects/creativeje/sql-play/releases/
  DEBUG   2021-05-08 14:36:01.015039 +05:30 < allow: GET, POST, HEAD, OPTIONS
  DEBUG   2021-05-08 14:36:01.015045 +05:30 < access-control-allow-methods: GET, POST, HEAD, OPTIONS
  DEBUG   2021-05-08 14:36:01.015058 +05:30 < access-control-allow-headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding
  DEBUG   2021-05-08 14:36:01.015064 +05:30 < access-control-expose-headers: X-Sentry-Error, Retry-After
  DEBUG   2021-05-08 14:36:01.015070 +05:30 < access-control-allow-origin: *
  DEBUG   2021-05-08 14:36:01.015075 +05:30 < vary: Accept-Language, Cookie
  DEBUG   2021-05-08 14:36:01.015081 +05:30 < content-language: en
  DEBUG   2021-05-08 14:36:01.015086 +05:30 < x-frame-options: deny
  DEBUG   2021-05-08 14:36:01.015091 +05:30 < x-content-type-options: nosniff
  DEBUG   2021-05-08 14:36:01.015099 +05:30 < x-xss-protection: 1; mode=block
  DEBUG   2021-05-08 14:36:01.015105 +05:30 < x-envoy-attempt-count: 1
  DEBUG   2021-05-08 14:36:01.015110 +05:30 < x-envoy-upstream-service-time: 39
  DEBUG   2021-05-08 14:36:01.015115 +05:30 < x-served-by: getsentry-web-default-production-74cb55cf5d-gg6vj
  DEBUG   2021-05-08 14:36:01.015121 +05:30 < x-served-by: lb-48
  DEBUG   2021-05-08 14:36:01.015126 +05:30 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  DEBUG   2021-05-08 14:36:01.015173 +05:30 response status: 302
  DEBUG   2021-05-08 14:36:01.015195 +05:30 body: {"slug":"sql-play","detail":{"code":"resource-moved","message":"Resource has been moved","extra":{"url":"/api/0/projects/creativeje/sql-play/releases/","slug":"sql-play"}}}
error: project not found
  DEBUG   2021-05-08 14:36:01.016444 +05:30 client close; no transport to shut down  (from sentry)
  DEBUG   2021-05-08 14:36:01.016465 +05:30 skipping update nagger because session is not attended

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_22'.
> Process 'command '/Users/shivam/Documents/ReactNative/SQL-Playground/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
ShivamJoker commented 3 years ago

Okay so the issue was with - in my project name I removed it and linked again now it seems to work

KingAmo commented 3 years ago

any help please? image project not found

"***/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

ghadeeraqraa1992 commented 3 years ago

any update on this ?

KingAmo commented 3 years ago

run

npx @sentry/wizard -i reactNative -p ios android

solved my problem

ghadeeraqraa1992 commented 3 years ago

run

npx @sentry/wizard -i reactNative -p ios android

solved my problem

could you please explain more where you run it ? should I add it to yml file ?

KingAmo commented 3 years ago

run it in your terminal

ghadeeraqraa1992 commented 3 years ago

it is working with me after adding

freemile2ru commented 3 years ago

I have tried everything listed here and its still not working. RN 0.60

chaimPaneth commented 3 years ago

Hi @KingAmo

I got the project not found error, in my case the issue was that we host sentry on our own servers and the @sentry/wizard command exported our domain without the s for secure protocol http to the sentry.properties file for defaults.url=http://... parameter and that caused the cli to not find our project as the cli query to get info about the project got denied by our servers. Once I changed the domain to https it worked.

So in my case changing in sentry.properties:

Did the trick.

marandaneto commented 2 years ago

@jennmueng do you know if we should do something about it?

github-actions[bot] commented 2 years ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

marandaneto commented 2 years ago

Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated. There's a large chance that this issue has been solved since. Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it. Cheers!

yorickshan commented 1 month ago

For the issue at hand, can everyone try installing sentry cli as a direct dependency?

npm install -s @sentry/cli yarn add @sentry/cli And let me know if this solves the issue?

thx, this works for me.

SKempin commented 3 days ago

Was getting this error with EAS builds on Android (iOS was fine). Needed to add the sentry auth token as an EAS secret. That fixed it for me.