expo / expo-cli

Tools for creating, running, and deploying universal Expo and React Native apps
https://docs.expo.io/workflow/expo-cli/
2.61k stars 478 forks source link

FetchError: request to https://api.expo.dev/v2/versions/latest failed, reason: Socket connection timeout #4707

Closed Q8root closed 1 year ago

Q8root commented 1 year ago

Summary

When i start expo-cli using the following command:- npx expo start I got the following result:-

Starting project at /Users/q8root/Documents/AwesomeProject
Unable to reach Expo servers. Falling back to using the cached dependency map (bundledNativeModules.json) from the package "expo" installed in your project.
FetchError: request to https://api.expo.dev/v2/versions/latest failed, reason: Socket connection timeout
FetchError: request to https://api.expo.dev/v2/versions/latest failed, reason: Socket connection timeout
    at ClientRequest.<anonymous> (/Users/q8root/Documents/AwesomeProject/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:511:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:511:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

The communication to the url seems working fine q8root@Ahmads-Air ~ % curl --verbose -I https://api.expo.dev/v2/versions/latest

Trying 104.18.4.104:443...
Connected to api.expo.dev (104.18.4.104) port 443 (#0)
ALPN: offers h2
ALPN: offers http/1.1
CAfile: /etc/ssl/cert.pem
CApath: none
(304) (OUT), TLS handshake, Client hello (1):
(304) (IN), TLS handshake, Server hello (2):
(304) (IN), TLS handshake, Unknown (8):
(304) (IN), TLS handshake, Certificate (11):
(304) (IN), TLS handshake, CERT verify (15):
(304) (IN), TLS handshake, Finished (20):
(304) (OUT), TLS handshake, Finished (20):
SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
ALPN: server accepted h2
Server certificate:
subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
start date: Oct 16 00:00:00 2022 GMT
expire date: Oct 16 23:59:59 2023 GMT
subjectAltName: host "api.expo.dev" matched cert's "*.expo.dev"
issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
SSL certificate verify ok.
Using HTTP2, server supports multiplexing
Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
h2h3 [:method: HEAD]
h2h3 [:path: /v2/versions/latest]
h2h3 [:scheme: https]
h2h3 [:authority: api.expo.dev]
h2h3 [user-agent: curl/7.86.0]
h2h3 [accept: /]
Using Stream ID: 1 (easy handle 0x153810a00)
HEAD /v2/versions/latest HTTP/2
Host: api.expo.dev
user-agent: curl/7.86.0
accept: /

Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 200
HTTP/2 200
< date: Tue, 16 May 2023 18:46:07 GMT
date: Tue, 16 May 2023 18:46:07 GMT
< content-type: application/json; charset=utf-8
content-type: application/json; charset=utf-8
< content-length: 27419
content-length: 27419
< vary: Accept-Encoding, Origin
vary: Accept-Encoding, Origin
< x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
< x-content-type-options: nosniff
x-content-type-options: nosniff
< etag: "6b1b-Y3src2lSujzqPAtYDQ5ubLW8WZo"
etag: "6b1b-Y3src2lSujzqPAtYDQ5ubLW8WZo"
< via: 1.1 google
via: 1.1 google
< strict-transport-security: max-age=31536000; includeSubDomains
strict-transport-security: max-age=31536000; includeSubDomains
< alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
< cf-cache-status: DYNAMIC
cf-cache-status: DYNAMIC
< server: cloudflare
server: cloudflare
< cf-ray: 7c85c818abed746c-LHR
cf-ray: 7c85c818abed746c-LHR
<

Connection #0 to host api.expo.dev left intact

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 13.2.1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 20.0.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - ~/Documents/AwesomeProject/node_modules/.bin/yarn npm: 9.6.4 - /opt/homebrew/bin/npm Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 14.3/14E222b - /usr/bin/xcodebuild npmPackages: expo: ~48.0.15 => 48.0.16 react: 18.2.0 => 18.2.0 react-native: 0.71.7 => 0.71.7 npmGlobalPackages: expo-cli: 6.3.7 Expo Workflow: bare

Please specify your device/emulator/simulator platform, model and version

MacOS

Error output

q8root@Ahmads-Air AwesomeProject % EXPO_DEBUG=true npx expo start
Starting project at /Users/q8root/Documents/AwesomeProject
  expo:utils:fileNotifier Observing /Users/q8root/Documents/AwesomeProject/babel.config.js +0ms
  expo:doctor:typescriptSupport Ensuring TypeScript support is setup +0ms
  expo:doctor:dependencies:bundledNativeModules Fetching bundled native modules from the server... +0ms
  expo:doctor:dependencies:validate Checking dependencies for 48.0.0: {
  expo:doctor:dependencies:validate   '@react-navigation/drawer': '^6.3.0',
  expo:doctor:dependencies:validate   '@react-navigation/native': '^6.0.13',
  expo:doctor:dependencies:validate   '@react-navigation/native-stack': '^6.9.1',
  expo:doctor:dependencies:validate   add: '^2.0.6',
  expo:doctor:dependencies:validate   axios: '^1.4.0',
  expo:doctor:dependencies:validate   expo: '~48.0.15',
  expo:doctor:dependencies:validate   'expo-env-info': '^1.0.5',
  expo:doctor:dependencies:validate   'expo-image-picker': '^14.1.1',
  expo:doctor:dependencies:validate   'expo-secure-store': '^12.1.1',
  expo:doctor:dependencies:validate   'expo-splash-screen': '~0.18.2',
  expo:doctor:dependencies:validate   'expo-status-bar': '~1.4.4',
  expo:doctor:dependencies:validate   'expo-updates': '~0.16.4',
  expo:doctor:dependencies:validate   react: '18.2.0',
  expo:doctor:dependencies:validate   'react-content-loader': '^6.2.1',
  expo:doctor:dependencies:validate   'react-hook-form': '^7.43.9',
  expo:doctor:dependencies:validate   'react-native': '0.71.7',
  expo:doctor:dependencies:validate   'react-native-document-scanner-plugin': '^0.7.3',
  expo:doctor:dependencies:validate   'react-native-gesture-handler': '^2.9.0',
  expo:doctor:dependencies:validate   'react-native-google-places-autocomplete': '^2.5.1',
  expo:doctor:dependencies:validate   'react-native-loading-spinner-overlay': '^3.0.1',
  expo:doctor:dependencies:validate   'react-native-maps': '1.3.2',
  expo:doctor:dependencies:validate   'react-native-permissions': '^3.8.0',
  expo:doctor:dependencies:validate   'react-native-radio-buttons-group': '^3.0.0',
  expo:doctor:dependencies:validate   'react-native-reanimated': '~2.14.4',
  expo:doctor:dependencies:validate   'react-native-rtl-layout': '^0.0.1',
  expo:doctor:dependencies:validate   'react-native-safe-area-context': '4.5.0',
  expo:doctor:dependencies:validate   'react-native-screens': '~3.20.0',
  expo:doctor:dependencies:validate   'react-native-select-dropdown': '^3.3.3',
  expo:doctor:dependencies:validate   'react-native-svg': '13.4.0',
  expo:doctor:dependencies:validate   yarn: '^1.22.19',
  expo:doctor:dependencies:validate   '@babel/core': '^7.20.0'
  expo:doctor:dependencies:validate } +0ms
  expo:doctor:dependencies:validate Comparing known versions: [
  expo:doctor:dependencies:validate   'expo-image-picker',
  expo:doctor:dependencies:validate   'expo-secure-store',
  expo:doctor:dependencies:validate   'expo-splash-screen',
  expo:doctor:dependencies:validate   'expo-status-bar',
  expo:doctor:dependencies:validate   'expo-updates',
  expo:doctor:dependencies:validate   'react',
  expo:doctor:dependencies:validate   'react-native',
  expo:doctor:dependencies:validate   'react-native-gesture-handler',
  expo:doctor:dependencies:validate   'react-native-maps',
  expo:doctor:dependencies:validate   'react-native-reanimated',
  expo:doctor:dependencies:validate   'react-native-safe-area-context',
  expo:doctor:dependencies:validate   'react-native-screens',
  expo:doctor:dependencies:validate   'react-native-svg',
  expo:doctor:dependencies:validate   '@babel/core'
  expo:doctor:dependencies:validate ] +1ms
  expo:doctor:dependencies:validate Skipping packages that cannot be versioned automatically: [
  expo:doctor:dependencies:validate   '@react-navigation/drawer',
  expo:doctor:dependencies:validate   '@react-navigation/native',
  expo:doctor:dependencies:validate   '@react-navigation/native-stack',
  expo:doctor:dependencies:validate   'add',
  expo:doctor:dependencies:validate   'axios',
  expo:doctor:dependencies:validate   'expo',
  expo:doctor:dependencies:validate   'expo-env-info',
  expo:doctor:dependencies:validate   'react-content-loader',
  expo:doctor:dependencies:validate   'react-hook-form',
  expo:doctor:dependencies:validate   'react-native-document-scanner-plugin',
  expo:doctor:dependencies:validate   'react-native-google-places-autocomplete',
  expo:doctor:dependencies:validate   'react-native-loading-spinner-overlay',
  expo:doctor:dependencies:validate   'react-native-permissions',
  expo:doctor:dependencies:validate   'react-native-radio-buttons-group',
  expo:doctor:dependencies:validate   'react-native-rtl-layout',
  expo:doctor:dependencies:validate   'react-native-select-dropdown',
  expo:doctor:dependencies:validate   'yarn'
  expo:doctor:dependencies:validate ] +1ms
  expo:doctor:dependencies:validate Package versions: {
  expo:doctor:dependencies:validate   'expo-image-picker': '14.1.1',
  expo:doctor:dependencies:validate   'expo-secure-store': '12.1.1',
  expo:doctor:dependencies:validate   'expo-splash-screen': '0.18.2',
  expo:doctor:dependencies:validate   'expo-status-bar': '1.4.4',
  expo:doctor:dependencies:validate   'expo-updates': '0.16.4',
  expo:doctor:dependencies:validate   react: '18.2.0',
  expo:doctor:dependencies:validate   'react-native': '0.71.7',
  expo:doctor:dependencies:validate   'react-native-gesture-handler': '2.9.0',
  expo:doctor:dependencies:validate   'react-native-maps': '1.3.2',
  expo:doctor:dependencies:validate   'react-native-reanimated': '2.14.4',
  expo:doctor:dependencies:validate   'react-native-safe-area-context': '4.5.0',
  expo:doctor:dependencies:validate   'react-native-screens': '3.20.0',
  expo:doctor:dependencies:validate   'react-native-svg': '13.4.0',
  expo:doctor:dependencies:validate   '@babel/core': '7.21.8'
  expo:doctor:dependencies:validate } +2ms
  expo:doctor:dependencies:validate Incorrect dependencies: [
  expo:doctor:dependencies:validate   {
  expo:doctor:dependencies:validate     packageName: 'react-native',
  expo:doctor:dependencies:validate     packageType: 'dependencies',
  expo:doctor:dependencies:validate     expectedVersionOrRange: '0.71.8',
  expo:doctor:dependencies:validate     actualVersion: '0.71.7'
  expo:doctor:dependencies:validate   }
  expo:doctor:dependencies:validate ] +2ms
Some dependencies are incompatible with the installed expo version:
  react-native@0.71.7 - expected version: 0.71.8
Your project may not work correctly until you install the correct versions of the packages.
Install individual packages by running npx expo install react-native@0.71.8
  expo:start:server:devServer Stopping dev server (bundler: metro) +0ms
  expo:start:server:devServer Stopped dev server (bundler: metro) +0ms

Expo Metro config:
- Version: 0.7.1
- Extensions: ts, tsx, js, jsx, json
- React Native: /Users/q8root/Documents/AwesomeProject/node_modules/react-native
- Babel config: /Users/q8root/Documents/AwesomeProject/babel.config.js
- Resolver Fields: react-native, browser, main
- Watch Folders: 
- Node Module Paths: 
- Exotic: false

Expo Metro config:
- Version: 0.7.1
- Extensions: ts, tsx, js, jsx, json
- React Native: /Users/q8root/Documents/AwesomeProject/node_modules/react-native
- Babel config: /Users/q8root/Documents/AwesomeProject/babel.config.js
- Resolver Fields: react-native, browser, main
- Watch Folders: 
- Node Module Paths: 
- Exotic: false

  expo:start:server:metro:router routerEntry /Users/q8root/Documents/AwesomeProject/node_modules/expo-router/entry /Users/q8root/Documents/AwesomeProject/app ../../app +0ms
Starting Metro Bundler
  expo:start:server:urlCreator URL: exp://192.168.1.172:19000 +0ms
  expo:start:server:developmentSession Development session will not ping because the user is not authenticated and there are no devices. +0ms
  expo:utils:fileNotifier Observing /Users/q8root/Documents/AwesomeProject/metro.config.js +7s
  expo:start:server:urlCreator URL: exp://192.168.1.172:19000 +3s
  expo:start:server:devServer Redirect page is disabled +4s
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █   █▄▄█▄▀█ ▄▄▄▄▄ █
█ █   █ █ ▀▄ █▀▄ ▄█ █   █ █
█ █▄▄▄█ █▀██▀▀▄▀▄██ █▄▄▄█ █
█▄▄▄▄▄▄▄█▄▀▄█ █▄█▄█▄▄▄▄▄▄▄█
█▄ ██▄▄▄█▀▀▀▄▀█▄ ███ ▀▄▄ ▄█
█ ▀▄█▄█▄▀ █▀ ▄▄█ ▀▀ █▄  ▀██
█  ▀█▀ ▄██▀▄█▄▀▄▀▄▀▄▀▀▄ ▀██
███▄▄██▄▀██▀█▀█▀▄▄▄█▄▀ ▀███
█▄▄▄█▄█▄█  ▀▄ █▄▄ ▄▄▄ ▀ ▄▄█
█ ▄▄▄▄▄ █▀ █ ██▀▀ █▄█ ▀▀███
█ █   █ █▄ ▄▀▀▀▄█▄▄ ▄▄▀ ▀▀█
█ █▄▄▄█ █▀ ▄ ███▄██▄▀█▀▀ ██
█▄▄▄▄▄▄▄█▄▄████▄████▄▄▄▄▄▄█

› Metro waiting on exp://192.168.1.172:19000
› Scan the QR code above with Expo Go (Android) or the Camera app
(iOS)

› Press a │ open Android
› Press i │ open iOS simulator
› Press w │ open web

› Press j │ open debugger
› Press r │ reload app
› Press m │ toggle menu

› Press ? │ show all commands

Logs for your project will appear below. Press Ctrl+C to exit.
  expo:start:server:middleware:manifest Resolved entry point: index.js (project root: /Users/q8root/Documents/AwesomeProject) +0ms
  expo:start:server:urlCreator URL: 192.168.1.172:19000 +10s
  expo:start:server:urlCreator URL: http://192.168.1.172:19000 +0ms
  expo:start:server:urlCreator URL: 192.168.1.172:19000 +0ms
  expo:start:server:urlCreator URL: http://192.168.1.172:19000 +0ms
  expo:start:server:middleware:ClassicManifestMiddleware Error getting manifest: [CombinedError: [Network] request to https://api.expo.dev/graphql failed, reason: Socket connection timeout] {
  graphQLErrors: [],
  networkError: FetchError: request to https://api.expo.dev/graphql failed, reason: Socket connection timeout
      at ClientRequest.<anonymous> (/Users/q8root/Documents/AwesomeProject/node_modules/node-fetch/lib/index.js:1505:11)
      at ClientRequest.emit (node:events:511:28)
      at TLSSocket.socketErrorListener (node:_http_client:495:9)
      at TLSSocket.emit (node:events:511:28)
      at emitErrorNT (node:internal/streams/destroy:151:8)
      at emitErrorCloseNT (node:internal/streams/destroy:116:3)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    type: 'system',
    errno: 'ERR_SOCKET_CONNECTION_TIMEOUT',
    code: 'ERR_SOCKET_CONNECTION_TIMEOUT'
  },
  response: undefined
} +0ms
[Network] request to https://api.expo.dev/graphql failed, reason: Socket connection timeout
undefined

Reproducible demo or steps to reproduce from a blank project

NA

brentvatne commented 1 year ago

which country are you accessing the internet from?

Q8root commented 1 year ago

which country are you accessing the internet from?

From Kuwait, i also tried different locations using Express vpn giving the same error

brentvatne commented 1 year ago

we have seen this issue from kuwait before. unfortunately there isn't anything that we can do about that given that it's related to the country firewall. i'm not familiar with express vpn, presumably that should work, but if not you may need to try another vpn provider.

brentvatne commented 1 year ago

alternatively, you can always run in offline mode. npx expo start --offline