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: Failed to load 'http://localhost:8083/create_session' #1732

Open
lucaszanella opened this Issue Mar 29, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@lucaszanella
Copy link

lucaszanella commented Mar 29, 2018

Hi, i've read multiple posts about this error. I believe mine is happening because I run a very uncommon setup: Android Emulator comunicates with a virtual machine running everything I need.

The virtual machine is always at 192.168.122.99 which is reachable by the Android Emulator just by doing 192.168.122.99.

I need to understand what is realm doing. Is is trying to simply access localhost:8083 or there's more? I've read the code and it appears that it runs an webserver on the Android side. What is it for?

I need to know what is 8083 so I can know how to route things right. If the problem were only that localhost:8083 should go to 192.168.122.99:8083 then adb reverse tcp:8083 192.168.122.99:8083 should work but it's not working.

Could somebody explain the network topology better to me?

@lucaszanella

This comment has been minimized.

Copy link
Author

lucaszanella commented Mar 29, 2018

For instance: what is this RPC communication? Why Realm is trying to connect to it and how it should start on my computer if I didn't type anything? For it to connect to 8083 I should have launched something that binds to 8083, right?

@kneth

This comment has been minimized.

Copy link
Contributor

kneth commented Apr 3, 2018

Realm connects to something in two cases:

@lucaszanella

This comment has been minimized.

Copy link
Author

lucaszanella commented Apr 3, 2018

Thank you. By understanding what was happening, I was able to do the proper redirecting.

Seems that the problem is that chrome debugger tries to connect with the RPC realm server running on Android at port 8083.

For those who run an inconventional setup inside VMs and do proper networking, here it goes:

In my virtual machine, I sent the 8083 port to the 8083 port of the host machine

socat tcp-listen:8083,bind=localhost,reuseaddr,fork tcp:192.168.122.1:8083

(my virtual machine uses the 192.168.122.1 address for the gateway, which is my host machine)

I then redirected 192.168.122.1:8083 to localhost:8083 on my host machine:

socat tcp-listen:8083,bind=192.168.122.1,reuseaddr,fork tcp:localhost:8083

In order for it to reach android I'd have to redirect localhost:8083 to android's port but this was not needed because npm run android runs adb forward tcp:8083 tcp:8083 automatically, thus making
localhost:8083 on my host machine arrive at android's 8083 port where the RCP server from Realm is running

@kneth

This comment has been minimized.

Copy link
Contributor

kneth commented Apr 4, 2018

@lucaszanella Thanks for the explanation. It's a good candidate for something to add to our documentation 😃 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment