etcd server output some error - etcd

I started up with an etcdv3 single server, etcdctl get / put is ok but the server console has some error logs and how to fix it
2017-06-19 09:26:42.225787 I | etcdserver/api/v3rpc: grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::]:2379: connect: cannot assign requested address"; Reconnecting to {[::]:2379 <nil>}
2017-06-19 09:27:01.415397 I | etcdserver/api/v3rpc: grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::]:2379: connect: cannot assign requested address"; Reconnecting to {[::]:2379 <nil>}
2017-06-19 09:27:08.209185 I | etcdserver/api/v3rpc: grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::]:2379: connect: cannot assign requested address"; Reconnecting to {[::]:2379 <nil>}
2017-06-19 09:27:22.992708 I | etcdserver/api/v3rpc: grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::]:2379: connect: cannot assign requested address"; Reconnecting to {[::]:2379 <nil>}
2017-06-19 09:27:40.156845 I | etcdserver/api/v3rpc: grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp [::]:2379: connect: cannot assign requested address"; Reconnecting to {[::]:2379 <nil>}
server start script is :
docker run \
--rm \
-p 2379:2379 \
-p 2380:2380 \
--name etcd-v3 \
--volume=/data/docker/etcd-sigle-data:/etcd-data \
quay.io/coreos/etcd:v3.2.0 \
/usr/local/bin/etcd \
--name my-etcd \
--data-dir /etcd-data \
--listen-client-urls http://0.0.0.0:2379 \
--advertise-client-urls http://xxx.xxx.xxx.xxx:2379
--listen-peer-urls http://0.0.0.0:2380 \
--initial-advertise-peer-urls http://xxx.xxx.xxx.xxx:2380 \
--initial-cluster my-etcd=http://xxx.xxx.xxx.xxx:2380 \
--initial-cluster-token etcd-cluster-token \
--initial-cluster-state new \
--auto-compaction-retention 1

Looks like the trouble is related to connecting via ipv6. Try switching to ipv4 by specifiying proper IP address instead of 0.0.0.0 wildcard in --listen-client-urls.

Related

socat localhost proxy with 'Connection refused'

I want to play with socat to setup a localhost proxy , which could redirect my request from local proxy I setup to a remote server.
Below are 2 commands I try (by google)
Command 1: works right on localhost
start socat server
socat -d TCP6-LISTEN:8080,fork,reuseaddr TCP4:drsol.com:80
client connect socat server
curl -I -6 http://localhost:8080/
HTTP/1.1 200 OK
Date: Sun, 25 Dec 2022 13:06:11 GMT
Server: Apache/2.2.15 (CentOS)
Last-Modified: Tue, 10 Jun 2014 17:35:11 GMT
ETag: "2482ce4-2-4fb7ebff1050b"
Accept-Ranges: bytes
Content-Length: 2
Connection: close
Content-Type: text/html; charset=UTF-8
Command 2: 'Connection refused' error on localhost server terminal
setup socat server
socat TCP6-LISTEN:8000 PROXY:localhost:drsol.com:80,proxyport=8080
connect socat server
curl -v http://localhost:8000/
* STATE: INIT => CONNECT handle 0x55fce853a968; line 1789 (connection #-5000)
* Uses proxy env variable no_proxy == 'localhost,127.0.0.0/8,::1'
* Added connection 0. The cache now contains 1 members
* family0 == v4, family1 == v6
* Trying 127.0.0.1:8000...
* STATE: CONNECT => CONNECTING handle 0x55fce853a968; line 1850 (connection #0)
* Connected to localhost (127.0.0.1) port 8000 (#0)
* STATE: CONNECTING => PROTOCONNECT handle 0x55fce853a968; line 1982 (connection #0)
* STATE: PROTOCONNECT => DO handle 0x55fce853a968; line 2003 (connection #0)
> GET / HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.80.0
> Accept: */*
>
* STATE: DO => DID handle 0x55fce853a968; line 2099 (connection #0)
* STATE: DID => PERFORMING handle 0x55fce853a968; line 2218 (connection #0)
* STATE: PERFORMING => DONE handle 0x55fce853a968; line 2417 (connection #0)
* multi_done
* Empty reply from server
* The cache now contains 0 members
* Closing connection 0
* Expire cleared (transfer 0x55fce853a968)
curl: (52) Empty reply from server
on the socat server terminal "Connection refused"
2022/12/25 21:10:42 socat[46697] E connect(5, AF=2 127.0.0.1:8080, 16): Connection refused
My question is : what was the difference between command 1 and command 2 , and why the connection refused happend on command 2?
(I am new to socat and on my way of learning it)

Wireguard windows 11 - not able to access client lan

I have setup wireguard server and client.
Server - Ubuntu 18.04
Client - Windows 11(x64)
Wireguard Interface Subnet - 10.200.1.0/24
Wireguard Server IP - 10.200.1.27/24
server.conf
Address = 10.200.1.27/24
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE;
ListenPort = 51820
PrivateKey = WHnFUoljugAbX3XkmHg2TmZH4k2ptbX0N1xB7cruN2g=
[Peer]
PublicKey = *********
AllowedIPs = 10.200.1.72/32, 192.168.1.0/24
Endpoint = ********:63587
[Peer]
PublicKey = ********
AllowedIPs = 10.200.1.71/32
Endpoint = ********:10295
Wireguard Client is in home network 192.168.1.0/24 and windows 11 has the IP address 192.168.1.25
windows11-Wireguard-Client-Config
[Interface]
Address = 10.200.1.72/24
ListenPort = 63587
PrivateKey = *******
[Peer]
PublicKey = ********
AllowedIPs = 10.200.1.0/24
Endpoint = *******:51820
PersistentKeepalive = 30
Problem
From another peer, I am able to ping 192.168.1.25 but I have a macOS running on IP 192.168.1.6, so I am unable to ping the macbook.
I even tried adding route on windows
route add -p 192.168.1.0 mask 255.255.255.0 10.200.1.72
From the other peer if I ping after adding the above route the ICMP response will be,
FROM 10.200.1.72: icmp_seq=1 Redirect Network(New nexthop: 192.168.1.6)
Can someone please guide me in what to do, as I have ran out of thoughts.

running browserstack-cypress run --sync ends up with ends up with Client network socket disconnected before secure TLS connection was established

I am trying to use browserstack-cypress with parameter local
Below are my step
run browserstacklocal for linux with command
./BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY --local-identifier $LOCAL_IDENTIFIER --proxy-host $PROXY_HOST --proxy-port $PROXY_PORT --proxy-pass $PROXY_PASS --proxy-user $PROXY_USER --enable-logging-for-api --force-proxy --force-local --verbose 2 > /dev/null 2>&1 &
- sleep 10
verified above step is successful so next is running browserstack-cypress with below option
browserstack-cypress run --sync --specs "${TEST_SPEC_PATH}" --key $BROWSERSTACK_ACCESS_KEY --cf $TEST_CONFIG_PATH --env TEST_USER_NAME=$UBSTEST_USER_NAME,TEST_USER_PASSWORD=$UBSTEST_USER_PASSWORD,BROWSERSTACK_USER=$BROWSERSTACK_USERNAME,BROWSERSTACK_KEY=$BROWSERSTACK_ACCESS_KEY --verbose 2
I have below in my browserstack.json
{
"auth": {
"username": "username",
"access_key": "password",
},
"connection_settings": {
"local": true,
"local_identifier": "5C0E65F2D95C4E55A8DE465248A44E99"
},
but step above ends up with below error
Got Error in binary downloading request Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:604:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1513:19)
at Object.onceWrapper (events.js:417:28)
at TLSSocket.emit (events.js:323:22)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ECONNRESET',
path: null,
host: 'bstack-local-prod.s3.amazonaws.com',
port: 443,
localAddress: undefined
I am using node v12.16.1 and npm 6.13.1
Same issue was raised before may be this helps https://github.com/browserstack/browserstack-cypress-cli/issues/126

Rails 6 Application deployment fails using Elastic Beanstalk - 502 errors

Trying to deploy my rails application to elastic beanstalk but I'm getting 502 errors. I'm running React on Rails and I've tried to follow this -> Rails application deployed on Elastic Beanstalk with Puma fails - 502 errors on every request but no luck. Any ideas?
Here are the logs
/var/logs/nginx/error.log
2020/01/09 04:11:45 [warn] 3083#0: conflicting server name "localhost" on 0.0.0.0:80, ignored
2020/01/09 04:20:04 [crit] 3087#0: *108 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.44.209, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "staging5.q39956drtr.ap-southeast-1.elasticbeanstalk.com"
2020/01/09 04:25:23 [crit] 3087#0: *185 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.44.209, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "staging5.q39956drtr.ap-southeast-1.elasticbeanstalk.com"
2020/01/09 04:25:24 [crit] 3087#0: *185 connect() to unix:///var/run/puma/my_app.sock failed (2: No such file or directory) while connecting to upstream, client: 172.31.44.209, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/favicon.ico", host: "staging5.q39956drtr.ap-southeast-1.elasticbeanstalk.com", referrer: "http://staging5.q39956drtr.ap-southeast-1.elasticbeanstalk.com/"
Puma
healthd 2775 0.0 3.4 683640 34356 ? Ssl 04:11 0:04 puma 2.11.1 (tcp://127.0.0.1:22221) [healthd]
root 7841 1.5 0.2 58788 2612 ? Ss 05:56 0:00 su -s /bin/bash -c bundle exec puma -C /opt/elasticbeanstalk/support/conf/pumaconf.rb webapp
webapp 7940 43.0 1.1 70180 11460 ? Rs 05:56 0:00 /opt/rubies/ruby-2.6.5/bin/ruby /opt/rubies/ruby-2.6.5/bin/bundle exec puma -C /opt/elasticbeanstalk/support/conf/pumaconf.rb
root 7957 0.0 0.2 110516 2136 pts/0 S+ 05:56 0:00 grep --color=auto puma
pumaconf.rb
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
port ENV.fetch("PORT") { 3000 }
#
environment ENV.fetch("RAILS_ENV") { "development" }
# pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
bind "unix:///var/run/puma/my_app.sock"
pidfile "/var/run/puma/my_app.sock"
plugin :tmp_restart

use polipo to convert shadowsocks into an HTTP proxy

My ssserver is started by docker image oddrationale/docker-shadowsocks:
docker run -d -p 1984:1984 oddrationale/docker-shadowsocks -s 0.0.0.0 -p 1984 -k paaassswwword -m aes-256-cfb
Then I use sslocal command to get local proxy.
sslocal -c /etc/shadowsocks.json -d start --pid-file /data/tmp/sslocal.pid --log-file /data/tmp/sslocal.log
/etc/shadowsocks.json is like this:
{
"server":"127.0.0.1",
"server_port":1984,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"paaassswwword",
"timeout":600,
"method":"aes-256-cfb"
}
I use polipo to convert shadowsocks to http proxy, my /etc/polipo/config is:
proxyAddress = 0.0.0.0
socksProxyType = socks5
socksParentProxy = 127.0.0.1:1080
daemonise = true
pidFile = /data/tmp/polipo.pid
logFile = /data/tmp/polipo.log
I edit the iptables rules to make port 8123 can be accessed. I can access http://host:8123 in browser, and the proxy looks work:
http_proxy=http://host:8123 curl -v google.com
the output is like this:
* Rebuilt URL to: google.com/
* Trying host...
* Connected to host (host) port 8123 (#0)
> GET HTTP://google.com/ HTTP/1.1
> Host: google.com
> User-Agent: curl/7.43.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 302 Found
< Content-Length: 262
< Date: Thu, 13 Apr 2017 09:52:34 GMT
< Cache-Control: private
< Content-Type: text/html; charset=UTF-8
< Referrer-Policy: no-referrer
< Location: http://www.google.com.sg/?gfe_rd=cr&ei=YkrvWPnOM-XLugTRgZDQBA
< Connection: keep-alive
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
here.
</BODY></HTML>
* Connection #0 to host host left intact
The command does not always run successfully, and sometimes I get the following error:
* Rebuilt URL to: google.com/
* Trying host...
* Connected to host (host) port 8123 (#0)
> GET HTTP://google.com/ HTTP/1.1
> Host: google.com
> User-Agent: curl/7.43.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
The output of netstat -tlnp is:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:1080 0.0.0.0:* LISTEN 5067/python
tcp 0 0 0.0.0.0:8123 0.0.0.0:* LISTEN 9704/polipo
tcp6 0 0 :::8388 :::* LISTEN 4238/docker-proxy
I really can't find the reason, thank you for your help.
google use https, not http, try
https_proxy=http://host:8123 curl -v https://www.google.com

Resources