question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[SOLVED] MetroBundler ERROR: HTTP load failed, 0/0 bytes (error code: -1001 [1:60]) && nw_socket_handle_socket_event [C2.1:1] Socket SO_ERROR [61: Connection refused]

See original GitHub issue

I really don’t know what cause this error but it’s occurs since yesterday. And it happens suddenly. I’m opening the project, debug on real device with no problem and this errors happens suddenly, even I didn’t anything wrong.

Like I said, it’s happens when I try to debug on real device, works simulator with no problem. Main problem because of internet connection change but it happens even I still connect the same wi-fi. When this error happens Metro Bundler stops to load JS bundle.

I clean & run project on Xcode, reset internet, delete project on device … etc. not working but know what? It suddenly works!

I trying to fix it for 2 days… When this errors happens I tried to start it on fresh project, but no hope. So this error not about project.

It gives not any error on bundler or console. Only on Xcode. It gives these outputs:

2019-10-24 12:30:49.267803+0300 bshMobile[516:84562] Connection 1: received failure notification
2019-10-24 12:30:49.268025+0300 bshMobile[516:84562] Connection 1: failed to connect 1:60, reason -1
2019-10-24 12:30:49.268150+0300 bshMobile[516:84562] Connection 1: encountered error(1:60)
2019-10-24 12:30:49.272681+0300 bshMobile[516:84562] Task <AABA240F-A83D-43E4-BFF6-7294871AB3A4>.<1> HTTP load failed, 0/0 bytes (error code: -1001 [1:60])
2019-10-24 12:30:49.373 [info][tid:main][RCTRootView.m:293] Running application bshMobile ({
    initialProps =     {
    };
    rootTag = 1;
})
2019-10-24 12:30:49.433194+0300 bshMobile[516:84563] [] nw_socket_handle_socket_event [C2.1:1] Socket SO_ERROR [61: Connection refused]
2019-10-24 12:30:49.441099+0300 bshMobile[516:84563] [] nw_socket_connect [C2.2:1] connectx(6, [srcif=0, srcaddr=<NULL>, dstaddr=::1.8081], SAE_ASSOCID_ANY, 0, NULL, 0, NULL, SAE_CONNID_ANY) failed: [61: Connection refused]
2019-10-24 12:30:49.441790+0300 bshMobile[516:84563] [] nw_socket_connect [C2.2:1] connectx failed (fd 6) [61: Connection refused]
2019-10-24 12:30:49.450014+0300 bshMobile[516:84563] [] nw_socket_connect connectx failed [61: Connection refused]
2019-10-24 12:30:49.451198+0300 bshMobile[516:84562] [] nw_connection_get_connected_socket [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-10-24 12:30:49.451270+0300 bshMobile[516:84562] TCP Conn 0x2819c5ec0 Failed : error 0:61 [61]
2019-10-24 12:30:49.466269+0300 bshMobile[516:84563] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]
2019-10-24 12:30:49.472205+0300 bshMobile[516:84563] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]
2019-10-24 12:30:49.472656+0300 bshMobile[516:84567] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-10-24 12:30:49.472817+0300 bshMobile[516:84567] TCP Conn 0x2819c1140 Failed : error 0:61 [61]
2019-10-24 12:30:49.790593+0300 bshMobile[516:84561] [] nw_socket_handle_socket_event [C4.1:1] Socket SO_ERROR [61: Connection refused]
2019-10-24 12:30:49.791979+0300 bshMobile[516:84561] [] nw_socket_handle_socket_event [C4.2:1] Socket SO_ERROR [61: Connection refused]
2019-10-24 12:30:49.793566+0300 bshMobile[516:84562] [] nw_connection_get_connected_socket [C4] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-10-24 12:30:49.793644+0300 bshMobile[516:84562] TCP Conn 0x2819c8840 Failed : error 0:61 [61]
2019-10-24 12:30:49.880 [info][tid:com.facebook.react.JavaScript] Running "bshMobile" with {"rootTag":1,"initialProps":{}}

2019-10-24 12:30:50.100822+0300 bshMobile[516:84364] [framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: 'org.reactjs.native.example.bshMobile'
2019-10-24 12:30:50.100971+0300 bshMobile[516:84364] [framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: 'org.reactjs.native.example.bshMobile'

Versions

    "react": "16.9.0",
    "react-native": "0.61.2"

SOLVED

Probably it happens because of build caches. Looks like cleaning the build cache (Shift + Alt + CMD + K) and re-build the project solving the problem. I’m not sure it’s certainly the solution, but it works for me.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
RevanthMcommented, Jan 4, 2020

I have received the same error and I am also unsure why it occurs. It is handled for me and results in a “the request timed out” error.

0reactions
ezranbayantemurcommented, May 5, 2020

@RevanthM @ninjz

Probably it happens because of build caches. Looks like cleaning the build cache (Shift + Alt + CMD + K) and re-build the project via Xcode solving the problem. I’m not sure it’s certainly the solution, but it works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swift - Error : Socket SO_ERROR [61: Connection refused]
I had a similar problem. After replacing the localhost with a machine's IP address(ex, 192.168.100.XXX), it worked well.
Read more >
JSON problem in App Development wi… - Apple Developer
I guess I found a solution: Right-click on the OpenRestaurant icon - Choose Show package - Contents - Mac OS - Open Restaurant....
Read more >
Apps slow to boot when connected to wifi : r/osx - Reddit
<1> HTTP load failed, 0/0 bytes (error code: -999 [1:89]) error ... <private> Socket SO_ERROR [61: Connection refused] error ...
Read more >
Running app from physical device gives error "Connection ...
When running the app on the simulator everything works, but when I try and run the code from my iPhone 11 Pro, I...
Read more >
react native metro bundler not starting : Solved Solution
Recently a lot of programmers are having issue on using a react native init application to start an app all because of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found