Is the server running on that host and accepting TCP/IP connections? - python-3.x

I am working on a Django project as a Front-End developer. I am getting " django.db.utils.OperationalError: connection to server at "13.234.81.119", port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?"
many times when I try to run the server using the command python manage.py runserver on VS Code
Because of this, I have to restart the server, and sometimes luckily server works.
I did the following things to resolve the problem:
NOTE: I am using windows 11.
1) deleted temporary files using the command %temp%
2) reinstalled psycopg 2.9.2
3) I reset the TCP/IP settings in services on my PC.
but the problem did not solve.
I am attaching the screenshots of the complete error log. Please help me to resolve the issue, I will be grateful to you

Is your Postgres running on the port you specified if not?
Go inside the bin folder in the C drive where Postgres is installed. run the following command in git bash or Command prompt:
pg_ctl.exe restart -D "<path upto data>"
Example
pg_ctl.exe restart -D "C:\Program Files\PostgreSQL\9.6\data"

Related

Remote debugging nodejs app in Intellij with Docker - port already allocated

I want to start debugging node.js app using Intellij and node.js interpreter running on Docker. While running the app works, when I try to debug I get the error:
Error running 'index.js'
com.github.dockerjava.api.exception.InternalServerErrorException:
{"message":"driver failed programming external connectivity on
endpoint focused_poincare
(a17137973880d1be7c6a74fc142184fdda31e0dec8ebd539b09d9dbe4cf70014):
Error starting userland proxy: Bind for 0.0.0.0:55578 failed: port is
already allocated"}
Remote interpreter was configured acccording to the documentation. I have created a new Node.js Run/Debug configuration and entered the following data:
.
What might be the cause for debugging not working?
I use:
Intellij Idea Ultimate v. 2019.1.4 Preview
Intellij NodeJS plugin v. 191.7479.1, NodeJS remote interpreter plugin v. 191.6014.8 and Docker plugin v. 191.7141.44
Docker Desktop Community v. 2.0.0.3
EDIT: Adressing the comments:
Local debugging works. The file (index.js) that I am trying to run consists only of console.log('Hello world!') so I don't spawn any child processes on my own. My host system has Windows 10 Pro as OS, so for checking the open ports on host system I used netstat -an | find "55578", which returned nothing. Moreover, if I try to run docker manually from the command line, using docker run -it -p 55578:55578 node, everything runs and no error is given.
Also, each time I try remote debugging, the port number given by Intellij in an error message seems to be random high port number. I tried looking for open ports just after getting error message, but never found one that is open with a number reported by Intellij and those indeed appear in the output:
My Run/Debug configuration:
My Docker configuration (I had to check "Expose daemon on tcp://localhost:2375 without TLS" in Docker configuration to make Intellij and Docker play together):
EDIT: When I add --inspect-brk=0.0.0.0:55432 as "Node Parameters" in "Run/Debug Configurations" Intellij windows (per this bug report) the container nad program start, but debugging seems to be no-op (e.g. the program does not stop on breakpoints).
After updating to Intellij v. 2019.2 I was able to get the container debugging to work using the workaround already mentioned in my question.
I have added a parameter --inspect-brk=0.0.0.0:55432 to Node parameters option in Run/Debug configuration (see the picture below) and everything seems to be working, including the breakpoints.

Cloud foundry SSH not working

I am not able to make SSH working.
I checked that SSH is enable on the Application and Space level.
But when i ran
cf ssh "MY-APP-NAME" i get the following error:
FAILED
Error: SSH session allocation failed: ssh: unexpected packet in response to
channel open: <nil>
I also tried to connect without CLi and using the command
ssh -p 2222 cf:abcdefab-1234-5678-abcd-1234abcd1234/0#ssh.MY-DOMAIN.com
But when i entered the password the server stopped the connection (i used Putty).
I am trying to access with SSH because i need to launch npm install to install the dependencies of my application.
Thank you for your help
There is no need to ssh into an app to install dependencies.
Please have a look at Swisscoms Getting Started Guide for Node.js:
https://docs.developer.swisscom.com/tutorial-nodejs/index.html
The section 'Declare App Dependencies' (https://docs.developer.swisscom.com/tutorial-nodejs/dependencies.html) shows you how you specify the dependencies in a file called 'package.json'. This will then be automatically installed by the nodejs buildpack (https://github.com/cloudfoundry/nodejs-buildpack).

Mongo shell not connecting

Mongo shell not connecting
I have dedicated centos server
I installed mongodb as a service in my server from here
I even restarted server after installing mongodb
When i tries to run mongo shell it always saying
Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
I tried to remove that mongod.lock but no joy
I dont understand why this happens, because when mongod starts as a service it creates a log in system and telling that it has opened the door to listen incoming connection on port 27017. But it is throwing error while i connecting to mongo shell.
Please see this steps i have used --> click here
Well i wants to use this mongo service first of all at local based with only 127.0.0.1 access. I can change that in mongod.conf file afterward.
Be sure with iptables, Firwalll causing this kind of issue on live server.
So please do this if you facing this kind of same issue,
Do iptables off for a moment
# /etc/init.d/iptables stop
# sudo service mongod start
# mongo
Here what i wanted to see finally,
MongoDB shell version: 2.6.7
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
show dbs
admin (empty)
local 0.078GB
Thanks guys who considered my question and looking in it.
Thanks a lot.

postgresql commands not being executed

I downloaded postgresql-9.1.
but when I execute the command in terminal:
$ createdb mydb
I get the following message:
createdb: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
please tell me how to sort this problem.I have even tried to uninstall and then reinstall it. I am trying to run this on linux mint 15 (cinnamon).
Use ps to see if the postgresql process is actually running. If not, start it (service postgresql start). Normally should start up itself on boot after installation but who knows. Also, some error may prevent it from starting on boot.
If postgresql is running, then you may need to edit pg_hba.conf in the data directory. Again, normally the database should listen for local connections by default but who knows.

Shutdown Cassandra server and then restart it in windows 7

I installed single node cluster in my local dev box which is running Windows 7 and it was working fine. Due to some reason, I need to restart my desktop and then after that whenever I am doing like this on the command prompt, it always gives me the below exception-
S:\Apache Cassandra\apache-cassandra-1.2.3\bin>cassandra -f
Starting Cassandra Server
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 7199; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
Meaning port being used somewhere. I have made some changes in cassandra.yaml file so I need to shutdown the Cassandra server and then restart it again.
Can anybody help me with this?
Thanks for the help.
in windows7, with apache cassandra, a pid.txt file gets created at the root folder of cassandra. Give following instruction to stop the server:
d:/cassandra/bin> stop-server -p ../pid.txt -f
Running -f starts the server as a service, you can stop it through the task manager.
It sounds like your Cassandra server starts on it's own as a service in the background when your machine boots. You can configure windows startup services. To run cassandra in the foreground on windows simply use:
> cassandra.bat
If your are using Cassandra bundled with DataStax Community Edition and running as a service on startup of your machine then you can execute following commands to start and stop Cassandra server.
Start command prompt with admin rights
run following commands
net start DataStax_Cassandra_Community_Server
net stop DataStax_Cassandra_Community_Server

Resources