Pymongo error, connection refused

Hi, our cryoSPARC crashed and after restarting the workstation and attempting to restart cryoSPARC we get the following error:

cryosparcm start

Starting cryoSPARC System master process..

CryoSPARC is not already running.

database: started

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/site-packages/pymongo/mongo_client.py", line 1149, in database_names

 "listDatabases")["databases"]]

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/site-packages/pymongo/database.py", line 491, in command

 with client._socket_for_reads(read_preference) as (sock_info, slave_ok):

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/contextlib.py", line 17, in __enter__

 return self.gen.next()

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/site-packages/pymongo/mongo_client.py", line 859, in _socket_for_reads

 with self._get_socket(read_preference) as sock_info:

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/contextlib.py", line 17, in __enter__

 return self.gen.next()

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/site-packages/pymongo/mongo_client.py", line 823, in _get_socket

 server = self._get_topology().select_server(selector)

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/site-packages/pymongo/topology.py", line 214, in select_server

 address))

  File "/home/cryosparc2_master/deps/anaconda/lib/python2.7/site-packages/pymongo/topology.py", line 189, in select_servers

 self._error_message(selector))

pymongo.errors.ServerSelectionTimeoutError: localhost:39001: [Errno 111] Connection refused

Any suggestions how to solve this issue would be much appreciated.

Hi @asente,

Can you post the logs of cryosparcm log database?
It looks like the main application cannot reach the database via the port 39000. Is it possible that this port is blocked? CentOS’s built-in firewall automatically blocks any outgoing ports. You might need to create a rule.

Hi @stephan, initially the error message was this:

cryosparcm log database
2019-05-25T21:17:57.971+0100 I -        [conn133] end connection 10.91.193.135:56854 (12 connections now open)
2019-05-25T21:17:58.467+0100 I -        [conn134] end connection 10.91.193.135:56858 (11 connections now open)
2019-05-25T21:17:59.437+0100 I NETWORK  [thread1] connection accepted from 10.91.193.135:56862 #135 (11 connections now open)
2019-05-25T21:17:59.438+0100 I NETWORK  [conn135] received client metadata from 10.91.193.135:56862 conn135: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Scientific Linux 7.6 Nitrogen", architecture: "x86_64", version: "3.10.0-957.12.1.el7.x86_64" }, platform: "CPython 2.7.15.final.0" }
2019-05-25T21:18:00.097+0100 I -        [conn135] end connection 10.91.193.135:56862 (11 connections now open)
2019-05-25T21:18:00.104+0100 I NETWORK  [thread1] connection accepted from 10.91.193.135:56868 #136 (11 connections now open)
2019-05-25T21:18:00.105+0100 I NETWORK  [conn136] received client metadata from 10.91.193.135:56868 conn136: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Scientific Linux 7.6 Nitrogen", architecture: "x86_64", version: "3.10.0-957.12.1.el7.x86_64" }, platform: "CPython 2.7.15.final.0" }
2019-05-25T21:18:00.673+0100 I -        [conn136] end connection 10.91.193.135:56868 (11 connections now open)
2019-05-25T21:18:01.952+0100 I NETWORK  [thread1] connection accepted from 10.91.193.135:56870 #137 (11 connections now open)
2019-05-25T21:18:01.952+0100 I NETWORK  [conn137] received client metadata from 10.91.193.135:56870 conn137: { driver: { name: "PyMongo", version: "3.4.0" }, os: { type: "Linux", name: "Scientific Linux 7.6 Nitrogen", architecture: "x86_64", version: "3.10.0-957.12.1.el7.x86_64" }, platform: "CPython 2.7.15.final.0" }

I tried deleting cryosparc, reinstalling on the same machine and restoring the old database and this is the error I get now:

2019-05-28T09:51:36.659+0100 I STORAGE  [initandlisten] exception in initAndListen: 98 Unable to lock file: /home/user/cryosparc_database/mongod.lock Resource temporarily unavailable. Is a mongod instance already running?, terminating
2019-05-28T09:52:14.296+0100 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-05-28T09:52:14.296+0100 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2019-05-28T09:52:14.296+0100 I CONTROL  [initandlisten] now exiting
2019-05-28T09:52:14.296+0100 I CONTROL  [initandlisten] shutting down with code:100
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] MongoDB starting : pid=14536 port=39001 dbpath=/home/user/cryosparc_database 64-bit host=lg38
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] db version v3.4.10-4-g67ee356c6b
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] git version: 67ee356c6be377cda547d16423daef5beb4e8377
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2p  14 Aug 2018
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] allocator: tcmalloc
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] modules: none
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] build environment:
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten]     distarch: x86_64
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten]     target_arch: x86_64
2019-05-28T09:52:15.349+0100 I CONTROL  [initandlisten] options: { net: { port: 39001 }, replication: { oplogSizeMB: 64, replSet: "meteor" }, storage: { dbPath: "/home/user/cryosparc_database", journal: { enabled: false }, wiredTiger: { engineConfig: { cacheSizeGB: 4.0 } } } }
2019-05-28T09:52:15.349+0100 I STORAGE  [initandlisten] exception in initAndListen: 98 Unable to lock file: /home/user/cryosparc_database/mongod.lock Resource temporarily unavailable. Is a mongod instance already running?, terminating
2019-05-28T23:04:55.603+0100 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-05-28T23:04:55.603+0100 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2019-05-28T23:04:55.603+0100 I CONTROL  [initandlisten] now exiting
2019-05-28T23:04:55.603+0100 I CONTROL  [initandlisten] shutting down with code:100

Thanks

Hi @asente,

Is it possible that there is another process of mongodb running on your system? Please use ps -ax | grep supervisord to find and kill any PID’s that may be running related to cryoSPARC before reinstalling