server closed the connection unexpectedly python - python-3.x

server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
and when I run with docker exec ...
psql: error: could not connect to server: could not translate
host name "potgres" to address: No address associated with hostname
my port seems like that :
0.0.0.0:5431->5431/tcp, 5432/tcp
even when I change port number in file.yml , there is nothing happen!

Are you sure you spelled your hostname correctly?
psql: error: could not connect to server: could not translate
host name "potgres" to address: No address associated with hostname
It looks like you misspelled postgres as potgres.

Related

Remote access to OpenShift Local (CRC) running on Win11

I've got CRC running on Windows 11 and I would like to connect there from a RHEL9 VM.
CRC listening on 127.0.0.1:6443
Port forwarding rule created on Win machine to fwd connections on 192.168.1.156 (local intf) to 127.0.0.1:
$ netsh interface portproxy show v4tov4
Listen on ipv4: Connect to ipv4:
Address Port Address Port
192.168.1.156 9000 127.0.0.1 6443
Added rule in firewall to allow connections to port 9000
From the VM:
[test#workstation ~]$ telnet 192.168.1.156 9000
Trying 192.168.1.156...
Connected to 192.168.1.156.
Escape character is '^]'.
Connection closed by foreign host.
[test#workstation ~]$ oc login -u developer -p developer https://192.168.1.156:9000
The server is using a certificate that does not match its hostname: x509: certificate is valid for 10.217.4.1, not 192.168.1.156
You can bypass the certificate check, but any data you send to the server could be intercepted by others.
Use insecure connections? (y/n): y
Error from server (InternalError): Internal error occurred: unexpected response: 412
Any idea on how I can fix this and be able to connect from my VM towards CRC?
thanks

I am running a redis(docker image) on local nodejs application [duplicate]

This question already has answers here:
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
(7 answers)
Closed 1 year ago.
i'm trying to use redis connection on local node js application but it throwing an error ---
events.js:183
throw er; // Unhandled 'error' event
^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
If I understand correctly, you are running node inside a Docker container. This node process is trying to reach redis instance running at localhost.
This does not work, because container (node) has its own network stack, and 127.0.0.1 does not point to the host.
In this case you'd need to either
Run redis in its own container (and use e.g. docker-compose) OR
Change the Node connection host for redis from localhost (or 127.0.0.1) to your host IP address. See How to get the primary IP address of the local machine on Linux and OS X? for finding IP address
You are trying to connect to the wrong port. As the docker ps command says, the port where redis is listening is 32768. Connecting to that port should solve your issue.
See the official docker documentation (in particular the flag -p) for more information about customizing port listening.
You can also resolve this error by redoing your Docker container, just add the "-p 6379: 6379" flag. Example (Redis with persistent date):
docker run --name some-redis -p 6379:6379 -d redis redis-server
--appendonly yes

How to connect to ClamAV daemon?

I'm trying to connect to ClamAV daemon clamd on localhost 3310 port via telnet comand in terminal:telnet 127.0.0.1 3310
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
nIDSESSION [pressed ENTER button on keyboard]
nPING [pressed ENTER]
But it gives error:
1: Only nCMDS\n and zCMDS\0 are accepted inside IDSESSION. ERROR
1: Error processing command. ERROR
Connection closed by foreign host.
Entered zPING\0 [pressed ENTER] or nPING\n useless, prompts that error again.
Can you suggest anything?

OperationalError: could not connect to server: Permission denied tTCP/IP connections on port 5432?

I can able to connect postgres from terminal as well as python manage.py dbshell command
But when i'm trying to connect from apache i'm Getting error as follows.
Error : OperationalError: could not connect to server: Permission denied
Is the server running on host "192.168.1.10" and accepting
TCP/IP connections on port 5432?
My listen Address on postgress conf file is 192.168.1.10 Address
pg_hg_cong allowed host all all 192.168.0.0/24 trust
And also selinux turned httpd_can_network_connect_db on
Port is listening on 192.168.1.10:5432 on netstat output.
And database's are storing in /tmp directory
wxrwxrwx. 1 postgres postgres 0 Dec 18 07:40 .s.PGSQL.5432
-rw-------. 1 postgres postgres 50 Dec 18 07:40 .s.PGSQL.5432.lock
Actually I have enabled selinux httpd_can_network_connect_db parameters on db server instead of web server
So issue got solved after enabling httpd_can_network_connect_db on web server

nodejs - cassandra-client error: All connections are unhealthy

I keep getting this error when I try to retrieve/update data from cassandra using cassandra-client.
{ [Error: All connections are unhealthy.]
connectionInfo:
{ host: 'localhost',
port: 9160,
keyspace: 'keyspace1',
user: undefined,
pass: undefined,
use_bigints: false,
timeout: 4000,
log_time: false,
staleThreshold: 10000 } }
Haven't got a clue as to what this error means.
The error indicates that your client is not able to connect to the specified server on localhost port 9160.
Since this is localhost you can most likely exclude any firewall problems.
What you can do
1. Check if your server is running after all
This should show you one or more processes ( except the grep process you're just executing
ps aux | grep "cassandra"
2. Verify the port
# telnet localhost 9160
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Bad.. This would indicate that something with your configuration might be wrong. In my case I simply don't have a cassandra server listening to port 9160 ( running at all )
3. Check your logfile
By default casandra writes into the folder /var/log/cassandra/
If anything is wrong with the server, you'll most likely have some more information available in there, might even show a problem related to your nodejs client
4. Try another client for debugging
http://wiki.apache.org/cassandra/GettingStarted#Step_4:_Using_cassandra-cli

Resources