I run the aestratum_client,but get error in this place

==> Booted enacl
===> Booted aecuckoo
===> Booted aecuckooprebuilt
===> Booted aeminer
18:44:09.778 [error] Supervisor aestratum_client_sup had child aestratum_client_handler started with aestratum_client_handler:start_link(#{conn_cfg => #{host => <<“47.244.15.72”>>,port => 8888,req_retries => 3,req_timeout => 14000,socket_opts => …,…},…}) at <0.350.0> exit with reason normal in context child_terminated
===> Booted aestratum_lib
18:44:09.778 [info] Application aestratum_client started on node [email protected]
===> Booted aestratum_client
18:44:09.868 [error] Supervisor aestratum_client_sup had child aestratum_client_handler started with aestratum_client_handler:start_link(#{conn_cfg => #{host => <<“47.244.15.72”>>,port => 8888,req_retries => 3,req_timeout => 14000,socket_opts => …,…},…}) at <0.357.0> exit with reason normal in context child_terminated
18:44:09.868 [error] Supervisor aestratum_client_sup had child aestratum_client_handler started with aestratum_client_handler:start_link(#{conn_cfg => #{host => <<“47.244.15.72”>>,port => 8888,req_retries => 3,req_timeout => 14000,socket_opts => …,…},…}) at <0.357.0> exit with reason reached_max_restart_intensity in context shutdown
18:44:09.869 [info] Application aestratum_client exited with reason: shutdown

=============>
I don’t quite understand what went wrong. anyone help?

Hi Carfield,

could you please share your aestratum_client.yaml config file?

Thanks

connection:
transport: tcp
host: “47.244.15.72”
port: 8888
req_timeout: 14
req_retries: 3
user:
account: “ak_2uFg2xwmmYQJZPVc9D5YQ7h7PScZhJgH5QHexoDGmkLVjNJNuA”
worker: “A001”
miners:
- exec: “mean29-generic”
exec_group: “aecuckoo”
extra_args: “”
hex_enc_hdr: false
repeats: 100
edge_bits: 29

It seems the problem stems from the unicode quote characters in the configuration file.

Try to replace them with regular (ascii) quotes, like this:

connection:
        transport: tcp
        host: "47.244.15.72"
        port: 8888
        req_timeout: 14
        req_retries: 3
user:
        account: "ak_2uFg2xwmmYQJZPVc9D5YQ7h7PScZhJgH5QHexoDGmkLVjNJNuA"
        worker: "A001"
miners:
        - exec: "mean29-generic"
          exec_group: "aecuckoo"
          extra_args: ""
          hex_enc_hdr: false
          repeats: 100
          edge_bits: 29

I have changed characters,but still get error.

Looking at the log/aestratum_client.log it seems the connection is closed on the server side:

2019-07-15 11:31:16.550 [info] <0.338.0>@aestratum_client_handler:init:67 socket_connected, transport: gen_tcp, host: <<"47.244.15.72">>, port: 8888
2019-07-15 11:31:16.565 [info] <0.338.0>@aestratum_client_session:send_configure_req:326 send_configure_req, req: #{id => 0,method => configure,params => [],type => req}
2019-07-15 11:31:16.920 [warning] <0.338.0>@aestratum_client_handler:handle_socket_close:115 socket_close
2019-07-15 11:31:16.920 [critical] <0.338.0>@aestratum_client_session:close_session:376 close_session
2019-07-15 11:31:17.467 [info] <0.346.0>@aestratum_client_handler:init:67 socket_connected, transport: gen_tcp, host: <<"47.244.15.72">>, port: 8888
2019-07-15 11:31:17.467 [info] <0.346.0>@aestratum_client_session:send_configure_req:326 send_configure_req, req: #{id => 0,method => configure,params => [],type => req}
2019-07-15 11:31:18.081 [info] <0.346.0>@aestratum_client_session:recv_rsp:195 recv_configure_rsp, rsp: #{id => 0,method => configure,result => [],type => rsp}
2019-07-15 11:31:18.082 [info] <0.346.0>@aestratum_client_session:send_subscribe_req:336 send_subscribe_req, req: #{host => <<"47.244.15.72">>,id => 1,method => subscribe,port => 8888,session_id
=> null,type => req,user_agent => <<"aeclient/1.0.0">>}
2019-07-15 11:31:18.087 [warning] <0.346.0>@aestratum_client_handler:result:145 socket_send, reason: closed, data: <<"{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"mining.subscribe\",\"params\":[\"a
eclient/1.0.0\",null,\"47.244.15.72\",8888]}\n">>
2019-07-15 11:31:18.088 [critical] <0.346.0>@aestratum_client_session:close_session:376 close_session

Maybe the server is not running at the given port?

At this point, we need to have server logs to move further.

Can you leave an email address to me? I will send you the package of log

For posterity, in case other users hit the same issues, it’s best to create a new issue in the github repository and link to this conversation here:

https://github.com/aeternity/aeternity/issues/new

It’s possible to upload files there as well. (in our case we need all aestratum* log files as well)

Thanks for your patient reply.I will mention issue later

1 Like

Here is my issues

handle_conn_timeout and unexpected_msg

It looks like client is sending some non-JSON message to server, where it fails at parsing stage.

Run the server and copy & paste this snippet to the server’s erlang shell:

dbg:tracer().
dbg:p(all, call).
dbg:tpl(aestratum_jsonrpc, decode, [{'_', [], [{return_trace}]}]).

(press enter after that so that the trace hooks are set up)

Then start the client as usual and you should see outputs like this (the “asdf” - that just for illustration):

(<0.1794.0>) call aestratum_jsonrpc:decode(<<"adsf">>)
(<0.1794.0>) call aestratum_jsonrpc:decode(<<"adsf">>,#{})
(<0.1794.0>) returned from aestratum_jsonrpc:decode/2 -> {error,parse_error}
(<0.1794.0>) returned from aestratum_jsonrpc:decode/1 -> {error,parse_error}

Once you see the {error,parse_error} please copy & paste the output of these trace hooks (e.g. every line starting with (<0…0>) call (and returned)) here so we can take a look what is sent to the server.

I run the erlang shell on server but don’t get outputs like you say.

By just running erl you are running a plain Erlang shell, without any specific application started.

To see the trace output, the trace hooks must be installed inside Erlang running Aeternity node (which also runs Aestratum server application).

But, this step (running the trace hooks) was just for confirmation of the suspicion I got from the logs that the server is ran behind a HTTP proxy - could you please confirm.

While the Aeternity node API is using HTTP, and thus API can be accessed via proxy, the communication between Aestratum server (part of AE node) and Aestratum client uses JSONRPC protocol, so you cannot tunnel the traffic between them via HTTP proxy.

Try running Aeternity node without proxy so that client can connect to it directly.

Sorry, I really don’t understand how to run those steps on the server. Could you please write the execution code?

In your aeternity directory where you unzipped the package, run this command:

./bin/aeternity console

(then you can copy & paste the trace setup commands (+ enter))

However, as mentioned above, the problem seems to be that the node is ran behind a HTTP proxy - please confirm this is so and in that case the problem is already found.

Aestratum can’t talk to clients via proxy as that’s different protocol.

Thanks for your help.I didn’t set up the HTTP proxy specifically.
So how do I start up the aeterniry node without the proxy?

I use unset http_proxy and https_proxy but get the same error