Bendr0id / xmrigCC

RandomX, CryptoNight, Argon2 and GhostRider CPU/GPU miner with Command&Control (CC) Server and Monitoring
GNU General Public License v3.0
313 stars 109 forks source link

Xmrigcc-1.8.1 will not reconnnect to proxy sever/pool after connection lost. #198

Closed lost-bro closed 6 years ago

lost-bro commented 6 years ago

Both Xmrigcc -1.8.0 and Xmrigcc-1.8.1 will not reconnnect to proxy sever/pool after connection lost. I've installed this in a couple of different machines (windows10 & 7) with the same results. I am using Xmrig-2.8.1 proxy. When the proxy goes down (offline) for even only a moment the miner will disconnect. When the proxy comes back online, the miner does not re-connect and maintains the same error message: error message

I have not seen this behavior on the earlier versions of the XmrigCC, and I am using the same proxy and client machines.

electroape commented 6 years ago

I've had similar issue, but cannot reproduce it now. It's reproduceable ?

Bendr0id commented 6 years ago

Please provide logs. The impl doesn't change in the last versions

Am 20.10.2018 20:24 schrieb sPk notifications@github.com:

I've had similar issue, but cannot reproduce it now. It's reproduceable ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Bendr0id/xmrigCC/issues/198#issuecomment-431606509, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAXZgRqX1Yhxm8rVXVRb-LSF5A4f3mK0ks5um2pRgaJpZM4XyD9b.

djfinch commented 6 years ago

I did multiple tests here https://github.com/Bendr0id/xmrigCC/issues/194#issuecomment-430771904 and reconnect is OK so it might be xmrig-proxy specific issue... XNP shutdown/relaunch tested and miner will reconnect as usual...

Bendr0id commented 6 years ago

@lost-bro from your screenshot you waited only a few seconds.. it can take up to one minute to reconnect.

Not able to reproduce this issue.

@uz-spark you have a completely different case. Please don't mixup things.

lost-bro commented 6 years ago

Thanks for the fast response: I will let it run to see how long it will require to reconnect. I will report back. Thanks mjd

Bendr0id commented 6 years ago

https://asciinema.org/a/EJpCILlo8cpZIPrSzBNyiuP8O

There you go.

lost-bro commented 6 years ago

It can be seen that reconnect is normal when NOT using TLS proxy: Reconnect time = 1-2min. approx.

tls issue works without tls OK< it seems to be a TLS issue, I built the source code w/ MYSY2 using 'pacman -S openssl-devel' for ssl package. I am using a frontend TLS proxy (Stunnel 5.48) connected to Xmrig-proxy.

Bendr0id commented 6 years ago

It's working exactly the same way with TLS. I use in general always TLS-offloader (haproxy) in front of my xmrig-proxies. This was just for making the test simpler.

Reconnect time is 5-10 seconds.

lost-bro commented 6 years ago

OK< Can you share your config setup for Haproxy and I will install it and test it in place of Stunnel proxy? OK, see you are using Linux and not windows........ hmm, not sure if Haproxy will work on window box?

Bendr0id commented 6 years ago

Haproxy/stunnel doesn't matter. If they are proper configures they should behave the same.

I would bet youre stunnel timeout are ways to high.

This is my haproxy config:

global
        log /dev/log    local0
        log /dev/log    local1 notice
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
        stats timeout 30s
        user haproxy
        group haproxy
        daemon
        # Default SSL material locations
        ca-base /etc/ssl/certs
        crt-base /etc/ssl/private

        # Default ciphers to use on SSL-enabled listening sockets.
        # For more information, see ciphers(1SSL). This list is from:
        #  https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
        # An alternative list with additional directives can be obtained from
        #  https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
        ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
#       ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:!aNULL:!MD5:!DSS
        ssl-default-bind-options no-sslv3

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        timeout connect 5000
        timeout check 5000
        timeout client  10m
        timeout server  10m

frontend xmrig_cn_lite
        bind 0.0.0.0:1080 name https ssl crt /etc/ssl/donate/donate.pem
        mode tcp
        option tcplog
        default_backend xmrig_backend_cn_lite

backend xmrig_backend_cn_lite
        mode tcp
        server proxy 127.0.0.1:7000 check
Bendr0id commented 6 years ago

Case: Haproxy running, xmrig-proxy stopped after a while. Then xmrig-proxy restarted.

[2018-10-20 22:25:51] cryptonight hash self-test
[2018-10-20 22:25:53] cryptonight hash self-test... successful.
 * VERSIONS:     XMRigCC/1.8.1 (based on XMRig) libuv/1.23.1 gcc/8.2.0 (DEBUG with TLS)
 * CPU:          Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (1) x64 AES-NI ASM-INTEL
 * CPU L2/L3:    1.0 MB/8.0 MB
 * THREADS:      4, cryptonight, aes=1, hf=1, donate=5%, affinity=auto
 * POOL #1:      donate.graef.in:8081 (TLS)
 * COMMANDS:     hashrate, pause, resume, quit
[2018-10-20 22:25:53] Please configure CC-Url and restart. CC feature is now deactivated.
[2018-10-20 22:25:53] Starting thread 3/4 affined to core: #2 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:25:53] Starting thread 1/4 affined to core: #0 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:25:53] Starting thread 2/4 affined to core: #1 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:25:53] Starting thread 4/4 affined to core: #3 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:25:53] use pool donate.graef.in:8081
[2018-10-20 22:25:53] new job from donate.graef.in:8081 with diff 10000 and PoW 0
[2018-10-20 22:26:06] [donate.graef.in:8081] Error: "[Read] End of file"
[2018-10-20 22:26:06] no active pools, stop mining
[2018-10-20 22:26:12] [donate.graef.in:8081] Error: "[Read] End of file"
[2018-10-20 22:26:18] [donate.graef.in:8081] Error: "[Read] End of file"
[2018-10-20 22:26:24] [donate.graef.in:8081] Error: "[Read] End of file"
[2018-10-20 22:26:31] [donate.graef.in:8081] timeout
[2018-10-20 22:26:35] [donate.graef.in:8081] Error: "[Read] End of file"
[2018-10-20 22:26:41] [donate.graef.in:8081] Error: "[Read] End of file"
[2018-10-20 22:26:47] use pool donate.graef.in:8081
[2018-10-20 22:26:47] new job from donate.graef.in:8081 with diff 10000 and PoW 0
Bendr0id commented 6 years ago

Case: Haproxy running, xmrig-proxy running, haproxy stopped. Then haproxy restarted.

[2018-10-20 22:27:38] cryptonight hash self-test
[2018-10-20 22:27:39] cryptonight hash self-test... successful.
 * VERSIONS:     XMRigCC/1.8.1 (based on XMRig) libuv/1.23.1 gcc/8.2.0 (DEBUG with TLS)
 * CPU:          Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (1) x64 AES-NI ASM-INTEL
 * CPU L2/L3:    1.0 MB/8.0 MB
 * THREADS:      4, cryptonight, aes=1, hf=1, donate=5%, affinity=auto
 * POOL #1:      donate.graef.in:8081 (TLS)
 * COMMANDS:     hashrate, pause, resume, quit
[2018-10-20 22:27:39] Please configure CC-Url and restart. CC feature is now deactivated.
[2018-10-20 22:27:39] Starting thread 1/4 affined to core: #0 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:27:39] Starting thread 2/4 affined to core: #1 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:27:39] Starting thread 3/4 affined to core: #2 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:27:39] Starting thread 4/4 affined to core: #3 -> huge pages: 1/1 scratchpad: 2.0 MB
[2018-10-20 22:27:40] use pool donate.graef.in:8081
[2018-10-20 22:27:40] new job from donate.graef.in:8081 with diff 10000 and PoW 0
[2018-10-20 22:27:42] new job from donate.graef.in:8081 with diff 10000 and PoW 0
[2018-10-20 22:27:57] accepted (1/0) diff 10000 (249 ms)
[2018-10-20 22:28:00] [donate.graef.in:8081] Error: "[Read] short read"
[2018-10-20 22:28:00] no active pools, stop mining
[2018-10-20 22:28:06] [donate.graef.in:8081] Error: "[Connect] Connection refused"
[2018-10-20 22:28:12] [donate.graef.in:8081] Error: "[Connect] Connection refused"
[2018-10-20 22:28:18] use pool donate.graef.in:8081
[2018-10-20 22:28:18] new job from donate.graef.in:8081 with diff 10000 and PoW 0
Bendr0id commented 6 years ago

I really can't see an issue here.

lost-bro commented 6 years ago

Apparently I have a TLS connection issue due to Stunnel interface. I will have to investigate exactly which part of the configuration is causing the problem. Thanks for the advice. mjd

EDIT: yes, no issue w/ xmrigCC, thanks

Bendr0id commented 6 years ago

As you can see above. Even if i turn of the TLS tunnel/haproxy, it will reconnect once its back.