I am frequently getting Pg Connection timeout error in my application. I tried to fix it by upgrading the system memory, also updated the pg gem but the issue is still occurring. Anybody's help will be really appreciated.
(ActiveRecord::StatementInvalid) "PGError: server closed the
connection unexpectedly\n\tThis probably means the server terminated
abnormally\n\tbefore or while processing the request.\n: BEGIN"
Both the client and server think that the other vanished unexpectedly. This suggests that you're having networking problems. Look into the network between client and server:
NAT routers or connection-tracking stateful firewalls with short-lived or undersized connection tables;
Physical connectivity problems with cables, WiFi, etc
Faulty switches, hubs and routers
Buggy software host-based firewalls
... etc
For what it's worth, the easiest solution is ActiveRecord::Base.connection.reconnect! once connectivity is re-established.
Related
I have "mariadb" set to 127.0.0.1 in my /etc/hosts file and sidekiq occasionally throws errors such as:
Mysql2::Error::ConnectionError: Unknown MySQL server host 'mariadb' (16)
The VM is not under significant load or anything like that.
Later edit: seems other gems have trouble resolving hosts too:
WARN -- : Unable to record event with remote Sentry server (Errno::EBUSY - Failed to open TCP connection to XXXX.ingest.sentry.io:443 (Device or resource busy - getaddrinfo)):
Anyone have any idea why that may happen?
I've figured this out a couple weeks ago but wanted to be sure before posting an answer.
I still can't figure out the mechanic of this issue but it was caused by fail2ban.
I had it running in a container polling the httpd logs and blocking the tremendous amount of bots scraping my sites.
Also I increased the max file handlers and inotify handlers.
fs.file-max = 131070
fs.inotify.max_user_watches = 65536
As soon as I got rid of fail2ban and increased the inotify handlers the errors disappeared.
Obviously fail2ban gets on the "do not touch" list because of this, and we've rolled out a 404/403/500 handler on application layer that pushes unknown IPs to Cloudflare.
Although this is probably an edge case I'm leaving this here in hope it helps someone at some point.
I currently have a Firebird 2.5 database at a client premises, installed on a Windows 7 Pro machine (32 bit), that has multiple stations in their local network that can connect to the database, along with the local machine being able to connect with our application and IBExpert.
However, for some of our software packages, a remote connection is required (outside of the local network). This previously was working but no longer works.
When I connect with FlameRobin from my office (I'm located in a different city / different network), I receive the following error message:
IBPP::SQLException
Context: Database::Connect
Message: isc_attach_database failed
SQL Message: -923
Connection not established
Engine Code : 335544421
Engine Message :
connection rejected by remote interface.
Performing this connection attempt with IBExpert, both from my office and from other external networks fail with a same message.
However, I am getting TCP/IP communication from what I can see. Here are the details of my troubleshooting steps for the last week:
Originally, I was receiving the following error when connecting from outside the network:
"Connection not established
Connection refused by remote interface"
Since that time, we have done a restart of the router and now have the current "connection rejected by remote interface." error message.
I can telnet to the public IP through port 3050 from my office and other outside networks.
I tested port 3050 on sites like YouGetSignal.com or CanYouSeeMe.org and they appear as open.
Other ports that we communicate on publicly are open and communicating.
The site has Kaspersky antivirus installed but all tests to connect via IBExpert while Kaspersky was in sleep mode behaved the same.
Installation of Firebird 2.5 to another workstation in the same local network, pointing to port 3051 (both in Firebird.conf and in the Windows Firewall and Router) show up as being open through Telnet and CanYouSeeMe.org but again, cannot be communicated on from outside via port 3051.
IBExpert works from a workstation in the network to the server
The server currently has no entry for RemoteBindAddress in the Firebird.conf
Wireshark shows that when a connecting from outside, there are packets coming through.
The TCP/IP test in IBexpert under Communication Diagnostics for the public IP as the host and the Service show the following Test Results:
Attempt connecting to XX.YY.ZZ.AAA.
Socket for connection obtained.
Found service 'GDS_DB' at port '3050'
Connection established to host 'XX.YY.ZZ.AAA',
on port 3050.
TCP/IP Communication Test Passed!
Database path, username, and password have all been checked multiple times.
locally on the server, I've changed security of the database.FDB and the security2.FDB to have Everyone, Full Control
At this point, we have a scheduled restart of the ISP's modem happening soon, although the fact that we have full TCP/IP communication over the port makes me doubtful that this is the issue.
If anyone can lead me down any recommended next steps to debug or to any tools that are available to help in this situation, that would be greatly appreciated.
This turns out to be a networking issue. We performed the following tests:
We performed a power cycle on the ISP's modem which showed no change in behavior
We connected a laptop directly to the ISP's modem but couldn't communicate to FB even with proper port forwarding rules in place on the machine and firewall.
We ran wireshark on both sides and on connection attempts, we found many attempts to connect with retransmissions that failed.
The technical team at the client side decided to install a VPN capable router and now we're good to go. From what we found there may be some kind of ISP blocking occurring as many of the tech teams remote services were failing to connect with similar behavior.
Hopefully this post helps people in the future with remote connectivity debugging, and all of the places you can look at when you're running into this problem.
Sometimes my ArangoDB is going down with next error:
Error message 'Could not connect to 'tcp://127.0.0.1:8529' 'connect() failed with #10061
I can't understand the reason. It's look like I am turning on my PC and nothing do not work.
Before I fixed this problem with reinstall, but is there any better solution?
OS Windows
ArangoDB 2.8.7
The V8 version used in the pre ArangoDB 3 had occasional troubles in the garbage collection which would make ArangoDB in term go down.
This is fixed with ArangoDB 3.
Please upgrade your installation, and report back whether the problem still persists.
You can use netstat to check whether ArangoDB is listening to its default port 8529:
netstat -a
Active Connections
Proto Lokale Adresse Remoteadresse Status
...
TCP 127.0.0.1:8529 meschenich:0 LISTEN
...
If thats not the case, your client has nothing to connect to.
This could be due to firewall of an antivirus.
In my case it was Avast antivirus that was blocking connecting to that port.
I disabled all the antivirus shields and checked loading arangodb web server
http://127.0.0.1:8529
It connects after few minutes.
Reference : No connection could be made because the target machine actively refused it
I fixed the problem by restarting Windows.
I did install Opennms in a VM Ubuntu on PROXMOX. Everything went well until I did change the interface IP address because the VM must work in a LAN without Internet access. Since then the opennms start correctly but the browser give me the error:
Jetty: HTTP ERROR: 503
Problem accessing /opennms/. Reason:
Service Unavailable
The problem seems to be related with the connection to Internet at the starting of opennms. When I start opens without Internet connection the server do to start correctly.
OpenNMS has a bugfix that may take care of it.
http://issues.opennms.org/browse/NMS-7683
I am facing problem with my delphi application connecting to firebird database on Port 45000:
If I try to connect as Localhost/45000:C:\DBNAME.fdb its giving below error
Can't format message 13:98 -- message file C:\firebird.msg not found. Unable to complete network request to host "localhost". Failed to establish a connection. An attempt was made to access a socket in a way forbidden by its access permissions.
I don't understand what is this error tried changing port cheked free ports using netstat command no use.
Any help will be highly appreciated
Thanks in Advance
I think I had the same problem in the past.
Re-installing Firebird helped.
Issue Sorted out.
Thanks to those who gave some suggestions.
It was Windows One Care firewall service which was blocking all the ports in the vista system.
I could not find it because it was visible only in the services and not anywhere else.
Read the entire Configuring Firebird. Create an alias of your database.
Also take a look on the Installing Notes. Add exception to the windows firewall. If still encountering problems take a look on the http://www.gradiencesupport.com/entries/20932048-Gradience-Pro-Enterprise-Unable-to-connect-to-your-Interbase-Firebird-Server