getsentry / sentry-react-native

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

unable to upload source maps because cannot resolve host name #829

Closed kurtgn closed 3 years ago

kurtgn commented 4 years ago

OS:

Platform:

SDK:

SDK version: 1.3.3 react-native version: 0.61.5

Are you using Expo?

Are you using sentry.io or on-premise?


I have following issue:

While trying to assemble release using ./gradlew assembleRelease, the build fails with the following error:


Loading dependency graph, done.
info Writing bundle output to:, /Users/1111/_projects/_pycpa/expo/noexpo/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /Users/1111/_projects/_pycpa/expo/noexpo/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 265 asset files
info Done copying assets

> Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED
  DEBUG   2020-04-25 15:26:39.126037 +03:00 sentry-cli version: 1.52.0, platform: "darwin", architecture: "x86_64"
  INFO    2020-04-25 15:26:39.127334 +03:00 sentry-cli was invoked with the following command line: "/Users/1111/_projects/_pycpa/expo/noexpo/node_modules/@sentry/cli/sentry-cli" "react-native" "gradle" "--bundle" "/Users/1111/_projects/_pycpa/expo/noexpo/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/1111/_projects/_pycpa/expo/noexpo/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map" "--release" "com.investadvisor@14+1048590" "--dist" "1048590" "--dist" "3145742"
  INFO    2020-04-25 15:26:39.131646 +03:00 Issuing a command for Organization: sourcery-zv Project: questions-app
  INFO    2020-04-25 15:26:39.131770 +03:00   bundle path: /Users/1111/_projects/_pycpa/expo/noexpo/android/app/build/generated/assets/react/release/index.android.bundle
Processing react-native sourcemaps for Sentry upload.
  INFO    2020-04-25 15:26:39.131852 +03:00   sourcemap path: /Users/1111/_projects/_pycpa/expo/noexpo/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
  DEBUG   2020-04-25 15:26:39.132717 +03:00 Non-file bundle found
> Analyzing 2 sources
> Rewriting sources
> Adding source map references
  DEBUG   2020-04-25 15:26:39.713462 +03:00 request POST https://sentry.io/api/0/projects/sourcery-zv/questions-app/releases/
  DEBUG   2020-04-25 15:26:39.713605 +03:00 using token authentication
  DEBUG   2020-04-25 15:26:39.713671 +03:00 json body: {"version":"com.investadvisor@14+1048590","projects":["questions-app"]}
  DEBUG   2020-04-25 15:26:39.714249 +03:00 retry number 0, max retries: 0
  DEBUG   2020-04-25 15:26:39.718050 +03:00 error: running update nagger
  DEBUG   2020-04-25 15:26:39.718194 +03:00 skipping update nagger because session is not attended
error: API request failed
  caused by: [6] Couldn't resolve host name
  DEBUG   2020-04-25 15:26:39.718715 +03:00 client close; no transport to shut down  (from sentry)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
> Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

I've been using Sentry for a while, everything worked fine, until today. The code for the app has not been changed, I just decided to rebuild it today.

The website https://sentry.io is available from my computer. So why does it say it is not?

sRahiimii commented 4 years ago

I have the same issue for long time.

snakenstein commented 4 years ago

Yes, the same annoying problem. We integrated sentry cli release commands (create release, upload sources etc.) in our deploy script on CD. And it started to fail very often few days ago because of '[6] Couldn't resolve host name' problem in sentry cli.

rastogiachyut commented 4 years ago

Any solutions to this issue?

marandaneto commented 4 years ago

@kamilogorek ideas about what could cause this? it seems to be a sentry-cli issue.

marandaneto commented 4 years ago

hey you all, did you use sentry-wizard to link the SDK into your projects? see: https://docs.sentry.io/platforms/react-native/#linking

this looks like a misconfiguration, See a similar issue: getsentry/sentry-webpack-plugin/issues/193

could you double-check your config files as stated in the issue above? thanks.

GregVes commented 4 years ago

Yes, the same annoying problem. We integrated sentry cli release commands (create release, upload sources etc.) in our deploy script on CD. And it started to fail very often few days ago because of '[6] Couldn't resolve host name' problem in sentry cli.

I faced the same issue for a React app and it turned out that it was due to the node slim docker image I used that was not shipped with "curl" anymore.

More info: https://github.com/nodejs/docker-node/issues/1185

snakenstein commented 4 years ago

The issue is still there. And I want to highlight that it is a sporadic problem. Most of the time everything works fine. But sometime in the same environment without any changes cli command fails with 'Couldn't resolve host name' message. And often it is not a first command in a script. I mean that, for example, sentry-cli releases newsucceeds but immediately called sentry-cli set-commitscommand fails. Hope this helps

bradherman commented 3 years ago

Also experiencing this issue now out of nowhere when trying to build my app:

using:

OS: MacOS

Platform: Android

SDK: @sentry/react-native

SDK version: 1.3.3 react-native version: 0.63.3

Are you using Expo? Yes (bare workflow)

Are you using sentry.io or on-premise? sentry.io (SaaS)

bradherman commented 3 years ago

Followup: After updating Android studio to the newest beta, cleaning the project, and rebuilding it finally worked.

ghasemikasra39 commented 3 years ago

I experienced this today for the first time:

OS:
MacOS

Platform:
IOS

SDK:
@sentry/react-native

SDK version: 2.1.0
react-native version: 0.63.3

Are you using Expo?
No

Are you using sentry.io or on-premise?
sentry.io (SaaS) 
AlexAtkinson commented 3 years ago

Same issue. Please fix this.

OS: MacOS 11.2 Platform: Android @sentry/react-native: 2.2.1 react-native: 0.61.4 expo: false sentry host: sentry.io dig & curl resolve sentry.io

During build my open connections don't exceed ~350. $ export SENTRY_LOG_LEVEL=debug

Task :app:bundleReleaseJsAndAssets_SentryUpload_1 DEBUG 2021-03-16 14:01:03.080549 -04:00 sentry-cli version: 1.63.1, platform: "darwin", architecture: "x86_64" INFO 2021-03-16 14:01:03.080857 -04:00 sentry-cli was invoked with the following command line: "/Users/foo/Documents/git/bar/node_modules/@sentry/cli/sentry-cli" "react-native" "gradle" "--bundle" "/Users/foo/Documents/git/bar/android/app/build/generated/assets/react/release/index.android.bundle" "--sourcemap" "/Users/foo/Documents/git/bar/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map" "--release" "com.foobar@x.x.x+1" "--dist" "1" INFO 2021-03-16 14:01:03.081625 -04:00 Issuing a command for Organization: foo Project: foo Processing react-native sourcemaps for Sentry upload. INFO 2021-03-16 14:01:03.081658 -04:00 bundle path: /Users/foo/Documents/git/bar/android/app/build/generated/assets/react/release/index.android.bundle INFO 2021-03-16 14:01:03.081676 -04:00 sourcemap path: /Users/foo/Documents/git/bar/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map DEBUG 2021-03-16 14:01:03.244473 -04:00 Non-file bundle found Analyzing 2 sources Rewriting sources Adding source map references DEBUG 2021-03-16 14:01:05.195727 -04:00 request POST https://sentry.io/api/0/projects/foo/foo/releases/ DEBUG 2021-03-16 14:01:05.195786 -04:00 using token authentication DEBUG 2021-03-16 14:01:05.195801 -04:00 json body: {"version":"com.foo@x.x.x+1","projects":["foo"]} DEBUG 2021-03-16 14:01:05.195814 -04:00 retry number 0, max retries: 0 error: API request failed caused by: [6] Couldn't resolve host name (Could not resolve host: sentry.io) DEBUG 2021-03-16 14:01:05.200079 -04:00 client close; no transport to shut down (from sentry) DEBUG 2021-03-16 14:01:05.200116 -04:00 skipping update nagger because session is not attended

Task :app:bundleReleaseJsAndAssets_SentryUpload_1 FAILED Task :app:bundleReleaseJsAndAssets_SentryUploadCleanUp SKIPPED ReactNativeFirebase WARNING: NPM package '@react-native-firebase/remote-config' depends on '@react-native-firebase/app' v8.4.0 but found v8.4.7, this might cause build issues or runtime crashes. ReactNativeFirebase WARNING: NPM package '@react-native-firebase/crashlytics' depends on '@react-native-firebase/app' v10.8.1 but found v8.4.7, this might cause build issues or runtime crashes. ReactNativeFirebase WARNING: NPM package '@react-native-firebase/perf' depends on '@react-native-firebase/app' v9.0.0 but found v8.4.7, this might cause build issues or runtime crashes. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_1'. Process 'command '/Users/foo/Documents/git/bar/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

$ dig +noall +answer sentry.io

sentry.io. 1018 IN A 35.188.42.15

Adding to /etc/hosts did nothing.

$ curl -sSkIL sentry.io

HTTP/1.1 405 Not Allowed Server: nginx Date: Tue, 16 Mar 2021 17:02:52 GMT Content-Type: text/html Content-Length: 166 Connection: keep-alive

wget --server-response -O - sentry.io > /dev/null

URL transformed to HTTPS due to an HSTS policy --2021-03-16 13:07:54-- https://sentry.io/ Resolving sentry.io (sentry.io)... 35.188.42.15 Connecting to sentry.io (sentry.io)|35.188.42.15|:443... connected. HTTP request sent, awaiting response... HTTP/1.1 302 Found Server: nginx Date: Tue, 16 Mar 2021 17:07:54 GMT Content-Type: text/html; charset=utf-8 Content-Length: 0 Connection: keep-alive location: /welcome/ vary: Accept-Language, Cookie content-language: en x-frame-options: deny x-content-type-options: nosniff x-xss-protection: 1; mode=block content-security-policy: default-src ; script-src 'self' 'unsafe-eval' 'unsafe-inline' s1.sentry-cdn.com statuspage-production.s3.amazonaws.com static.zdassets.com aui-cdn.atlassian.com connect-cdn.atl-paas.net js.stripe.com ssl.google-analytics.com 'nonce-691d0ec280164ed1b1f4a9add72c1dc5' 'strict-dynamic'; font-src data:; connect-src ; frame-ancestors 'self'; object-src 'none'; base-uri 'none'; style-src 'unsafe-inline' ; img-src data: blob:; report-uri https://sentry.io/api/54785/csp-report/?sentry_key=f724a8a027db45f5b21507e7142ff78e&sentry_release=6a5d670d62a7dc42e62504406d51cd229ac64f84 x-envoy-attempt-count: 1 x-envoy-upstream-service-time: 4 x-served-by: getsentry-web-default-production-755d49bd45-7rv99 x-served-by: lb-48 Strict-Transport-Security: max-age=31536000; includeSubDomains; preload Location: /welcome/ [following] URL transformed to HTTPS due to an HSTS policy --2021-03-16 13:07:54-- https://sentry.io/welcome/ Reusing existing connection to sentry.io:443. HTTP request sent, awaiting response... HTTP/1.1 200 OK Server: nginx Date: Tue, 16 Mar 2021 17:07:55 GMT Content-Type: text/html; charset=utf-8 Content-Length: 239245 Connection: keep-alive content-security-policy-report-only: upgrade-insecure-requests; default-src 'none'; script-src 'self' 'unsafe-inline' www.sentry.dev www.googletagmanager.com www.google-analytics.com www.googleadservices.com js.hs-analytics.net js.hs-scripts.com js.driftt.com connect.facebook.net assets.calendly.com js.hsforms.net js.hs-banner.com forms.hsforms.com player.vimeo.com www.redditstatic.com m.servedby-buysellads.com static.zdassets.com googleads.g.doubleclick.net bat.bing.com munchkin.marketo.net; connect-src 'self' sentry.io .sentry.io www.sentry.dev reload.getsentry.net api.amplitude.com ekr.zdassets.com sentry.zendesk.com www.google-analytics.com stats.g.doubleclick.net 776-mjn-501.mktoresp.com; img-src 'self' www.sentry.dev sentry-blog.storage.googleapis.com images.ctfassets.net www.google-analytics.com stats.g.doubleclick.net track.hubspot.com assets.calendly.com forms.hsforms.com q.quora.com alb.reddit.com www.facebook.com www.googletagmanager.com bat.bing.com www.google.com; style-src 'self' 'unsafe-inline' www.sentry.dev assets.calendly.com fonts.googleapis.com; media-src 'self' videos.ctfassets.net; font-src 'self' www.sentry.dev fonts.gstatic.com; frame-src player.vimeo.com www.youtube-nocookie.com js.driftt.com calendly.com bid.g.doubleclick.net; manifest-src 'self' www.sentry.dev; report-uri https://o1.ingest.sentry.io/api/1297627/security/?sentry_key=e811b9077ef64dcf8a279ec18a61b222 content-disposition: inline; filename="index.html" cache-control: public, max-age=0, must-revalidate access-control-allow-origin: * etag: W/"2936b807853ed98d97d487795e8beeb5ae363253e59bf3fa7a2e5906b94018af" accept-ranges: bytes x-vercel-cache: HIT age: 8873 x-vercel-id: cle1::4ml5t-1615914475092-115e556bf572 X-Frame-Options: sameorigin X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Strict-Transport-Security: max-age=31536000; includeSubDomains; preload Length: 239245 (234K) [text/html] Saving to: ‘STDOUT’

Nothing there...

$ strings cli/sentry-cli | grep curl

/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/sentry-0.18.1/src/client.rssentry.rust/0.18.1sentry.rustcargo:sentryfailurepaniclogspawning curl transportsentrysentry::transport/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/sentry-0.18.1/src/transport.rsX-Sentry-Auth: Expect:Content-Type: application/jsonFailed to send eventSkipping event send because we're disabled due to rate limits for s([a-zA-Z]+)\d/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/sentry-0.18.1/src/utils.rsassertion failed: ptr != 0/rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sync/mpsc/shared.rsassertion failed: (left == right) /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/str/pattern.rslog/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/sentry-0.18.1/src/integrations/log.rs> < curl: sentrysentry::transport/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/sentry-0.18.1/src/transport.rsretry-after }{><* (assertion failed: !handle.is_null()/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.34/src/easy/handler.rsfailed to set error bufferfailed to set header callbackfailed to set write callbackfailed to set read callbackfailed to set seek callbackfailed to set progress callbackfailed to set debug callbackfailed to set open socket callback Authformatter errorunknown origin from libcurl: /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.34/src/easy/handler.rs/rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/ffi/c_str.rsassertion failed: !raw.is_null()/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.34/src/easy/list.rs/rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sync/once.rscalled Option::unwrap() on a None valueassertion failed: (left == right) right: `/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.34/src/lib.rs/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.34/src/easy/handle.rsassertion failed: !self.inner.get_ref().running.get()assertion failed: self.easy.inner.get_ref().borrowed.get().is_null()/rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/ffi/c_str.rscalledResult::unwrap()on anErr` valueassertion failed: !s.is_null()/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.34/src/error.rs[] ()Errordescriptionextraunknown form errorlibcurl does not have support for this option compiled inillegal array in optionform information not completeunknown optionnull pointer given for stringone option passed twiceallocation failureFormError already mutably borrowed/Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/curl-0.4.34/src/panic.rs firstvideolightworldmediawhitecloseblackrightsmallbooksplacemusicfieldorderpointvalueleveltableboardhousegroupworksyearsstatetodaywaterstartstyledeathpowerphonenighterrorinputabouttermstitletoolseventlocaltimeslargewordsgamesshortspacefocusclearmodelblockguideradiosharewomenagainmoneyimagenamesyounglineslatercolorgreenfront&watchforcepricerulesbeginaftervisitissueareasbelowindextotalhourslabelprintpressbuiltlinksspeedstudytradefoundsenseundershownformsrangeaddedstillmovedtakenaboveflashfixedoftenotherviewschecklegalriveritemsquickshapehumanexistgoingmoviethirdbasicpeacestagewidthloginideaswrotepagesusersdrivestorebreaksouthvoicesitesmonthwherebuildwhichearthforumthreesportpartyClicklowerlivesclasslayerentrystoryusagesoundcourtyour birthpopuptypesapplyImagebeinguppernoteseveryshowsmeansextramatchtrackknownearlybegansuperpapernorthlearngivennamedendedTermspartsGroupbrandusingwomanfalsereadyaudiotakeswhile.com/livedcasesdailychildgreatjudgethoseunitsneverbroadcoastcoverapplefilescyclesceneplansclickwritequeenpieceemailframeolderphotolimitcachecivilscaleenterthemetheretouchboundroyalaskedwholesincestock namefaithheartemptyofferscopeownedmightalbumthinkbloodarraymajortrustcanonunioncountvalidstoneStyleLoginhappyoccurleft:freshquitefilmsgradeneedsurbanfightbasishoverauto;route.htmlmixedfinalYour slidetopicbrownalonedrawnsplitreachRightdatesmarchquotegoodsLinksdoubtasyncthumballowchiefyouthnovel10px;serveuntilhandsCheckSpacequeryjamesequaltwice0,000Startpanelsongsroundeightshiftworthpostsleadsweeksavoidthesemilesplanesmartalphaplantmarksratesplaysclaimsalestextsstarswrongthing.org/multiheardPowerstandtokensolid(thisbringshipsstafftriedcallsfullyfactsagentThis //-->adminegyptEvent15px;Emailtrue"crossspentblogsbox">notedleavechinasizesguestrobotheavytrue,sevengrandcrimesignsawaredancephase> extract_curly_braces_content # Your alt-svc cache. https://curl.se/docs/alt-svc.html # This file was generated by libcurl! Edit at your own risk. Unrecognized content encoding type. libcurl understands %s content encodings. # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. # Fatal libcurl error A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. A libcurl function was given a bad argument An unknown option was passed in to libcurl Protocol "%s" not supported or disabled in libcurl Unsupported proxy '%s', libcurl is built without the HTTPS-proxy support. curl/lib/vtls/sectransp.c

You build on circleci. This error may be issued by libcurl. It's a rust package... Inspecting the repo, I find not find the string matching "Couldn't resolve host name"... That string is not in the cargo repo either. curl 0.4.34 is able to resolve sentry.io when I test it in a quick rust app. Same with the cargo dependency version 0.4.23.

Max FDs in use is ~3200 maxfiles was set to ~65k Max TCP connections during build is ~350

Is it an http/2 issue? It supports 1.1. $ curl -sI https://sentry.io -o/dev/null -w '%{http_version}\n'

1.1

Is it an issue with the first response being a 302? It's a mystery.

AlexAtkinson commented 3 years ago

Intermittent issues are the worst. Today I'm able to build. The next time this happens, I'll try the fix found here, in a cargo issue: https://github.com/rust-lang/cargo/issues/7515#issuecomment-762106260

jennmueng commented 3 years ago

Closing this on the basis of being more than a year old with no updates. If the issue still persists, feel free to reopen.