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
Connection refused when fetching status for root key of local replica #4
Comments
agent_dart/example/lib/main.dart Line 40 in ca5f341
Just do it here, like or can you post your code here to see what's going on there |
Yes, that's how I did it I also tried to set the host directly when initializing HttpAgentOptions at agent_dart/example/lib/init.dart Line 60 in ca5f341
like options: HttpAgentOptions()..identity=_identity..host='localhost:40161', but still got the same error.. As far as my setup is concerned, your scripts to build the binaries and link them worked without errors and I'm using an Android Pixel 2 API 29 emulator. (also had to change to $ANDROID_NDK_HOME in variables.sh) Btw, I found a typo here: agent_dart/lib/agent/agent/http/index.dart Line 101 in ca5f341
This should probably be defaultPort
|
First, thanks for pointing out the typo. will be fixed in next release. Second, if you use Android emulator , the emulator connects localhost will use "10.0.2.2" instead of "localhost" or "127.0.0.1". In your case, you should try "http://10.0.2.2:40161" just in the url field |
Thanks that was it! |
I'm encountering this error when calling fetchRootKey() of HttpAgent in _initAgent():
E/flutter (23155): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: http request failed because SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 46950
E/flutter (23155): #0 HttpAgent._defaultFetch (package:agent_dart/agent/agent/http/index.dart:433:7)
E/flutter (23155):
E/flutter (23155): #1 HttpAgent.status (package:agent_dart/agent/agent/http/index.dart:362:20)
E/flutter (23155):
E/flutter (23155): #2 HttpAgent.fetchRootKey (package:agent_dart/agent/agent/http/index.dart:246:20)
E/flutter (23155):
E/flutter (23155): #3 AgentFactory._initAgent (package:agent_dart_example/init.dart:63:7)
E/flutter (23155):
E/flutter (23155):
This means that the port somehow gets changed since I specified port 40161 in the url of the AgentFactory (this is where my local replica runs).
I also tried to directly set the port with the host parameter of HttpAgentOptions but still get the same error.
Am I missing something?
The text was updated successfully, but these errors were encountered: