[Ubuntu 20.04] Webui reports unknown error when providing setup key

Followed procedure as stated here:

Everything works until I have to paste setup key into the webui, it throws an unknown error, setup cannot be completed.

Edit: sorry for having the dumbs, OS is Ubuntu 20.04

Check /var/log/pritunl.log for more information. This is likely from an issue connecting to the MongoDB database.

Currently the MongoDB server isn’t available on Ubuntu 22.04. The repository had shown a directory for Ubuntu 22.04 but it was never tested before the announcement yesterday about support for Ubuntu 22.04. Currently the database would need to be run on another server when using Ubuntu 22.04.

pasting pritunl.log

[undefined][2022-07-26 08:28:50,744][ERROR] Exception on /setup/mongodb [PUT]
Traceback (most recent call last):
File “/usr/lib/pritunl/lib/python3.8/site-packages/flask/app.py”, line 2073, in wsgi_app
response = self.full_dispatch_request()
File “/usr/lib/pritunl/lib/python3.8/site-packages/flask/app.py”, line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/lib/pritunl/lib/python3.8/site-packages/flask/app.py”, line 1516, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/pritunl/lib/python3.8/site-packages/flask/app.py”, line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File “/usr/lib/pritunl/lib/python3.8/site-packages/pritunl/setup/server.py”, line 169, in setup_mongodb_put
if check_db_ver():
File “/usr/lib/pritunl/lib/python3.8/site-packages/pritunl/setup/server.py”, line 267, in check_db_ver
db_ver = utils.get_db_ver()
File “/usr/lib/pritunl/lib/python3.8/site-packages/pritunl/utils/misc.py”, line 90, in get_db_ver
return _get_version_doc().get(‘version’) or (
File “/usr/lib/pritunl/lib/python3.8/site-packages/pritunl/utils/misc.py”, line 80, in _get_version_doc
doc = settings_db.find_one({
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/collection.py”, line 1328, in find_one
for result in cursor.limit(-1):
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/cursor.py”, line 1238, in next
if len(self.__data) or self._refresh():
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/cursor.py”, line 1130, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/mongo_client.py”, line 1935, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/mongo_client.py”, line 1883, in __start_session
server_session = self._get_server_session()
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/mongo_client.py”, line 1921, in _get_server_session
return self._topology.get_server_session()
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/topology.py”, line 520, in get_server_session
session_timeout = self._check_session_support()
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/topology.py”, line 499, in _check_session_support
File “/usr/lib/pritunl/lib/python3.8/site-packages/pymongo/topology.py”, line 218, in _select_servers_loop
raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: 62dfa5a4333b96ab3e7c24dc, topology_type: Single, servers: [<ServerDescription (‘localhost’, 27017) server_type: Unknown, rtt: None, error=AutoReconnect(‘localhost:27017: [Errno 111] Connection refused’)>]>

Can I fix it ?

The MongoDB server isn’t running. Check sudo systemctl status mongod

If the server is Ubuntu 20.04 verify that the Ubuntu Focal repositories are configured in /etc/apt/sources.list.d/mongodb-org-5.0.list and /etc/apt/sources.list.d/pritunl.list

mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: core-dump) since Tue 2022-08-02 10:47:08 UTC; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 7420 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=dumped, signal=ILL)
Main PID: 7420 (code=dumped, signal=ILL)

Aug 02 10:47:08 vpn2 systemd[1]: Started MongoDB Database Server.
Aug 02 10:47:08 vpn2 systemd[1]: mongod.service: Main process exited, code=dumped, status=4/ILL
Aug 02 10:47:08 vpn2 systemd[1]: mongod.service: Failed with result ‘core-dump’.

Make sure your CPU supports AVX instructions.
Run: grep avx /proc/cpuinfo, and look for the avx avx2 flags, older CPUs do not support those instructions (Anything older than 2011).

Also, is this a VM? What’s your hypervisor? I’ve seen things like Hyper-V’s “CPU Compatibility” break mongodb. For the same reason, that flag disables AVX, even if the CPU supports it.