Failed to open TCP connection - ruby-on-rails

While attempting to open a TCP connection to graph.facebook.com, I receive the following error:
Failed to open TCP connection to graph.facebook.com:443 (getaddrinfo:
Name or service not known)
TCPSocket.open(conn_address, conn_port, #local_host, #local_port)
rescue => e
raise e, "Failed to open TCP connection to " +
"#{conn_address}:#{conn_port} (#{e.message})"
end
}
Help me with this error
I'm using omniauth with Rails 5.0.0.beta3

Start by checking your network configuration.
Run this command on your terminal:
dig +short graph.facebook.com
If you do not get any IP address, your system don't know how to resolve this and the problem is not related to Ruby.
In addition to that as mentioned by Dawood Awan in his comment, opening a TCP connection to the port 443 is usually not a good idea, I am pretty sure facebook is excepting an HTTPS Connection.

Related

error while using ESP-IDF MQTT TCP example (0x8006 & 0x8004)

I am trying to use example from esp-idf protocal/mqtt/tcp
I changed the user name and password using idf.py menuconfig
then after erasing flash using esptool.py --port /dev/ttyUSB0 erase_flash
After build I uploaded the code to ESP32 using
idf.py build
idf.py -p /dev/ttyUSB0 flash
And when I monitor it
idf.py -p /dev/ttyUSB0 monitor
It Showed the following error
I (4609) esp_netif_handlers: example_netif_sta ip: 192.168.69.134, mask: 255.255.255.0, gw: 192.168.69.50
I (4609) example_connect: Got IPv4 event: Interface "example_netif_sta" address: 192.168.69.134
I (5609) example_connect: Got IPv6 event: Interface "example_netif_sta" address: fe80:0000:0000:0000:7ae3:6dff:fe18:eeb8, type: ESP_IP6_ADDR_IS_LINK_LOCAL
I (5609) example_common: Connected to example_netif_sta
I (5619) example_common: - IPv4 address: 192.168.69.134,
I (5619) example_common: - IPv6 address: fe80:0000:0000:0000:7ae3:6dff:fe18:eeb8, type: ESP_IP6_ADDR_IS_LINK_LOCAL
I (5639) MQTT_EXAMPLE: Other event id:7
E (14809) esp-tls: [sock=54] delayed connect error: Connection reset by peer
E (14809) transport_base: Failed to open a new connection: 32772
E (14819) mqtt_client: Error transport connect
I (14819) MQTT_EXAMPLE: MQTT_EVENT_ERROR
E (14829) MQTT_EXAMPLE: Last error reported from esp-tls: 0x8004
E (14829) MQTT_EXAMPLE: Last error captured as transport's socket errno: 0x68
I (14839) MQTT_EXAMPLE: Last errno string (Connection reset by peer)
I (14849) MQTT_EXAMPLE: MQTT_EVENT_DISCONNECTED
E (83319) esp-tls: [sock=54] select() timeout
E (83319) transport_base: Failed to open a new connection: 32774
E (83319) mqtt_client: Error transport connect
I (83319) MQTT_EXAMPLE: MQTT_EVENT_ERROR
E (83329) MQTT_EXAMPLE: Last error reported from esp-tls: 0x8006
But when I using wifi/getting_started example from esp-idf doing the same as above it works perfectly fine
I am a newbie so I am finding it hard to understand the error
ESP_ERR_ESP_TLS_FAILED_CONNECT_TO_HOST (0x8004): Failed to connect to host
ESP_ERR_ESP_TLS_CONNECTION_TIMEOUT (0x8006): new connection in esp_tls_low_level_conn connection timeouted
As per hardillb's suggestion I used ESP32 as access point :-
after using one ESP32 as access point wifi/getting_started/softAP
when I am trying to use the same example on second ESP32 :
protocal/mqtt/tcp
I am facing error
E (562605) esp-tls: couldn't get hostname for :mqtt.eclipseprojects.io: getaddrinfo() returns 202, addrinfo=0x0
E (562605) transport_base: Failed to open a new connection: 32769
E (562605) mqtt_client: Error transport connect
I (562615) MQTT_EXAMPLE: MQTT_EVENT_ERROR
E (562615) MQTT_EXAMPLE: Last error reported from esp-tls: 0x8001
I (562625) MQTT_EXAMPLE: Last errno string (Success)
I (562625) MQTT_EXAMPLE: MQTT_EVENT_DISCONNECTED
I (572635) MQTT_EXAMPLE: Other event id:7

What is the purpose of port 19333 for SeaweedFS?

I have this error:
I0929 12:58:57.623373 volume_grpc_client_to_master.go:43 checkWithMaster 172.20.16.35:19333: get master 172.20.16.35:19333 configuration: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 172.20.16.35:29333: connect: connection refused"
Started SeaweedFS with:
./weed server -dir="./data"
version is 3.29 on RedHat 8.
Is port 19333 used for gRPC calls? For hearth beat? Can I turn this OFF? How?
BR, Rene
"Is port 19333 used for gRPC calls? For hearth beat? Can I turn this OFF?"
Yes. Yes. No.

"rpc error: code = Unavailable desc = closing transport due to: connection error"

I am using k8 to host my grpc service.
Sometimes, I am getting the following error (few milliseconds into my request):
rpc error: code = Unavailable desc = closing transport due to: connection error: desc = "error reading from server: read tcp <ipaddr>:52220-><internal ip addr>:8070: read: connection reset by peer", received prior goaway: code: NO_ERROR
May I ask how will this occur? Could it be that the k8's network is down?
This happened because on server shutdown, it sends an initial GOAWAY to support graceful shutdown. This means your server shut down.

Connection refused - connect(2) for "localhost" port 25 chef devops

I am working on chef(devops) where I have a helper library with the following code in it
require 'net/smtp'
module HandlerSendEmail
class Helper
def send_email_on_run_failure(node_name)
message = "From: Chef <chef#chef.io>\n"
message << "To: Grant <xyz#test.com>\n"
message << "Subject: Chef run failed\n"
message << "Date: #{Time.now.rfc2822}\n\n"
message << "Chef run failed on #{node_name}\n"
Net::SMTP.start('localhost', 25) do |smtp|
smtp.send_message message, 'chef#chef.io', 'xyz#test.com'
end
end
end
end
But whhen I run the recipe I get
Chef Client failed. 0 resources updated in 02 seconds
[2017-10-30T05:19:38+00:00] ERROR: Connection refused - connect(2) for "localhost" port 25
[2017-10-30T05:19:38+00:00] ERROR: Connection refused - connect(2) for "localhost" port 25
I tried changing port to 90 and some other options I keep getting same error.There are some solution available on few posts on stackoverflow already but all of them are talking about some other .rb files which is not present on my dev environment.
Connection refused - connect(2) Ruby on Rails Mail Setup
Errno::ECONNREFUSED: Connection refused - connect(2) for action mailer
You would need to have an actual SMTP server listening on localhost and I'm guessing you don't have one. Without more information it's hard to say though. If you don't want run your own relay server, you can find instructions all over the internet for setting up outbound SMTP via GMail, Amazon SES, Sparkpost, Sendgrid, and may more.

Flume agent throws java.net.ConnectException: Connection refused

I have been using flume for a while now, I have got agent and collector running on same machine.
Configuration
agent: exec("/usr/bin/tail -n +0 -F /path/to/file") | agentE2ESink("hostname", 35855)
collector: collectorSource(35855) | collector(10000) { collectorSink("/hdfs/path/to/sink","name") }
Facing issues in the agent node:
2012-06-04 19:13:33,625 [naive file wal consumer-27] INFO debug.InsistentOpenDecorator: open attempt 0 failed, backoff (1000ms): Failed to open thrift event sink to hostname:35855 : java.net.ConnectException: Connection refused
2012-06-04 19:13:34,625 [logicalNode hostname-19] ERROR connector.DirectDriver: Expected ACTIVE but timed out in state OPENING
2012-06-04 19:13:34,632 [naive file wal consumer-27] INFO debug.InsistentOpenDecorator: open attempt 1 failed, backoff (2000ms): Failed to open thrift event sink to hostname:35855 : java.net.ConnectException: Connection refused
2012-06-04 19:13:36,635 [naive file wal consumer-27] INFO debug.InsistentOpenDecorator: open attempt 2 failed, backoff (4000ms): Failed to open thrift event sink to hostname:35855 : java.net.ConnectException: Connection refused
and then empty ACKs will be sent continuously
2012-06-04 19:19:56,960 [Roll-TriggerThread-0] INFO endtoend.AckListener$Empty: Empty Ack Listener began 20120604-191956958+0530.881565921235084.00000026
2012-06-04 19:20:07,043 [Roll-TriggerThread-0] INFO hdfs.SeqfileEventSink: closed /tmp/flume-user1/agent/hostname/writing/20120604-191956958+0530.881565921235084.00000026
I dont understand why the connection is refused. Are there any system level changes that needs to be done ?
Note: the collector is listening to the port but agent is unable to send data through the 35855 port.
Can anyone help me with this problem.
Thanks
If you are running both the agent and the collector on the same box, you should be using localhost as the address.
agentE2ESink("localhost", 35855)

Resources