# Failed first run Deb11 and http PORT set

**URL:** https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397
**Category:** Pritunl
**Created:** [September 21, 2022, 4:29pm UTC](https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397 "2022-09-21T16:29:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![John39](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@John39](https://forum.pritunl.com/u/John39)
#### Post date: [September 21, 2022, 4:29pm UTC](https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397/1 "2022-09-21T16:29:14Z")

</div>

Hello.

1. On a server with services already listening on 80/443 what is the easiest way to configure the listening port (admin panel) before/during install to not conflict or cause problems?

2. Installed mongo and pritunl on Deb11 based on script in install instructions. Cannot start, fails on python errors below;  
syslog

pritunl[10947]: Could not find platform independent libraries   
pritunl[10947]: Could not find platform dependent libraries \<exec\_prefix\>  
pritunl[10947]: Consider setting $PYTHONHOME to [:\<exec\_prefix\>]  
pritunl[10947]: Fatal Python error: initfsencoding: Unable to get the locale encoding  
pritunl[10947]: ModuleNotFoundError: No module named ‘encodings’  
pritunl[10947]: Current thread 0x00007f14500e8740 (most recent call first):  
systemd[1]: pritunl.service: Main process exited, code=killed, status=6/ABRT  
systemd[1]: pritunl.service: Failed with result ‘signal’.

attempt to set listening port based on 3rd party suggesiton;

$\> pritunl set app.server\_port 9005

Could not find platform independent libraries   
Could not find platform dependent libraries \<exec\_prefix\>  
Consider setting $PYTHONHOME to [:\<exec\_prefix\>]  
Fatal Python error: initfsencoding: Unable to get the locale encoding  
ModuleNotFoundError: No module named ‘encodings’

## Current thread 0x00007f5f99f75740 (most recent call first): Aborted

Stock install, everything installed from Debian Repo.

python 2.7.18  
python 3.9.2  
Debian 11 - 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1

Thanks.

---

<div class="post-metadata">

### Author: ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)
#### Post date: [September 21, 2022, 4:51pm UTC](https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397/2 "2022-09-21T16:51:27Z")

</div>

This is likely from using the Debian 10 repository on Debian 11. Check the [**repository documentation**](https://docs.pritunl.com/docs/repo) and verify the correct repository is configured.

---

<div class="post-metadata">

### Author: ![John39](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@John39](https://forum.pritunl.com/u/John39)
#### Post date: [September 21, 2022, 5:18pm UTC](https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397/3 "2022-09-21T17:18:39Z")

</div>

1. Ok, checked the install script and that is correct, buster is defined. Removed, changed to bullseye, re-installed.

Now new error;

[undefined][2022-09-21 13:17:40,869][ERROR] Pritunl setup failed  
Traceback (most recent call last):  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pritunl/setup/ **init**.py”, line 89, in setup\_db\_host  
setup\_mongo()  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pritunl/setup/mongo.py”, line 327, in setup\_mongo  
client = pymongo.MongoClient(  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pymongo/mongo\_client.py”, line 680, in **init**  
seeds.update(uri\_parser.split\_hosts(entity, port))  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pymongo/uri\_parser.py”, line 359, in split\_hosts  
raise ConfigurationError("Empty host "  
pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).  
Traceback (most recent call last):  
File “/usr/bin/pritunl”, line 33, in   
sys.exit(load\_entry\_point(‘pritunl==1.30.3292.22’, ‘console\_scripts’, ‘pritunl’)())  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pritunl/ **main**.py”, line 164, in main  
setup.setup\_db\_host()  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pritunl/setup/ **init**.py”, line 89, in setup\_db\_host  
setup\_mongo()  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pritunl/setup/mongo.py”, line 327, in setup\_mongo  
client = pymongo.MongoClient(  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pymongo/mongo\_client.py”, line 680, in **init**  
seeds.update(uri\_parser.split\_hosts(entity, port))  
File “/usr/lib/pritunl/lib/python3.9/site-packages/pymongo/uri\_parser.py”, line 359, in split\_hosts  
raise ConfigurationError("Empty host "  
pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).

1. comment on changing the listening port on install?  
Edit: I changed port # in /etc/pritunl.conf , assume that is where to make the change? cannot confirm listening due to above error.

Thanks.

---

<div class="post-metadata">

### Author: ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)
#### Post date: [September 21, 2022, 6:44pm UTC](https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397/4 "2022-09-21T18:44:03Z")

</div>

That would indicate the [**MongoDB URI connection string**](https://www.mongodb.com/docs/manual/reference/connection-string/) in `/etc/pritunl.conf` is invalid.

The [**load balancing documentation**](https://docs.pritunl.com/docs/load-balancing) has information on changing the server port. You will need to run `sudo pritunl set app.redirect_server false` to disable usage of port 80 on the Pritunl server.

---

<div class="post-metadata">

### Author: ![John39](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/j/b9e5f3/32.png) [@John39](https://forum.pritunl.com/u/John39)
#### Post date: [September 21, 2022, 7:23pm UTC](https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397/5 "2022-09-21T19:23:55Z")

</div>

Yes it would, and it is incorrect;

```auto
 "mongodb_uri": ""

```

This was installed using the install instructions on the download page. It seems something in the setup isn’t working correctly if it isn’t populating the uri correctly.

This seems like an install bug. Since I am not a python developer, where do I go from here?

We are trying to evaluate pritunl to use company wide and so far can’t even get past the documented install procedure. Any assistance to getting this fully working would be appreciated.

Thanks.

edit: running pritunl reconfigure → then changes /etc/pritunl.conf to

“mongodb\_uri”: null,

obviously that will cause an error of database undefined.

---

<div class="post-metadata">

### Author: ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)
#### Post date: [September 21, 2022, 7:45pm UTC](https://forum.pritunl.com/t/failed-first-run-deb11-and-http-port-set/397/6 "2022-09-21T19:45:12Z")

</div>

You’re running `sudo pritunl set` before initializing the server. When the server first starts the web console will show a page to configure the MongoDB URI, it will default to `mongodb://localhost:27017/pritunl`. You can initialize the server without the web console by adding that URI to the configuration then run `sudo systemctl restart pritunl`. Then `sudo pritunl set` will function,
