Mongodb: Connection reset by peer - mongodb

I have a Mongo server running on an Ubuntu box, and I am trying to connect to it with pymongo using the usual syntax:
from pymongo import Connection
c = Connection('db.example.com', 27017)
This works just fine on a recent-model Intel mac (OS 10.6). However, the same code on an older G5 tower (10.5) throws this error:
pymongo.errors.AutoReconnect: [Errno 54] Connection reset by peer
The mongo output on the server reports:
connection accepted from oldmac.example:57681 #3
bad recv() len: 973078528
end connection oldmac.example:57681
I know that I cannot run the mongodb server from the PPC Mac, but it seems odd that I wouldn't be able to connect to the remote database. Or is something else at fault?

Looks like Mike Dirolf already answered your question in the MongoDB Google Group. But for people experiencing the same issue and find themselves on this page, the solution from Mike Dirolf:
Are you using the C extension? (try
pymongo.has_c()). I wouldn't think
that the C extension would even build
on PPC but if it did that is almost
certainly the reason this isn't
working. You can install w/o C with
python setup.py install --no_ext and
then I'd expect things to work.
-- Mike Dirolf

I was able to solve this same issue by using MongoClient instead of the deprecated Connection.
From the Python driver for MongoDB page
Warning DEPRECATED: Connection is deprecated. Please use MongoClient
instead.
For more information, see the new MongoClient documentation for Python.

I was facing the same issue with python3.8, i tried to upgrade and downgrade the pymongo but the result was same Connection reset by peer.
To overcome this problem uninstall the python3.8 and install python3.7 and it work fine. Now i am able to connect to the mongodb and able to perform query.

Related

Strapi instalation has error: connect ECONNREFUSED 127.0.0.1:5432

I just install Strapi but with PostgreQL DB (not using -- quickstart which means SQLite)
1. yarn create strap'-app name-of-my-project,
2. submit all QA=default step-by-step (database=strapi, port=default, login/password nothing fancy, and last without SSL connection)
And the finall result is not so descriptive. Only server error with connecting, which I don't know
Connection test failed: connect ECONNREFUSED 127.0.0.1:5433
Problem solved! (after 2 hours of trying instalation)
The answer is => You have to install PostgreSQL DB too on your computer
Once its done, next, you can run Strapi by yarn develop
So the problem is solved. Other problem in meantime solved
`Server wasn't able to start properly. Error: The server does not support SSL connections. Try to install without SSL connection (last question in Strapi install process)
I know you resolved the issue but just posting this in case anybody needs specific instructions.
I followed this tutorial and it's working for me now.
Sidenote: Once I installed Postgres and ran the command psql postgres it prompted me to enter my password. Despite putting in the correct password it still gave me an error that it is the wrong password, so I ran psql postgres postgres and then entering my password resolved the issue for me.
Instead of downloading postgres you can apply docker and it works the same
Link: https://blog.dehlin.dev/docker-with-strapi-v4
I had the same problem and as Kris says above, you need to install postgresql, pgAdmin and create the database first to then can create your Strapi project linked to you database.
I followed this youtube tutorial (in spanish) to solve it very easy.
Also need to avoid enable SSL for your local project. If you need to change this option in the future you can make it in the strapi config/database.js file.
Good luck!

PostgreSQL could not receive data from server: Software caused connection abort (0x00002745/10053)

I tried to establish a connection in pgAdmin to the PostgresSQL server.
I always get the message:
could not receive data from server: Software caused connection abort (0x00002745/10053).
I read several posts where people had the same problem but they didn't help me.
Because my version was a bit older I uninstalled the whole postgresql and installed the newest version with the installer of EnterpriseDB (PostgreSQL 9.6 on windows 64). Everything looks fine. But I can't connect to the server from pgAdmin 4 again. I get the same error message.
In the logfile is written: "An existing connection was forcibly closed by the remote host"
Has anybody a clue what the problem could be?
A partial solution for me was to restart the postgresql-server each time after booting up my computer with NET STOP and NET START. This was cumbersome but worked.
Because my computer still had other connection problems, subsequently I updated my system to Windows 10 which totally solved all my problems.

Robomongo: Connection error. Uninitialized Mongo scope

The connection opens successfully (with authentication). The Database and the collection are displayed. But if I open any shell I got this error:
Connection error. Uninitialized mongo scope.
The connection with the Mongo.exe and Java-Driver works fine. What does the error message mean? How to fix that?
I just removed the special character from the password and works now.
It seems to be a bug in RoboMongo; if the password contains an apostrophe, then you can connect OK but you get this error when you try to run a query.
I have logged it as an issue with the RoboMongo team: https://github.com/paralect/robomongo/issues/1300
Note: no other characters seem to cause this problem, only the apostrophe.
None of the above solutions work if you have recently upgraded to Robo 3T v1.3 and trying to connect to an older MongoDB version like <3.0. Apparently, Robo 3T removed some of the support for older versions and you get the same "Uninitialized mongo scope" error. Reverting to Robo 3T v1.2 is the only solution to this one.
This is not error message you need to reauthenticate( Remove connection and add new Connection) database connection.
Once you reauthenticate and connect with the database. All will work fine.

can't connect mongoDB to localhost

hey there I don't know why the server refuse to connect to mongo local host and the same problem also for robomongo =[. I was looking for the same error in this site and others but no answer is relevant...I thought it might happened because robomongo is also running and I uninstalled it but...it didn't solve it...I'm using windows 10. tried to do from mongo's directory mongod.exe and it didn't work than mongo.exe but also didn't work...can someone help me?
run the MongoDB you need to open another command prompt and use the following command. “C:\Experiments\MongoDB\MongoDbServer\bin>mongo”. It will show the version of MongoDb and connected database, By default it is test. Other window will show one connection is open.
Read this Article

Can't connect to postgresql server installed locally on my machine

I have installed the DSP(Dreamfactory Service Platform) locally on my Mac Book Pro using Bitnani.
I have a PostGreSQL server running locally on my Macbook, which I want to connect to using the DSP.
I am successfully able to connect to my PostGreSQL server from other applications, which essentially means that there is no problem with the setup.
However, on trying to connect the same from DSP I get the error:- "Failed to launch service "sql": CDbConnection failed to open the DB connection."
My connection string is :- "pgsql:host=localhost;dbname=Pinu"
Also, the password has been correctly entered.
The port is default as 5432. Whether or not I enter the same in the connection string, the connection always fails.
Even though I am trying to add the service as Remote SQL DB, I know that it's actually on the same local host. Not sure if that is the issue.
I also tried entering - 127.0.0.1 in place of localhost, but still I see the same issue.
Any help in this regard would be highly appreciated!
After talking to you via email, it looks like the root issue here is that you haven't successfully upgraded your DSP to the latest version. We are releasing DreamFactory version 1.8 on Bitnami tomorrow, so you should upgrade to the latest version.
As far as your PostgreSQL issue let's explore some options:
1) Connection strings:
a) pgsql:host=localhost;dbname=Pinu
b)
pgsql:host=localhost:5432;dbname-Pinu
c)
pgsql:host=localhost;port=5432;dbname=Pinu
2) If these don't work, try substituting your localhost with
127.0.0.1 (as you've tried previously, but test this in all scenarios).
3)
pgsql:host=localhost;port=5432;dbname=series1;schema=schema_name_here
Typically, Option A should work without a problem.
Give these a try if you would, and if you need some help upgrading then reach out to me again via email.
--Thanks,
Mark