Unknown server error occured

I installed the pritunl server by using this url that is https://pritunl.com/ but after installed and when I entered the set up key and click on save. The error is showing that is Unknown server error occured.

Check /var/log/pritunl.log for the error message.

[local][2024-01-16 14:51:05,370][INFO] Starting setup server
[local][2024-01-16 14:51:05,374][INFO] Generating setup server ssl cert
[local][2024-01-16 14:54:32,292][ERROR] Pritunl setup failed
Traceback (most recent call last):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/init.py”, line 82, in setup_db
setup_mongo()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/mongo.py”, line 333, in setup_mongo
client = pymongo.MongoClient(
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 690, in init
seeds.update(uri_parser.split_hosts(entity, port))
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/uri_parser.py”, line 364, in split_hosts
raise ConfigurationError("Empty host " “(or extra comma in host list).”)
pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).
[local][2024-01-16 14:55:19,548][ERROR] Pritunl setup failed
Traceback (most recent call last):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/init.py”, line 82, in setup_db
setup_mongo()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/mongo.py”, line 333, in setup_mongo
client = pymongo.MongoClient(
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 690, in init
seeds.update(uri_parser.split_hosts(entity, port))
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/uri_parser.py”, line 364, in split_hosts
raise ConfigurationError("Empty host " “(or extra comma in host list).”)
pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).
[local][2024-01-16 14:58:42,776][ERROR] Exception on /setup/mongodb [PUT]
Traceback (most recent call last):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 2190, in wsgi_app
response = self.full_dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1484, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 169, in setup_mongodb_put
if check_db_ver():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 267, in check_db_ver
db_ver = utils.get_db_ver()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 93, in get_db_ver
return _get_version_doc().get(‘version’) or (
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 83, in _get_version_doc
doc = settings_db.find_one({
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/collection.py”, line 1491, in find_one
for result in cursor.limit(-1):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1280, in next
if len(self.__data) or self._refresh():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1165, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2027, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 1976, in __start_session
server_session = self._get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2013, in _get_server_session
return self._topology.get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 525, in get_server_session
session_timeout = self._check_session_support()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 507, in _check_session_support
self._select_servers_loop(
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 226, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 65a64c2c519299ef73cf45a3, topology_type: Single, servers: [<ServerDescription (‘localhost’, 27017) server_type: Unknown, rtt: None, error=AutoReconnect(‘localhost:27017: [Errno 111] Connection refused’)>]>
[local][2024-01-16 14:58:42,776][ERROR] Exception on /setup/mongodb [PUT]
Traceback (most recent call last):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 2190, in wsgi_app
response = self.full_dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1484, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 169, in setup_mongodb_put
if check_db_ver():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 267, in check_db_ver
db_ver = utils.get_db_ver()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 93, in get_db_ver
return _get_version_doc().get(‘version’) or (
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 83, in _get_version_doc
doc = settings_db.find_one({
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/collection.py”, line 1491, in find_one
for result in cursor.limit(-1):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1280, in next
if len(self.__data) or self._refresh():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1165, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2027, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 1976, in __start_session
server_session = self._get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2013, in _get_server_session
return self._topology.get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 525, in get_server_session
session_timeout = self._check_session_support()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 507, in _check_session_support
self._select_servers_loop(
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 226, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 65a64c2c519299ef73cf45a3, topology_type: Single, servers: [<ServerDescription (‘localhost’, 27017) server_type: Unknown, rtt: None, error=AutoReconnect(‘localhost:27017: [Errno 111] Connection refused’)>]>
[local][2024-01-16 14:59:21,756][ERROR] Exception on /setup/mongodb [PUT]
Traceback (most recent call last):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 2190, in wsgi_app
response = self.full_dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1484, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 169, in setup_mongodb_put
if check_db_ver():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 267, in check_db_ver
db_ver = utils.get_db_ver()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 93, in get_db_ver
return _get_version_doc().get(‘version’) or (
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 83, in _get_version_doc
doc = settings_db.find_one({
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/collection.py”, line 1491, in find_one
for result in cursor.limit(-1):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1280, in next
if len(self.__data) or self._refresh():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1165, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2027, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 1976, in __start_session
server_session = self._get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2013, in _get_server_session
return self._topology.get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 525, in get_server_session
session_timeout = self._check_session_support()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 507, in _check_session_support
self._select_servers_loop(
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 226, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 65a64c53519299ef73cf45a5, topology_type: Single, servers: [<ServerDescription (‘localhost’, 27017) server_type: Unknown, rtt: None, error=AutoReconnect(‘localhost:27017: [Errno 111] Connection refused’)>]>
[local][2024-01-16 14:59:21,756][ERROR] Exception on /setup/mongodb [PUT]
Traceback (most recent call last):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 2190, in wsgi_app
response = self.full_dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1484, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/flask/app.py”, line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 169, in setup_mongodb_put
if check_db_ver():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/setup/server.py”, line 267, in check_db_ver
db_ver = utils.get_db_ver()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 93, in get_db_ver
return _get_version_doc().get(‘version’) or (
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/utils/misc.py”, line 83, in _get_version_doc
doc = settings_db.find_one({
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/collection.py”, line 1491, in find_one
for result in cursor.limit(-1):
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1280, in next
if len(self.__data) or self._refresh():
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/cursor.py”, line 1165, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2027, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 1976, in __start_session
server_session = self._get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/mongo_client.py”, line 2013, in _get_server_session
return self._topology.get_server_session()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 525, in get_server_session
session_timeout = self._check_session_support()
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 507, in _check_session_support
self._select_servers_loop(
File “/usr/lib/pritunl/usr/lib/python3.9/site-packages/pymongo/topology.py”, line 226, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 65a64c53519299ef73cf45a5, topology_type: Single, servers: [<ServerDescription (‘localhost’, 27017) server_type: Unknown, rtt: None, error=AutoReconnect(‘localhost:27017: [Errno 111] Connection refused’)>]>

The MongoDB server is offline. Run sudo systemctl status mongod and sudo cat /var/log/mongodb/mongodb.log to find the issue with the MongoDB server.

It’s likely the wrong MongoDB package was installed on the server. You need to use the package for the correct Linux distribution and version. Check the MongoDB documentation and verify the MongoDB repository file matches the server distribution.

I ran into the same problem.
After researching I found that I have an inadequate CPU. MongoDB requires avx CPU feature from version 5 onwards. MongoDB v5.0 requires CPU AVX instructions · Issue #1724 · turnkeylinux/tracker · GitHub
Old AMD and even some modern Intel processors do not have this. I’ve got an Intel(R) Celeron J6412.
How sad.